Graph Data Structure Last Updated : 23 Jul, 2025 Suggest changes Share Like Article Like Report Graph Data Structure is a collection of nodes connected by edges. It's used to represent relationships between different entities. If you are looking for topic-wise list of problems on different topics like DFS, BFS, Topological Sort, Shortest Path, etc., please refer to Graph Algorithms. Basics of Graph:Introduction to GraphsGraph and its representationsTranspose graphEasy ProblemsBreadth First Traversal for a GraphDepth First Traversal for a GraphShortest path in an unweighted graph0-1 BFS (Shortest Path in a Binary Weight Graph)Count number of trees in a forestTopological SortingAll topological sorts of a Directed Acyclic GraphKahn’s Algorithm for Topological SortingSum of dependencies in a graphMaximum Weight NodeMedium ProblemsTransitive Closure of a Graph using DFSRotten TomatoesIslands in a GraphFlood FillCheck for BipartiteWord Ladder Snakes and LadderWater Jug problemShortest Path in Binary MatrixClone a GraphDetect Cycle in a Directed GraphDetect cycle in an Undirected graphDetect a negative cycle in a Graph | (Bellman Ford)Cycles of length n in an undirected and connected graphDetecting negative cycle using Floyd WarshallClone a Directed Acyclic GraphIntroduction to Disjoint Set Data Structure or Union-Find AlgorithmUnion By Rank and Path Compression in Union-Find AlgorithmDijkstra’s shortest path algorithmBellman–Ford AlgorithmFloyd Warshall AlgorithmJohnson’s algorithm for All-pairs shortest pathsMultistage Graph (Shortest Path)Karp’s minimum mean (or average) weight cycle algorithmFind minimum weight cycle in an undirected graphPrim’s Minimum Spanning Tree (MST)Kruskal’s Minimum Spanning Tree AlgorithmDifference between Prim’s and Kruskal’s algorithm for MSTApplications of Minimum Spanning Tree ProblemMinimum cost to connect all citiesMinimum Product Spanning TreeReverse Delete Algorithm for Minimum Spanning TreeBoruvka’s algorithm for Minimum Spanning TreeMaximum 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 ticketsEulerian 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 GraphPaths to travel each nodes using each edge (Seven Bridges of Königsberg)Length of shortest chain to reach the target wordDynamic Connectivity | Set 1 (Incremental)Max Flow Problem IntroductionFord-Fulkerson Algorithm for Maximum Flow ProblemFind maximum number of edge disjoint paths between two verticesMaximum Bipartite MatchingChannel Assignment ProblemKarger’s Algorithm- Set 1- Introduction and ImplementationDinic’s algorithm for Maximum FlowFind length of the largest region in Boolean MatrixA Peterson Graph ProblemClone an Undirected GraphGraph Coloring (Introduction and Applications)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)Hard ProblemsPacific Atlantic Water FlowTotal number of Spanning Trees in a GraphLongest Path in a Directed Acyclic GraphBridges in a graphArticulation Points (or Cut Vertices) in a GraphBiconnected ComponentsFind if an array of strings can be chained to form a circleTarjan’s Algorithm to find strongly connected ComponentsFind minimum s-t cut in a flow networkTraveling Salesman Problem (TSP) ImplementationVertex Cover Problem | Set 1 (Introduction and Approximate Algorithm)K Centers Problem | Set 1 (Greedy Approximate Algorithm) A amitja57a Follow Explore DSA FundamentalsLogic 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 2 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 Article Tags : Graph DSA Like