C Program to Find the Transitive Closure of a Graph using Warshall’s Algorithm

This is a C Program to find Transitive Closure. Floyd–Warshall algorithm is a graph analysis algorithm for finding shortest paths in a weighted graph with positive or negative edge weights but with no negative cycles and also for finding transitive closure of a relation R. Here is source code of the C Program to Construct … Read more

advertisement

C Program to Find the Vertex Connectivity of a Graph

This is a C Program to find vertex connectivity of a graph. A vertex in an undirected connected graph is an articulation point if and only if removing it disconnects the graph. Here is source code of the C Program to Find the Vertex Connectivity of a Graph. The C program is successfully compiled and … Read more

advertisement

C Program to Apply DFS to Perform the Topological Sorting of a Directed Acyclic Graph

This is a C Program to perform Topological Sorting. Topological sorting for Directed Acyclic Graph (DAG) is a linear ordering of vertices such that for every directed edge pq, vertex p comes before q in the ordering. Topological Sorting for a graph is not possible if the graph is not a DAG. Here is source … Read more

advertisement

C Program to Find Shortest Path using Dijkstra’s Algorithm

This is a C Program to find Dijkstra algorithm. Dijkstra’s algorithm is very similar to Prim’s algorithm for minimum spanning tree. Like Prim’s MST, we generate a SPT (shortest path tree) with given source as root. We maintain two sets, one set contains vertices included in shortest path tree, other set includes vertices not yet … Read more

advertisement

C Program to Solve Stable Marriage Problem

This is a C Program to solve a matching problem. Given N men and N women, where each person has ranked all members of the opposite sex in order of preference, marry the men and women together such that there are no two people of opposite sex who would both rather have each other than … Read more

advertisement

C Program to Check Whether a Given Graph is Bipartite or not

This is a C Program to check if a graph is Bipartite. A bipartite graph or bigraph is a graph whose vertices can be divided into two disjoint sets P and Q (that is, P and Q are each completely independent sets) such that every edge connects a vertex in P to one in Q. … Read more

advertisement

C Program to Check if Graph is DAG

This is a C Program to check whether graph is DAG. A directed acyclic graph, is a directed graph which has no directed cycles. That is, it is formed by a collection of vertices and directed edges, each edge connecting one vertex to another, such that there is no way to start at some vertex … Read more

advertisement

C Program to Generate a Random Subset by Coin Flipping

This is a C Program to generate a random subset by flipping coin. Basic idea is to generate randomly number either 0/1, if the number is zero print the subset. Here is source code of the C Program to Generate a Random Subset by Coin Flipping. The C program is successfully compiled and run on … Read more

advertisement

C Program to Create a Random Graph Using Random Edge Generation

This C program generates a random graph using random edge generation. Generate random number of edges between the vertices and print the graph. Here is the source code of the C program to generate a random graph. The C program is successfully compiled and run on a Linux system. The program output is also shown … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.