Graph Algorithms Articles

Found 19 articles

C++ Program to Check whether Graph is a Bipartite using BFS

Farhan Muhamed
Farhan Muhamed
Updated on 17-Jul-2025 930 Views

The Breadth First Search (BFS) algorithm can be used to check whether a graph is bipartite by coloring the graph using two colors. This section will discuss how the BFS traversal can be used to check if a graph is bipartite. First of all, let's understand what a bipartite graph is. What is Bipartite Graph? Bipartite graph is special graph where you can divide the vertices into two sets, such that no two vertices of the same set are connected. This is why, it's possible to color a bipartite graph by using just two colors. Technically a graph is ...

Read More

Most Asked Problems on Graph Algorithm for Coding Interviews

Yash Shri
Yash Shri
Updated on 31-Jan-2025 413 Views

Graph consists of vertices and edges which is a non-linear data structure. In this article, we will discuss the most common and popular problems of graphs in Data Structures and Algorithms. We are covering basic to advanced-level problems which will help you to learn the whole concept in a structured manner. Here are the graph data structure problems from the basics to the advanced level − Fundamentals Problems Here are the basic problems of Graph Data structure − BFS Implementation DFS Implementation Graph Coloring Graph Representation Minimum Spanning Trees (Kruskal's) Minimum Spanning Trees (Prim's) Print Adjacency List Union-Find Data ...

Read More

Difference between Table and Figure

Md. Sajid
Md. Sajid
Updated on 06-Mar-2023 2K+ Views

Tables and figures are both visual aids that are used to make data and information more accessible and understandable. The primary distinction between tables and figures is how information is displayed. A table is used to display data in a numerical or categorical. It is a structured collection of data that is organized in rows and columns. It is used to compare the two or more sets of data. A figure is a graphical representation of data such as map, graph, image, or illustration. They're especially useful for communicating complex information or data that's delicate to describe verbally. ...

Read More

Difference Between Tree and Graph

Kiran Kumar Panigrahi
Kiran Kumar Panigrahi
Updated on 21-Dec-2022 18K+ Views

Both Trees and Graphs are types of non−linear data structures. They are different from each other in the context of their types of connections and loop formation. That means, a tree structure is connected such that it can never have loops, whereas a graph structure follows a network model and may have loops. Read this article to find out more about Tress and Graphs and how they are different from each other. What is Tree? A Tree is a non−linear data structure that is used to represent hierarchy. It is a set of nodes that are joined together to ...

Read More

Difference between Sequence Diagram and Activity Diagram

Kiran Kumar Panigrahi
Kiran Kumar Panigrahi
Updated on 21-Dec-2022 8K+ Views

Both sequence diagrams and activity diagrams are commonly used in software engineering to model the interactions and flows within a system. They are also useful in other fields, such as business process modeling, to model and analyze the flow of activities or interactions within a business process. Read this article to find out more about sequence diagrams and activity diagrams and how they are different from each other. What is Sequence Diagram? A sequence diagram is a diagram in that is used in representing the sequence of messages flowing from one object to another. The main objective of a sequence ...

Read More

What are the differences between Microsoft Excel and Microsoft Access?

Bhanu Priya
Bhanu Priya
Updated on 21-Mar-2022 1K+ Views

Let us understand the concepts of Microsoft Excel and Microsoft Access before learning the differences between them.Microsoft AccessIt is a database management system offered by Microsoft which puts together the relational Microsoft Jet Database Engine with a graphical user interface and software development tools.AdvantagesThe advantages of Microsoft Access are as follows −Table structure and normalization through multiple tables − In a database you can store more information in one place and you use the address as a reference in many places.Records are free − The major difference between Microsoft excels and Microsoft access is that in a database records are ...

Read More

Snake and Ladder Problem

George John
George John
Updated on 16-Jun-2020 2K+ Views

We know about the famous game Snake and Ladder. In this game, some rooms are present on the board, with the room number. Some rooms are connected with a ladder or with snakes. When we get a ladder, we can climb up to some rooms to reach near to the destination without moving sequentially. Similarly, when we get some snake, it sends us to a lower room to start the journey again from that room.In this problem, we have to find the minimum number of the dice throw is required to reach start to destination.Input and OutputInput: The starting and ...

Read More

Transitive closure of a Graph

George John
George John
Updated on 16-Jun-2020 21K+ Views

Transitive Closure it the reachability matrix to reach from vertex u to vertex v of a graph. One graph is given, we have to find a vertex v which is reachable from another vertex u, for all vertex pairs (u, v).The final matrix is the Boolean type. When there is a value 1 for vertex u to vertex v, it means that there is at least one path from u to v.Input and OutputInput: 1 1 0 1 0 1 1 0 0 0 1 1 0 0 0 1 Output: The matrix of transitive closure 1 1 1 ...

Read More

Check For Star Graph

karthikeya Boyini
karthikeya Boyini
Updated on 16-Jun-2020 729 Views

A graph is given; we have to check the given graph is a star graph or not.By traversing the graph, we have to find the number of vertices has degree one, and number of vertices, whose degree is n-1. (Here n is the number of vertices in the given graph). When the number of vertices with degree 1 is n-1 and a number of vertices with a degree (n-1) is one, then it is a star graph.Input and OutputInput: The adjacency matrix: 0 1 1 1 1 0 0 0 1 0 0 0 1 0 0 0 Output: ...

Read More

Fleury’s Algorithm

Chandu yadav
Chandu yadav
Updated on 16-Jun-2020 7K+ Views

Fleury’s Algorithm is used to display the Euler path or Euler circuit from a given graph. In this algorithm, starting from one edge, it tries to move other adjacent vertices by removing the previous vertices. Using this trick, the graph becomes simpler in each step to find the Euler path or circuit.We have to check some rules to get the path or circuit −The graph must be a Euler Graph.When there are two edges, one is bridge, another one is non-bridge, we have to choose non-bridge at first.Choosing of starting vertex is also tricky, we cannot use any vertex as ...

Read More
Showing 1–10 of 19 articles
« Prev 1 2 Next »
Advertisements