{"id":37218,"date":"2025-06-28T14:19:13","date_gmt":"2025-06-28T08:49:13","guid":{"rendered":"https:\/\/www.iquanta.in\/blog\/?p=37218"},"modified":"2025-06-28T14:19:46","modified_gmt":"2025-06-28T08:49:46","slug":"graph-data-structure-its-types-and-representation","status":"publish","type":"post","link":"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/","title":{"rendered":"Graph Data Structure : Its Types and Representation"},"content":{"rendered":"\n<p>Graphs are the most important and versatile concept in computer science. There are many real world applications that simulate graph data structure which includes the friends recommendation of facebook, google maps shortest path finding application and many more.&nbsp;<\/p>\n\n\n\n<p>Unlike trees, graphs use network models and are a non-linear data structures. A graph is a network model that organizes data when we want to show how things are connected or solve&nbsp;problems where connections between the objects are crucial.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img fetchpriority=\"high\" decoding=\"async\" width=\"328\" height=\"328\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Graph-DS-1-edited.png\" alt=\"Graph in Data Structure\" class=\"wp-image-37221\" style=\"width:252px;height:auto\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Graph-DS-1-edited.png 328w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Graph-DS-1-edited-300x300.png 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Graph-DS-1-edited-150x150.png 150w\" sizes=\"(max-width: 328px) 100vw, 328px\" \/><\/figure><\/div>\n\n\n<p>In this blog we will be covering the introduction of graph data structure, types of graph data structure , graph representation in data structure, graph traversal algorithms in data structure like BFS ( Breadth First Search ) and DFS ( Depth First Search )&nbsp; along with different real life application of graph data structure.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/chat.whatsapp.com\/B6weknl7133BQXjPva0pgB\"><img decoding=\"async\" width=\"1024\" height=\"159\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/01\/DSAWHATSAPPBANNER-2-23-1024x159.jpg\" alt=\"\" class=\"wp-image-41481\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/01\/DSAWHATSAPPBANNER-2-23-1024x159.jpg 1024w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/01\/DSAWHATSAPPBANNER-2-23-300x47.jpg 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/01\/DSAWHATSAPPBANNER-2-23-768x119.jpg 768w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/01\/DSAWHATSAPPBANNER-2-23-1536x238.jpg 1536w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/01\/DSAWHATSAPPBANNER-2-23-2048x317.jpg 2048w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/01\/DSAWHATSAPPBANNER-2-23-150x23.jpg 150w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/01\/DSAWHATSAPPBANNER-2-23-696x108.jpg 696w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/01\/DSAWHATSAPPBANNER-2-23-1068x166.jpg 1068w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/01\/DSAWHATSAPPBANNER-2-23-1920x298.jpg 1920w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div>\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_77 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#What_is_Graph_Data_Structure\" >What is Graph Data Structure?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#Types_of_Graph_Data_Structure\" >Types of Graph Data Structure<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#Directed_Graph\" >Directed Graph<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#Undirected_Graph\" >Undirected Graph<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#Weighted_Graph\" >Weighted Graph<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#Cyclic_Graph\" >Cyclic Graph<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#Acyclic_Graph\" >Acyclic Graph<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#Complete_Graph\" >Complete Graph<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#Connected_Graph\" >Connected Graph<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#Disconnected_Graph\" >Disconnected Graph<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#Bipartite_Graph\" >Bipartite Graph<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#Planar_Graph\" >Planar Graph<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#Multigraph_in_Data_Structure\" >Multigraph in Data Structure<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#Eulerian_Graph_Data_Structure\" >Eulerian Graph Data Structure<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#Hamiltonian_Graph_in_Data_Structure\" >Hamiltonian Graph in Data Structure<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#Graph_Representation_in_Data_Structure\" >Graph Representation in Data Structure<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#Adjacency_Matrix\" >Adjacency Matrix&nbsp;&nbsp;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#Adjacency_List\" >Adjacency List&nbsp;<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#Graph_Traversal_in_Data_Structure\" >Graph Traversal in Data Structure&nbsp;<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#Breadth_First_Search_Graph_Traversal_Algorithm\" >Breadth First Search Graph Traversal Algorithm<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#Depth_First_Search_Graph_Traversal_Algorithm\" >Depth First Search Graph Traversal Algorithm<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#Application_of_Graph_in_Data_Structure\" >Application of Graph in Data Structure<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#Social_Media_Platforms\" >Social Media Platforms<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#Graphs_in_Machine_learning\" >Graphs in Machine learning<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#Graphs_in_Computer_Networks\" >Graphs in Computer Networks<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-what-is-graph-data-structure\"><span class=\"ez-toc-section\" id=\"What_is_Graph_Data_Structure\"><\/span><strong>What is Graph<\/strong> <strong>Data Structure?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Graph is a data structure and it is used to represent the relationships between the entities. Graph data structure contains nodes and to connect nodes between each other we have edges. In the given diagram nodes are the individual entities or points within the graph data structure.<\/p>\n\n\n\n<p>Graph data structure is really powerful because they bring clarity to complexity by reducing intricate systems into a simple structure of nodes and edges. This allows us to visualize and analyze relationships in a comprehensive yet intuitive way. Their adaptability makes them even more valuable, as the same graph structure can represent vastly different systems, such as transportation networks, supply chains, or social interactions. Moreover, graphs are fundamental in problem-solving, offering solutions to challenges like finding the shortest path in navigation apps, detecting clusters within social groups, or analyzing influence within a network. This combination of simplicity, flexibility, and utility makes graphs an indispensable tool in understanding and addressing real-world problems.<\/p>\n\n\n\n<p>If we are taking real life examples of social media platforms like Facebook and Instagram, they are highly using graph data structures. We are the users on social media platforms representing nodes of a graph and edges representing some kind of relationship between the users.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-types-of-graph-data-structure\"><span class=\"ez-toc-section\" id=\"Types_of_Graph_Data_Structure\"><\/span><strong>Types of Graph Data Structure<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-directed-graph\"><span class=\"ez-toc-section\" id=\"Directed_Graph\"><\/span><strong>Directed Graph<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Directed graph in graph <a href=\"https:\/\/www.iquanta.in\/blog\/category\/iskills\/dsa-competitive-programming\/\">data structure<\/a> represents the direction between the nodes. The edges connected between the nodes show a specific direction that relates the relationship between the nodes in one way. So this graph represents the relationship flow between nodes in one direction but not necessarily in the reverse direction as well.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" width=\"406\" height=\"258\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Directed-Graph-1.png\" alt=\"Directed Graph\" class=\"wp-image-37223\" style=\"width:217px;height:auto\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Directed-Graph-1.png 406w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Directed-Graph-1-300x191.png 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Directed-Graph-1-150x95.png 150w\" sizes=\"(max-width: 406px) 100vw, 406px\" \/><figcaption class=\"wp-element-caption\"><strong>Directed Graph in Data Structure<\/strong><\/figcaption><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-undirected-graph\"><span class=\"ez-toc-section\" id=\"Undirected_Graph\"><\/span><strong>Undirected Graph <\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Undirected graph is said to be just the opposite of a directed graph in which the relationship flow between the nodes is bidirectional.&nbsp; Let\u2019s consider two nodes in the below diagram i.e, 99 and 97 , you can move from 99 to 97 and also from 97 to 99 without any restriction.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"393\" height=\"230\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Undirected-graph-1.png\" alt=\"Undirected Graph\" class=\"wp-image-37226\" style=\"width:267px;height:auto\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Undirected-graph-1.png 393w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Undirected-graph-1-300x176.png 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Undirected-graph-1-150x88.png 150w\" sizes=\"(max-width: 393px) 100vw, 393px\" \/><figcaption class=\"wp-element-caption\"><strong>Undirected Graph<\/strong> <strong>in Data Structure<\/strong><\/figcaption><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-weighted-graph\"><span class=\"ez-toc-section\" id=\"Weighted_Graph\"><\/span><strong>Weighted Graph<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Weighted graph is an important graph that represents the numerical value at every edge considered as weights. These weights on the edges represent the cost, distance, time, capacity or any other measures related to the relationships between the nodes.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"323\" height=\"268\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Weighted-Graph-1.png\" alt=\"Weighted Graph\" class=\"wp-image-37227\" style=\"width:229px;height:auto\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Weighted-Graph-1.png 323w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Weighted-Graph-1-300x249.png 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Weighted-Graph-1-150x124.png 150w\" sizes=\"(max-width: 323px) 100vw, 323px\" \/><figcaption class=\"wp-element-caption\"><strong>Weighted Graph<\/strong> <\/figcaption><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-cyclic-graph\"><span class=\"ez-toc-section\" id=\"Cyclic_Graph\"><\/span><strong>Cyclic Graph <\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Cyclic graph contains one cycle in its concept. A cycle happens when you can start at a node, follow edges, and come back to the same node without reusing any edge or node along the way.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"597\" height=\"221\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/cyclic-graph-1.png\" alt=\"Cyclic Graph\" class=\"wp-image-37228\" style=\"width:282px;height:auto\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/cyclic-graph-1.png 597w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/cyclic-graph-1-300x111.png 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/cyclic-graph-1-150x56.png 150w\" sizes=\"(max-width: 597px) 100vw, 597px\" \/><figcaption class=\"wp-element-caption\"><strong>Cyclic Graph<\/strong> <strong>in Data Structure<\/strong><\/figcaption><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-acyclic-graph\"><span class=\"ez-toc-section\" id=\"Acyclic_Graph\"><\/span><strong>Acyclic Graph<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Acyclic graph is just the opposite of a cyclic graph and has no cycle.. This means there are no paths in the graph that start and end at the same node while passing through other nodes or edges. As this is just the opposite of a cyclic graph.&nbsp;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"639\" height=\"276\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Acyclic-Graph-2.png\" alt=\"Acyclic Graph\" class=\"wp-image-37229\" style=\"width:307px;height:auto\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Acyclic-Graph-2.png 639w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Acyclic-Graph-2-300x130.png 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Acyclic-Graph-2-150x65.png 150w\" sizes=\"(max-width: 639px) 100vw, 639px\" \/><figcaption class=\"wp-element-caption\"><strong>Acyclic Graph in Data Structure<\/strong><\/figcaption><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-complete-graph\"><span class=\"ez-toc-section\" id=\"Complete_Graph\"><\/span><strong>Complete Graph<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A complete graph is a graph where every node is directly connected through the edges as there are no missing edges between any two nodes. It is a highly connected graph where every node is connected to every other node.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"274\" height=\"279\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/complete-graph-1.png\" alt=\"Complete Graph in data structure\" class=\"wp-image-37230\" style=\"width:164px;height:auto\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/complete-graph-1.png 274w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/complete-graph-1-150x153.png 150w\" sizes=\"(max-width: 274px) 100vw, 274px\" \/><figcaption class=\"wp-element-caption\"><strong>Complete Graph <\/strong><\/figcaption><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-connected-graph\"><span class=\"ez-toc-section\" id=\"Connected_Graph\"><\/span><strong>Connected Graph<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A connected graph connects every possible node to others, which means you can visit from any node to any other node by following the possible edges presents in the graph.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/chat.whatsapp.com\/B6weknl7133BQXjPva0pgB\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"159\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-172.png\" alt=\"\" class=\"wp-image-52846\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-172.png 1024w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-172-300x47.png 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-172-768x119.png 768w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-172-150x23.png 150w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-172-696x108.png 696w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"433\" height=\"259\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/connected-graoh-1.png\" alt=\"Connected Graph in Data Structure\" class=\"wp-image-37231\" style=\"width:267px;height:auto\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/connected-graoh-1.png 433w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/connected-graoh-1-300x179.png 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/connected-graoh-1-150x90.png 150w\" sizes=\"(max-width: 433px) 100vw, 433px\" \/><figcaption class=\"wp-element-caption\"><strong>Connected Graph in Data Structure<\/strong><\/figcaption><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-disconnected-graph\"><span class=\"ez-toc-section\" id=\"Disconnected_Graph\"><\/span><strong>Disconnected Graph<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A disconnected graph is exactly the reverse ( opposite ) of the connected graph present in the graph data structure. In a simple way, this graph has one or more separate components that have no edges connecting them.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"270\" height=\"319\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Disconnected-Graph-1.png\" alt=\"Disconnected Graph in Data Structure\" class=\"wp-image-37232\" style=\"width:174px;height:auto\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Disconnected-Graph-1.png 270w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Disconnected-Graph-1-254x300.png 254w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Disconnected-Graph-1-150x177.png 150w\" sizes=\"(max-width: 270px) 100vw, 270px\" \/><figcaption class=\"wp-element-caption\"><strong>Disconnected Graph in Data Structure<\/strong><\/figcaption><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-bipartite-graph\"><span class=\"ez-toc-section\" id=\"Bipartite_Graph\"><\/span><strong>Bipartite Graph<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A bipartite graph is a type of graph that can be split into two nodes (groups) and all the connections (edges) in the graph only go between these two groups, never within the same group.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"675\" height=\"413\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/bipartite-graph-1.png\" alt=\"Bipartite Graph in Data Structure\" class=\"wp-image-37233\" style=\"width:293px;height:auto\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/bipartite-graph-1.png 675w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/bipartite-graph-1-300x184.png 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/bipartite-graph-1-150x92.png 150w\" sizes=\"(max-width: 675px) 100vw, 675px\" \/><figcaption class=\"wp-element-caption\"><strong>Bipartite Graph<\/strong> <strong>in Data Structure<\/strong><\/figcaption><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-planar-graph\"><span class=\"ez-toc-section\" id=\"Planar_Graph\"><\/span><strong>Planar Graph<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>In real life applications there are a lot of uses of planar graphs that includes circuit designing, network planning etc. Planar graphs can be easily represented on a plane surface and edges are&nbsp; not crossing with each other for the concept of planar graph.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"320\" height=\"224\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/planar-graph.png\" alt=\"Planar Graph in Data Structure\" class=\"wp-image-37239\" style=\"width:239px;height:auto\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/planar-graph.png 320w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/planar-graph-300x210.png 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/planar-graph-150x105.png 150w\" sizes=\"(max-width: 320px) 100vw, 320px\" \/><figcaption class=\"wp-element-caption\"><strong>Planar Graph in Data Structure<\/strong><\/figcaption><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-multigraph-in-data-structure\"><span class=\"ez-toc-section\" id=\"Multigraph_in_Data_Structure\"><\/span><strong>Multigraph in Data Structure<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A multigraph is a graph data structure that allows multiple connections between the same pair of nodes, and it can also have loops. This makes it more flexible for modeling real-life systems with repeated connections or pathways.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"318\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Multigraph.png\" alt=\"Multigraph in Data Structure\" class=\"wp-image-37240\" style=\"width:189px;height:auto\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Multigraph.png 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Multigraph-283x300.png 283w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Multigraph-150x159.png 150w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><figcaption class=\"wp-element-caption\"><strong>Multigraph in Data Structure<\/strong><\/figcaption><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-eulerian-graph-data-structure\"><span class=\"ez-toc-section\" id=\"Eulerian_Graph_Data_Structure\"><\/span><strong>Eulerian Graph Data Structure<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Imagine you are walking along the paths (edges) in a neighborhood and you want to visit every path exactly once and return to where you started. If it&#8217;s possible, the graph is an Eulerian graph.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"496\" height=\"191\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Eulerian-Graph.png\" alt=\"Eulerian Graph in Data Structure \" class=\"wp-image-37241\" style=\"width:274px;height:auto\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Eulerian-Graph.png 496w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Eulerian-Graph-300x116.png 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Eulerian-Graph-150x58.png 150w\" sizes=\"(max-width: 496px) 100vw, 496px\" \/><figcaption class=\"wp-element-caption\"><strong>Eulerian Graph in Data Structure<\/strong><\/figcaption><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-hamiltonian-graph-in-data-structure\"><span class=\"ez-toc-section\" id=\"Hamiltonian_Graph_in_Data_Structure\"><\/span><strong>Hamiltonian Graph in Data Structure <\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Imagine you&#8217;re planning a trip to visit all the cities in a region without visiting any city more than once and then returning back to your starting city. If this route is possible, the graph is called a Hamiltonian graph.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"530\" height=\"225\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Hamiltonian-Graph.png\" alt=\"Hamiltonian Graph in Data Structure\" class=\"wp-image-37242\" style=\"width:289px;height:auto\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Hamiltonian-Graph.png 530w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Hamiltonian-Graph-300x127.png 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Hamiltonian-Graph-150x64.png 150w\" sizes=\"(max-width: 530px) 100vw, 530px\" \/><figcaption class=\"wp-element-caption\"><strong>Hamiltonian Graph in Data Structure<\/strong><\/figcaption><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-graph-representation-in-data-structure\"><span class=\"ez-toc-section\" id=\"Graph_Representation_in_Data_Structure\"><\/span><strong>Graph Representation in Data Structure<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-adjacency-matrix-nbsp-nbsp\"><span class=\"ez-toc-section\" id=\"Adjacency_Matrix\"><\/span><strong>Adjacency Matrix&nbsp;&nbsp;<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Graphs in data structures represented in a two possible manner through the adjacency matrix and adjacency list . Adjacency matrix is basically a square matrix that represents the entire graph in the form of a table or matrix . The table represents the entry of the edges between the respective nodes in the graph.\u00a0<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><a href=\"https:\/\/chat.whatsapp.com\/B6weknl7133BQXjPva0pgB\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"159\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-171.png\" alt=\"\" class=\"wp-image-52845\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-171.png 1024w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-171-300x47.png 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-171-768x119.png 768w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-171-150x23.png 150w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/06\/image-171-696x108.png 696w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div>\n\n\n<p>This is the best and easiest way to understand the representation of graphs in data structure.&nbsp; In the example given below we have 4 nodes in the graph and the table represents the entry of \u20181\u2019 if that particular edge exists between the nodes otherwise the blank box.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"681\" height=\"269\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/image-24.png\" alt=\"Undirected graph representation as a adjacency matrix\" class=\"wp-image-37243\" style=\"width:299px;height:auto\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/image-24.png 681w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/image-24-300x119.png 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/image-24-150x59.png 150w\" sizes=\"(max-width: 681px) 100vw, 681px\" \/><figcaption class=\"wp-element-caption\"><strong>Undirected graph representation as a adjacency matrix<\/strong><\/figcaption><\/figure><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"655\" height=\"345\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/directed-adjacency-2.png\" alt=\"Directed graph representation as adjacency matrix\" class=\"wp-image-37255\" style=\"width:302px;height:auto\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/directed-adjacency-2.png 655w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/directed-adjacency-2-300x158.png 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/directed-adjacency-2-150x79.png 150w\" sizes=\"(max-width: 655px) 100vw, 655px\" \/><figcaption class=\"wp-element-caption\"><strong>Directed graph representation as adjacency matrix<\/strong><\/figcaption><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-adjacency-list-nbsp\"><span class=\"ez-toc-section\" id=\"Adjacency_List\"><\/span><strong>Adjacency List&nbsp;<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Adjacency list is another way to represent the graph data structure. In an adjacency list, each node (vertex) has its own list that contains all the nodes (vertices) it is connected to. Instead of using a 2D matrix (like in adjacency matrix representation), the adjacency list uses a list of lists (or a dictionary) to store edges. In the given below diagrams you can visit for both undirected or directed graph representations as adjacency list.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"729\" height=\"239\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/directed-graph-adjacency-list.png\" alt=\"Directed graph representation as a adjacency list \" class=\"wp-image-37245\" style=\"width:303px;height:auto\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/directed-graph-adjacency-list.png 729w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/directed-graph-adjacency-list-300x98.png 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/directed-graph-adjacency-list-150x49.png 150w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/directed-graph-adjacency-list-696x228.png 696w\" sizes=\"(max-width: 729px) 100vw, 729px\" \/><figcaption class=\"wp-element-caption\"><strong>Directed graph representation as a adjacency list <\/strong><\/figcaption><\/figure><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"697\" height=\"255\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/undiected-graph-adjacency-list.png\" alt=\"Undirected graph representation as a adjacency list\" class=\"wp-image-37246\" style=\"width:312px;height:auto\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/undiected-graph-adjacency-list.png 697w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/undiected-graph-adjacency-list-300x110.png 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/undiected-graph-adjacency-list-150x55.png 150w\" sizes=\"(max-width: 697px) 100vw, 697px\" \/><figcaption class=\"wp-element-caption\"><strong>Undirected graph representation as a adjacency list<\/strong><\/figcaption><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-graph-traversal-in-data-structure-nbsp\"><span class=\"ez-toc-section\" id=\"Graph_Traversal_in_Data_Structure\"><\/span><strong>Graph Traversal in Data Structure&nbsp;<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-breadth-first-search-graph-traversal-algorithm\"><span class=\"ez-toc-section\" id=\"Breadth_First_Search_Graph_Traversal_Algorithm\"><\/span><strong>Breadth First Search Graph Traversal Algorithm<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Breadth-First search is an important algorithm for graph traversal. This algorithm visits all nodes in the graph but layer by layer ( you can understand level by level). First , it visits all neighbours of the particular level or layer and then visits the next level.<\/p>\n\n\n\n<p><strong>Here is the algorithm :&nbsp;<\/strong><\/p>\n\n\n\n<p style=\"margin-top:-26px\">Step 1 : Insert the start node in the queue and mark that as visited.<\/p>\n\n\n\n<p style=\"margin-top:-31px\">Step 2 : while the queue is not empty:<\/p>\n\n\n\n<p style=\"margin-top:-31px\">             Dequeue a node and process it.<\/p>\n\n\n\n<p style=\"margin-top:-26px\">Step 3 : Enqueue all its unvisited neighbors and mark them as visited.<\/p>\n\n\n\n<p style=\"margin-top:-26px\">Step 4 : Repeat until queue is empty<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"589\" height=\"416\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/BFS.png\" alt=\"Breadth First Search in Data Structure\" class=\"wp-image-37247\" style=\"width:321px;height:auto\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/BFS.png 589w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/BFS-300x212.png 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/BFS-150x106.png 150w\" sizes=\"(max-width: 589px) 100vw, 589px\" \/><figcaption class=\"wp-element-caption\">    <strong>Breadth First Search in Data Structure<\/strong><\/figcaption><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-depth-first-search-graph-traversal-algorithm\"><span class=\"ez-toc-section\" id=\"Depth_First_Search_Graph_Traversal_Algorithm\"><\/span><strong>Depth First Search Graph Traversal Algorithm<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Depth First Search algorithm is an important concept for graph traversal.&nbsp; This Algorithm visits every node in the graph but the way it visits is little different in comparison to breadth first search algorithm. DFS visits every node as far as possible for every branch of a graph before backtracking.&nbsp;<\/p>\n\n\n\n<p><strong>Here is the algorithm :&nbsp;<\/strong><\/p>\n\n\n\n<p style=\"margin-top:-26px\">Step 1 : Start from the given node&nbsp;<\/p>\n\n\n\n<p style=\"margin-top:-26px\">Step 2 : Mark the started node as visited&nbsp;<\/p>\n\n\n\n<p style=\"margin-top:-26px\">Step 3 : Recursively explore each unvisited neighbor of the current node.<\/p>\n\n\n\n<p style=\"margin-top:-26px\">Step 4 : Once all the neighbors visited the current node then backtrack.<\/p>\n\n\n\n<p style=\"margin-top:-26px\">Step 5 : Repeat these steps again and again until each and every node of a graph mark as visited.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"571\" height=\"389\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/DFS.png\" alt=\"Depth First Search in Data Structure \" class=\"wp-image-37248\" style=\"width:307px;height:auto\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/DFS.png 571w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/DFS-300x204.png 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/DFS-150x102.png 150w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/DFS-218x150.png 218w\" sizes=\"(max-width: 571px) 100vw, 571px\" \/><figcaption class=\"wp-element-caption\"><strong>Depth First Search in Data Structure <\/strong><\/figcaption><\/figure><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/chat.whatsapp.com\/B6weknl7133BQXjPva0pgB\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"159\" src=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/01\/DSAWHATSAPPBANNER-2-24-1024x159.jpg\" alt=\"\" class=\"wp-image-41482\" srcset=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/01\/DSAWHATSAPPBANNER-2-24-1024x159.jpg 1024w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/01\/DSAWHATSAPPBANNER-2-24-300x47.jpg 300w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/01\/DSAWHATSAPPBANNER-2-24-768x119.jpg 768w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/01\/DSAWHATSAPPBANNER-2-24-1536x238.jpg 1536w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/01\/DSAWHATSAPPBANNER-2-24-2048x317.jpg 2048w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/01\/DSAWHATSAPPBANNER-2-24-150x23.jpg 150w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/01\/DSAWHATSAPPBANNER-2-24-696x108.jpg 696w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/01\/DSAWHATSAPPBANNER-2-24-1068x166.jpg 1068w, https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2025\/01\/DSAWHATSAPPBANNER-2-24-1920x298.jpg 1920w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-application-of-graph-in-data-structure\"><span class=\"ez-toc-section\" id=\"Application_of_Graph_in_Data_Structure\"><\/span><strong>Application of Graph in Data Structure<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-social-media-platforms\"><span class=\"ez-toc-section\" id=\"Social_Media_Platforms\"><\/span><strong>Social Media Platforms<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>On social media platforms we users represent the nodes of a graph data structure and the followers and following represent the edges. Graphs on social media platforms connect followers and build connections between friends along with suggestions.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-graphs-in-machine-learning\"><span class=\"ez-toc-section\" id=\"Graphs_in_Machine_learning\"><\/span><strong>Graphs in Machine learning<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Graph data structure is used in machine learning to perform various tasks like community detection with the help of graph neural networks. They are basically used to predict tasks and build relationships between data points.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-graphs-in-computer-networks\"><span class=\"ez-toc-section\" id=\"Graphs_in_Computer_Networks\"><\/span><strong>Graphs in Computer Networks<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Graphs have wide applications in computer networks to maintain the flow of data and efficiency. Devices like routers and switches represented as nodes and the flow of data representing the edges that manages the topology of the network.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Graphs are the most important and versatile concept in computer science. There are many real world applications that simulate graph data structure which includes the friends recommendation of facebook, google maps shortest path finding application and many more.&nbsp; Unlike trees, graphs use network models and are a non-linear data structures. A graph is a network [&hellip;]<\/p>\n","protected":false},"author":560,"featured_media":37315,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1075,1073],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.4 (Yoast SEO v21.9.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Graph Data Structure : Its Types and Representation- iQuanta<\/title>\n<meta name=\"description\" content=\"In this blog we will be covering the graph in data structure, types of graph in data structure and its representation in data structure.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Graph Data Structure : Its Types and Representation\" \/>\n<meta property=\"og:description\" content=\"In this blog we will be covering the graph in data structure, types of graph in data structure and its representation in data structure.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/\" \/>\n<meta property=\"og:site_name\" content=\"iQuanta\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/iquanta.in\" \/>\n<meta property=\"article:published_time\" content=\"2025-06-28T08:49:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-28T08:49:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Feature-image-of-graph-.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1600\" \/>\n\t<meta property=\"og:image:height\" content=\"900\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Nidhi Goswami\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nidhi Goswami\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/\"},\"author\":{\"name\":\"Nidhi Goswami\",\"@id\":\"https:\/\/www.iquanta.in\/blog\/#\/schema\/person\/ec8c8c25d0526dd86557b6fed064f7f3\"},\"headline\":\"Graph Data Structure : Its Types and Representation\",\"datePublished\":\"2025-06-28T08:49:13+00:00\",\"dateModified\":\"2025-06-28T08:49:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/\"},\"wordCount\":1537,\"publisher\":{\"@id\":\"https:\/\/www.iquanta.in\/blog\/#organization\"},\"articleSection\":[\"DSA and Competitive Programming\",\"iSkills\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/\",\"url\":\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/\",\"name\":\"Graph Data Structure : Its Types and Representation- iQuanta\",\"isPartOf\":{\"@id\":\"https:\/\/www.iquanta.in\/blog\/#website\"},\"datePublished\":\"2025-06-28T08:49:13+00:00\",\"dateModified\":\"2025-06-28T08:49:46+00:00\",\"description\":\"In this blog we will be covering the graph in data structure, types of graph in data structure and its representation in data structure.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.iquanta.in\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Graph Data Structure : Its Types and Representation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.iquanta.in\/blog\/#website\",\"url\":\"https:\/\/www.iquanta.in\/blog\/\",\"name\":\"iQuanta | Cat Preparation Online\",\"description\":\"Building Learning Networks\",\"publisher\":{\"@id\":\"https:\/\/www.iquanta.in\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.iquanta.in\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.iquanta.in\/blog\/#organization\",\"name\":\"IQuanta\",\"url\":\"https:\/\/www.iquanta.in\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.iquanta.in\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2018\/08\/IQuanta-1.png\",\"contentUrl\":\"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2018\/08\/IQuanta-1.png\",\"width\":525,\"height\":200,\"caption\":\"IQuanta\"},\"image\":{\"@id\":\"https:\/\/www.iquanta.in\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/facebook.com\/iquanta.in\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.iquanta.in\/blog\/#\/schema\/person\/ec8c8c25d0526dd86557b6fed064f7f3\",\"name\":\"Nidhi Goswami\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.iquanta.in\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/21d234d87afd924b217d26b25a3cf1ee?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/21d234d87afd924b217d26b25a3cf1ee?s=96&d=mm&r=g\",\"caption\":\"Nidhi Goswami\"},\"url\":\"https:\/\/www.iquanta.in\/blog\/author\/nidhigoswami\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Graph Data Structure : Its Types and Representation- iQuanta","description":"In this blog we will be covering the graph in data structure, types of graph in data structure and its representation in data structure.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/","og_locale":"en_US","og_type":"article","og_title":"Graph Data Structure : Its Types and Representation","og_description":"In this blog we will be covering the graph in data structure, types of graph in data structure and its representation in data structure.","og_url":"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/","og_site_name":"iQuanta","article_publisher":"https:\/\/facebook.com\/iquanta.in","article_published_time":"2025-06-28T08:49:13+00:00","article_modified_time":"2025-06-28T08:49:46+00:00","og_image":[{"width":1600,"height":900,"url":"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2024\/12\/Feature-image-of-graph-.jpeg","type":"image\/jpeg"}],"author":"Nidhi Goswami","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Nidhi Goswami","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#article","isPartOf":{"@id":"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/"},"author":{"name":"Nidhi Goswami","@id":"https:\/\/www.iquanta.in\/blog\/#\/schema\/person\/ec8c8c25d0526dd86557b6fed064f7f3"},"headline":"Graph Data Structure : Its Types and Representation","datePublished":"2025-06-28T08:49:13+00:00","dateModified":"2025-06-28T08:49:46+00:00","mainEntityOfPage":{"@id":"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/"},"wordCount":1537,"publisher":{"@id":"https:\/\/www.iquanta.in\/blog\/#organization"},"articleSection":["DSA and Competitive Programming","iSkills"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/","url":"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/","name":"Graph Data Structure : Its Types and Representation- iQuanta","isPartOf":{"@id":"https:\/\/www.iquanta.in\/blog\/#website"},"datePublished":"2025-06-28T08:49:13+00:00","dateModified":"2025-06-28T08:49:46+00:00","description":"In this blog we will be covering the graph in data structure, types of graph in data structure and its representation in data structure.","breadcrumb":{"@id":"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.iquanta.in\/blog\/graph-data-structure-its-types-and-representation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.iquanta.in\/blog\/"},{"@type":"ListItem","position":2,"name":"Graph Data Structure : Its Types and Representation"}]},{"@type":"WebSite","@id":"https:\/\/www.iquanta.in\/blog\/#website","url":"https:\/\/www.iquanta.in\/blog\/","name":"iQuanta | Cat Preparation Online","description":"Building Learning Networks","publisher":{"@id":"https:\/\/www.iquanta.in\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.iquanta.in\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.iquanta.in\/blog\/#organization","name":"IQuanta","url":"https:\/\/www.iquanta.in\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.iquanta.in\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2018\/08\/IQuanta-1.png","contentUrl":"https:\/\/www.iquanta.in\/blog\/wp-content\/uploads\/2018\/08\/IQuanta-1.png","width":525,"height":200,"caption":"IQuanta"},"image":{"@id":"https:\/\/www.iquanta.in\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/iquanta.in"]},{"@type":"Person","@id":"https:\/\/www.iquanta.in\/blog\/#\/schema\/person\/ec8c8c25d0526dd86557b6fed064f7f3","name":"Nidhi Goswami","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.iquanta.in\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/21d234d87afd924b217d26b25a3cf1ee?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/21d234d87afd924b217d26b25a3cf1ee?s=96&d=mm&r=g","caption":"Nidhi Goswami"},"url":"https:\/\/www.iquanta.in\/blog\/author\/nidhigoswami\/"}]}},"_links":{"self":[{"href":"https:\/\/www.iquanta.in\/blog\/wp-json\/wp\/v2\/posts\/37218"}],"collection":[{"href":"https:\/\/www.iquanta.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iquanta.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iquanta.in\/blog\/wp-json\/wp\/v2\/users\/560"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iquanta.in\/blog\/wp-json\/wp\/v2\/comments?post=37218"}],"version-history":[{"count":28,"href":"https:\/\/www.iquanta.in\/blog\/wp-json\/wp\/v2\/posts\/37218\/revisions"}],"predecessor-version":[{"id":52847,"href":"https:\/\/www.iquanta.in\/blog\/wp-json\/wp\/v2\/posts\/37218\/revisions\/52847"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.iquanta.in\/blog\/wp-json\/wp\/v2\/media\/37315"}],"wp:attachment":[{"href":"https:\/\/www.iquanta.in\/blog\/wp-json\/wp\/v2\/media?parent=37218"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iquanta.in\/blog\/wp-json\/wp\/v2\/categories?post=37218"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iquanta.in\/blog\/wp-json\/wp\/v2\/tags?post=37218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}