Graph Data Structure Last Updated : 13 Apr, 2025 Comments Improve Suggest changes 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) Comment More infoAdvertise with us Next Article Graph Data Structure A amitja57a Follow Improve Article Tags : Graph DSA Practice Tags : Graph Similar Reads What is Graph Data Structure? A Graph is a non-linear data structure consisting of vertices and edges. The vertices are sometimes also referred to as nodes and the edges are lines or arcs that connect any two nodes in the graph. More formally a Graph is composed of a set of vertices( V ) and a set of edges( E ). The graph is den 3 min read Graph terminology in data structure Graphs are fundamental data structures in various computer science applications, including network design, social network analysis, and route planning. Understanding graph terminology is crucial for effectively navigating and manipulating graph data structures. In this article, we will discuss the g 5 min read Introduction to Graph Data Structure Graph Data Structure is a non-linear data structure consisting of vertices and edges. It is useful in fields such as social network analysis, recommendation systems, and computer networks. In the field of sports data science, graph data structure can be used to analyze and understand the dynamics of 15+ min read Applications of Graph Data Structure A graph is a non-linear data structure, which consists of vertices(or nodes) connected by edges(or arcs) where edges may be directed or undirected. In Computer science graphs are used to represent the flow of computation.Google maps uses graphs for building transportation systems, where intersection 3 min read Graph Data Structure Notes for GATE Exam [2024] Graphs, a fundamental concept in computer science and mathematics, serve as powerful tools for modeling and solving a myriad of real-world problems. As aspirants gear up for the GATE Exam 2024, a comprehensive understanding of graph data structures becomes paramount. These notes aim to provide a con 15+ min read Introduction to Tree Data Structure Tree data structure is a hierarchical structure that is used to represent and organize data in the form of parent child relationship. The following are some real world situations which are naturally a tree.Folder structure in an operating system.Tag structure in an HTML (root tag the as html tag) or 15+ min read Sparse Graph Graphs are fundamental structures in computer science and mathematics and it is used to model relationships between objects. Understanding the various types of graphs is very important for anyone working in fields like data analysis, networking, and algorithm design. One such type is the sparse grap 9 min read Self Referential Structures Self Referential structures are those structures that have one or more pointers which point to the same type of structure, as their member. In other words, structures pointing to the same type of structures are self-referential in nature Example:Â CPP struct node { int data1; char data2; struct node 8 min read Graph Theory Tutorial Graph Theory is a branch of mathematics that is concerned with the study of relationships between different objects. A graph is a collection of various vertexes also known as nodes, and these nodes are connected with each other via edges. In this tutorial, we have covered all the topics of Graph The 1 min read Commonly Asked Data Structure Interview Questions on Graph A graph is a non-linear data structure that consists of a set of nodes (also known as vertices) connected by edges. Unlike trees, which have a hierarchical structure, graphs can represent more complex relationships, such as social networks, web pages, road maps, and more. This article contains the m 7 min read Like