<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shrutijadhav on Medium]]></title>
        <description><![CDATA[Stories by Shrutijadhav on Medium]]></description>
        <link>https://medium.com/@shrutijadhav2845?source=rss-ebc32a7dc318------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*9_TkeNmFMnfDfLGv</url>
            <title>Stories by Shrutijadhav on Medium</title>
            <link>https://medium.com/@shrutijadhav2845?source=rss-ebc32a7dc318------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 10:10:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shrutijadhav2845/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Graphs in Computer Programming]]></title>
            <link>https://medium.com/@shrutijadhav2845/graphs-in-computer-programming-2451b8a3a52?source=rss-ebc32a7dc318------2</link>
            <guid isPermaLink="false">https://medium.com/p/2451b8a3a52</guid>
            <dc:creator><![CDATA[Shrutijadhav]]></dc:creator>
            <pubDate>Tue, 02 May 2023 09:06:19 GMT</pubDate>
            <atom:updated>2023-05-02T09:06:19.705Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction:</strong></p><p>Graphs are an essential data structure in computer programming, widely used for representing complex relationships and dependencies between data points. In this article, we will explore the basics of graphs, their types, and their applications in computer programming.</p><p><strong>What is a Graph?</strong></p><p>A graph is a data structure consisting of a set of nodes (also known as vertices) and a set of edges that connect these nodes. The nodes represent the data points, while the edges represent the relationships between these data points.</p><p><strong><em>Graph</em></strong></p><p>Graphs are used to represent many real-world problems, such as social networks, transportation networks, electrical circuits, and more. For example, a social network can be represented as a graph, where the nodes represent people, and the edges represent friendships or connections between them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*X6DcR1ZU8UEOmGRviK-N4w.png" /><figcaption>Graph</figcaption></figure><p><strong>Types of Graphs</strong></p><p>Graphs can be classified into two main categories: directed graphs and undirected graphs.</p><ol><li><strong>Directed Graphs</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*5rrGIPwhsXgzMj8ToxwFsw.png" /><figcaption>Directed Graph</figcaption></figure><p>In a directed graph, each edge has a direction, and the edges are represented as arrows. The direction of the edge indicates the direction of the relationship between the nodes it connects. For example, in a social network, a directed edge from node A to node B could indicate that A follows B on Twitter.</p><p><strong>Undirected Graphs</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*5rrGIPwhsXgzMj8ToxwFsw.png" /><figcaption>Undirected Graph</figcaption></figure><p>In an undirected graph, the edges do not have a direction, and the edges are represented as lines. The absence of direction indicates that the relationship between the nodes is mutual. For example, in a social network, an undirected edge between node A and node B could indicate that A and B are friends.</p><p><strong>Other Types of Graphs</strong></p><p>Graphs can also be classified into other types based on their properties, such as weighted graphs and unweighted graphs.</p><p>In a weighted graph, each edge has a weight or a cost associated with it. The weight represents the cost of traversing the edge, and it can be used to represent distances, time, or other types of costs. For example, in a transportation network, a weighted edge could represent the time it takes to travel between two cities.</p><p>In an unweighted graph, all edges have the same cost or weight, and the graph is simply a representation of the relationships between nodes.</p><p><strong>Graphs in Computer Programming</strong></p><p>Graphs are a data structure used in computer programming to represent relationships between data points. A graph consists of nodes (vertices) and edges that connect these nodes. Graphs are widely used in areas such as pathfinding, social network analysis, data mining, circuit design, and game development. Graphs can be classified as directed or undirected, and they can be weighted or unweighted depending on the properties of the relationships being represented. Understanding graphs and their properties is essential for building efficient and effective programs in many areas of computer programming.</p><p><strong>Applications of Graphs in Computer Programming</strong></p><p>Graphs have many applications in computer programming, including:</p><p>1) <strong>Pathfinding Algorithms:</strong> Graphs are commonly used to represent maps, and pathfinding algorithms can be used to find the shortest path between two nodes in a graph. Examples of pathfinding algorithms include Dijkstra’s algorithm and A* algorithm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*z12dOWpKnREKcwYCqZSt1A.png" /><figcaption>Path Finding</figcaption></figure><p>2) <strong>Social Network Analysis: </strong>Graphs are used to represent social networks, and social network analysis can be used to study the relationships between people. Examples of social network analysis techniques include centrality analysis and clustering.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*BtWMEGcf2iZO0tBpcLPLtQ.png" /><figcaption>Social Network Analysis</figcaption></figure><p>3) <strong>Data Mining:</strong> Graphs can be used to represent large datasets, and data mining techniques can be used to extract useful information from the graph. Examples of data mining techniques include frequent subgraph mining and community detection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*eJc7vjl52kd0LNpOXeVUiA.png" /><figcaption>Data Mining</figcaption></figure><p>4) <strong>Circuit Design:</strong> Graphs are used to represent electrical circuits, and circuit design algorithms can be used to optimise the design of the circuit. Examples of circuit design algorithms include Kirchhoff’s laws and circuit simulation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*O_u5sOAJBXJigf2YkkaBOg.png" /><figcaption>Circuit Design</figcaption></figure><p>5) <strong>Game Development:</strong> Graphs are used to represent game maps and game objects, and game development techniques can be used to create intelligent game agents. Examples of game development techniques include pathfinding and decision-making algorithms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*RG0BRg2m34Nlt65Dn6wglQ.png" /><figcaption>Game Development</figcaption></figure><p><strong>Conclusion</strong></p><p>graphs are a versatile data structure that has many applications in computer programming. Whether you are developing algorithms for pathfinding, social network analysis, data mining, circuit design, or game development, understanding graphs and their properties is essential for building efficient and effective programs.</p><p>Let’s Test your Understanding by simple quiz.</p><ol><li>What is a graph data structure?</li></ol><p>A) A collection of key-value pairs</p><p>B) A collection of nodes and edges</p><p>C) A collection of linked lists</p><p>D) A collection of trees</p><p>Answer: <strong>B</strong></p><ol><li>Which of the following is not a common representation of a graph?</li></ol><p>A) Adjacency matrix</p><p>B) Adjacency list</p><p>C) Breadth-first search</p><p>D) Depth-first search</p><p>Answer: <strong>C</strong></p><ol><li>What is the time complexity of finding the shortest path in an unweighted graph using breadth-first search?</li></ol><p>A) O(V log V)</p><p>B) O(V + E)</p><p>C) O(E log V)</p><p>D) O(V²)</p><p>Answer: <strong>B</strong></p><ol><li>Which algorithm can be used to find the minimum spanning tree of a weighted graph?</li></ol><p>A) Dijkstra’s algorithm</p><p>B) Bellman-Ford algorithm</p><p>C) Kruskal’s algorithm</p><p>D) Prim’s algorithm</p><p>Answer: <strong>C</strong></p><ol><li>What is a cycle in a graph?</li></ol><p>A) A path from one node to another</p><p>B) A path from a node back to itself</p><p>C) A path that includes all nodes in the graph</p><p>D) A path that includes only a subset of the nodes in the graph</p><p>Answer: <strong>B</strong></p><p><strong>Acknowledgment</strong></p><p>I would like to express my sincere gratitude to our teacher Dr. Rekha Sharma (Associate Professor, TCET) for her valuable guidance and support in writing this wonderful blog.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2451b8a3a52" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>