Program: /* Q8.WAP to color your graph using given 4 colors(r,g,b,y).Print all the possible combinations of colors which can...
Read More
Showing posts with label Graphs. Show all posts
Showing posts with label Graphs. Show all posts
15 Program to perform Dijkstra Algorithm to Find Shortest Path Source Vertex
Program: /* Dijkstra's Algorithm */ #include<iostream> #define INF INT_MAX using namespace std; class Gra...
Read More
14 Program to perform Kruskal's Algorithm to find the Minimum Cost Spanning Tree.
Steps: 1) Add Edges in Ascending Order by their Weight 2) Do not Create a Cycle. If any edge is Creating a Cycle Skip that Edge Prog...
Read More
13 Program to perform Prims Algorithm to find the Minimum Cost Spanning Tree.
Program: /* Prims Algorithm */ #include<iostream> #define INF INT_MAX using namespace std; class Graph { int g[20...
Read More
12 Program to find Spanning Tree
Program: /* Spanning Tree 6 0 0 0 0 1 0 2 1 3 2 3 1 4 4 3 4 5 3 5 2 5 -1 -1 */ #include<iostream> #define INF 9999...
Read More
11 Program to implement Topological Sort
Program: /* Q1.WAP to implement topological sort. */ #include<iostream> using namespace std; class Graph { int **...
Read More
10 Program to find Transitive Closure of a Graph using Warshall's Algorithm
Program: /* Warshall's Algorithm */ #include<iostream> using namespace std; class Graph { int g[20][20]; int...
Read More
9 Program to find Transitive Closure by using Matrix Multiplication
Program: /* Scan adjacency matrix of graph.Find transitive closure by using matrix multiplication. */ #include <iostre...
Read More
Subscribe to:
Posts (Atom)