Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Graph Algorithms Articles
Found 19 articles
C++ Program to Check whether Graph is a Bipartite using BFS
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 MoreMost Asked Problems on Graph Algorithm for Coding Interviews
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 MoreDifference between Table and Figure
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 MoreDifference Between Tree and Graph
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 MoreDifference between Sequence Diagram and Activity Diagram
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 MoreWhat are the differences between Microsoft Excel and Microsoft Access?
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 MoreSnake and Ladder Problem
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 MoreTransitive closure of a Graph
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 MoreCheck For Star Graph
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 MoreFleury’s Algorithm
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