# C++ Programming Examples on Graph Problems & Algorithms

This section covers C++ Programming Examples on Graph Problems & Algorithms. Every example program includes the description of the program, C++ code as well as output of the program. Here is the listing of C++ programming examples:

**1. C++ Programming examples on “Connected Components”**

C++ Program to Solve any Linear Equation in One Variable C++ Program to Check the Connectivity of Undirected Graph Using BFS C++ Program to Check the Connectivity of Directed Graph Using BFS C++ Program to Check the Connectivity of Undirected Graph Using DFS C++ Program to Check the Connectivity of Directed Graph Using DFS C++ Program to Test Using DFS Whether a Directed Graph is Weakly Connected or Not C++ Program to Check Whether a Graph is Strongly Connected or Not C++ Program to Check if an UnDirected Graph is a Tree or Not Using DFS C++ Program to Check if a Directed Graph is a Tree or Not Using DFS C++ Program to Find the Connected Components of an UnDirected Graph C++ Program to Create a Minimal Set of All Edges Whose Addition will Convert it to a Strongly Connected DAG C++ Program to Find Strongly Connected Components in Graphs |

**2. C++ Programming examples on “Topological Sorting”**

C++ Program to Apply DFS to Perform the Topological Sorting of a Directed Acyclic Graph C++ Program to Check Whether Topological Sorting can be Performed in a Graph C++ Program to Create a Random Linear Extension for a DAG C++ Program to Generate All the Possible Linear Extensions of a DAG C++ Program to Remove the Edges in a Given Cyclic Graph such that its Linear Extension can be Found C++ Program to Check Cycle in a Graph using Topological Sort C++ Program for Topological Sorting in Graphs |

**3. C++ Programming examples on “Minimum Spanning Tree”**

C++ Program to Apply the Prim’s Algorithm to Find the Minimum Spanning Tree of a Graph C++ Program to Apply the Kruskal’s Algorithm to Find the Minimum Spanning Tree of a Graph C++ Program to Use Boruvka’s Algorithm to Find the Minimum Spanning Tree C++ Program to Create a MST of a Set of Points Spread in Two Dimensions Using Delaunay Triangulation C++ Program to Give an Efficient Algorithm to Compute the Second-Best Minimum Spanning Tree of G C++ Program to Find MST(Minimum Spanning Tree) using Kruskal’s Algorithm C++ Program to Find MST(Minimum Spanning Tree) using Prim’s Algorithm |

**4. C++ Programming examples on “Shortest Path”**

**5. C++ Programming examples on “Transitive Closure and Reduction”**

C++ Program to Find the Transitive Closure of a Given Graph G C++ Program to Construct Transitive Closure Using Warshall’s Algorithm C++ Program to Find Transitive Closure of a Graph |

**6. C++ Programming examples on “Matching”**

C++ Program to Solve a Matching Problem for a Given Specific Case C++ Program to Rearrange Letters of a String such that no More than 1 Letters should Retain the Same Position C++ Program to Solve a Matching Problem for a Given Specific Case C++ Program to Implement the Hungarian Algorithm for Bipartite Matching C++ Program to Implement the Edmond’s Algorithm for Maximum Cardinality Matching C++ Program to Solve a Matching Problem for a Given Specific Case |

**7. C++ Programming examples on “Eulerian Cycle/Chinese Postman”**

C++ Program to Check Whether an Undirected Graph Contains a Eulerian Cycle C++ Program to Check Whether an Undirected Graph Contains a Eulerian Path C++ Program to Check Whether a Directed Graph Contains a Eulerian Cycle C++ Program to Check Whether a Directed Graph Contains a Eulerian Path C++ Program to Give an Implementation of the Traditional Chinese Postman Problem C++ Program to Implement Euler Circuit Problem |

**8. C++ Programming examples on “Edge and Vertex Connectivity”**

**9. C++ Programming examples on “Drawing Trees”**

**10. C++ Programming examples on “Planarity Detection and Embedding”**

C++ Program to Check Whether a Graph is Planar or Not C++ Program to Implement the Hopcroft and Tarjan Algorithm C++ Program to Implement the Booth and Lueker Algorithm to Check for Planarity |

**11. C++ Programming examples on “Graph Search”**

C++ Program to Implement Beam Search Algorithm C++ Program to Implement Best First Search C++ Program to Implement Bidirectional Search C++ Program to Find All Forward Edges in a Graph C++ Program to Find All Cross Edges in a Graph C++ Program to Find All Back Edges in a Graph C++ Program to Implement Depth-Limited Search C++ Program to Implement Iterative Deepening C++ Program to Implement Uniform-Cost Search |

**12. C++ Programming examples on “Other”**

C++ Program to Find Inverse of a Graph Matrix C++ Program to Find Transpose of a Graph Matrix C++ Program to Implement Network_Flow Problem |

**13. C++ Programming examples on “Network Flow”**

C++ Program to Implement The Edmonds-Karp Algorithm C++ Program to Implement Ford–Fulkerson Algorithm |

**14. C++ Programming examples on “Graph Traversal”**

C++ Program to Traverse a Graph using BFS C++ Program to Traverse a Graph using DFS |

If you want to learn implementations of all algorithms and programs in C++,

**Here’s the list of 1000 C++ Algorithms, Problems & Programming Examples.**