Graph Algorithms Last Updated : 23 Jul, 2025 Comments Improve Suggest changes Like Article Like Report Graph is a non-linear data structure like tree data structure. The limitation of tree is, it can only represent hierarchical data. For situations where nodes or vertices are randomly connected with each other other, we use Graph. Example situations where we use graph data structure are, a social network, a computer network, a network of locations used in GPS and many more examples where different nodes or vertices are connected without any hierarchic or constraint on structure.BasicsGraph and its representationsBFS and DFS Breadth First TraversalDepth First Traversal Difference between BFS and DFSRotten TomatoesIslands in a GraphFlood FillCheck for BipartiteWord Ladder Snakes and LadderWater Jug problemPacific Atlantic Water FlowShortest Path in Binary MatrixClone a Graph Transitive Closure of a Graph using DFSCycles Cycle in a Directed GraphCycle in an undirected graphCycle in a graph using colorsNegative cycle in a Graph | (Bellman Ford)Cycles of length nClone a Directed Acyclic Graph Disjoint Set Data Structure or Union-Find AlgorithmShortest Path Dijkstra’s shortest path aBellman–Ford Floyd Warshall Johnson’s algorithm Shortest Path in Directed Acyclic GraphDial’s AlgorithmMultistage Graph (Shortest Path)Shortest path in an unweighted graphMinimum mean weight cycle algorithm0-1 BFS (Shortest PathMinimum weight cycle D’Esopo-Pape AlgorithmMinimum Spanning TreePrim’s Minimum Spanning Tree (MST)Kruskal’s Minimum Spanning Tree Prim’s vs Kruskal’s algorithm for MSTApplications of Minimum Spanning Tree ProblemMinimum cost to connect all citiesTotal number of Spanning Trees in a GraphMinimum Product Spanning TreeReverse Delete Algorithm for Minimum Spanning TreeBoruvka’s algorithm for Minimum Spanning TreeTopological SortingTopological SortingAll topological sorts of a Directed Acyclic GraphKahn’s Algorithm for Topological SortingMaximum edges that can be added to DAG so that is remains DAGLongest Path in a Directed Acyclic GraphTopological Sort of a graph using departure time of vertexFind Itinerary from a given list of ticketsConnectivity in GraphArticulation Points (or Cut Vertices) in a GraphBiconnected ComponentsBridges in a graphEulerian path and circuitFleury’s Algorithm for printing Eulerian Path or CircuitStrongly Connected ComponentsCount all possible walks from a source to a destination with exactly k edgesEuler Circuit in a Directed GraphLength of shortest chain to reach the target wordFind if an array of strings can be chained to form a circleTarjan’s Algorithm to find strongly connected ComponentsPaths to travel each nodes using each edge (Seven Bridges of Königsberg)Dynamic Connectivity | Set 1 (Incremental)Maximum Flow in GraphMax Flow Problem IntroductionFord-Fulkerson Algorithm for Maximum Flow ProblemFind maximum number of edge disjoint paths between two verticesFind minimum s-t cut in a flow networkMaximum Bipartite MatchingChannel Assignment ProblemIntroduction to Push Relabel AlgorithmKarger’s Algorithm- Set 1- Introduction and ImplementationDinic’s algorithm for Maximum FlowSome must do Problems Find length of the largest region in Boolean MatrixCount number of trees in a forestA Peterson Graph ProblemClone an Undirected GraphGraph Coloring (Introduction and Applications)Traveling Salesman Problem (TSP) ImplementationVertex Cover Problem | Set 1 (Introduction and Approximate Algorithm)K Centers Problem | Set 1 (Greedy Approximate Algorithm)Erdos Renyl Model (for generating Random Graphs)Chinese Postman or Route Inspection | Set 1 (introduction)Hierholzer’s Algorithm for directed graphCheck whether a given graph is Bipartite or notSnake and Ladder ProblemBoggle (Find all possible words in a board of characters)Hopcroft Karp Algorithm for Maximum Matching-IntroductionMinimum Time to rot all orangesConstruct a graph from given degrees of all verticesDetermine whether a universal sink exists in a directed graphNumber of sink nodes in a graphTwo Clique Problem (Check if Graph can be divided in two Cliques)If you are looking for difficulty-wise list of problems, please refer to Graph Data Structure.Some QuizzesQuizzes on Graph TraversalQuizzes on Graph Shortest PathQuizzes on Graph Minimum Spanning TreeQuizzes on GraphsQuick Links :Top 10 Interview Questions on Depth First Search (DFS)Some interesting shortest path questionsPractice Problems on Graphs Recommended:Learn Data Structure and Algorithms | DSA Tutorial Introduction to Graph Visit Course Introduction to Graph Graph Representation (Adjacency Matrix) Graph Representation (Adjacency List) GRAPH Data Structure | What is Graph? | DSA Course Comment More infoAdvertise with us H harendrakumar123 Follow Improve Article Tags : Graph DSA Practice Tags : Graph Explore Basics & PrerequisitesLogic Building Problems 2 min read Analysis of Algorithms 1 min read Data StructuresArray Data Structure 3 min read String in Data Structure 2 min read Hashing in Data Structure 2 min read Linked List Data Structure 2 min read Stack Data Structure 2 min read Queue Data Structure 2 min read Tree Data Structure 4 min read Graph Data Structure 3 min read Trie Data Structure 15+ min read AlgorithmsSearching Algorithms 2 min read Sorting Algorithms 3 min read Introduction to Recursion 14 min read Greedy Algorithms 3 min read Graph Algorithms 3 min read Dynamic Programming or DP 3 min read Bitwise Algorithms 4 min read AdvancedSegment Tree 2 min read Binary Indexed Tree or Fenwick Tree 15 min read Square Root (Sqrt) Decomposition Algorithm 15+ min read Binary Lifting 15+ min read Geometry 2 min read Interview PreparationInterview Corner 3 min read GfG160 3 min read Practice ProblemGeeksforGeeks Practice - Leading Online Coding Platform 6 min read Problem of The Day - Develop the Habit of Coding 5 min read Like