Algorithms
Algorithms copied to clipboard
[SSoC'23] Bipartite Graph
Following is a simple algorithm to find out whether a given graph is Bipartite or not using Breadth First Search (BFS).
- Assign RED color to the source vertex (putting into set U).
- Color all the neighbors with BLUE color (putting into set V).
- Color all neighbor’s neighbor with RED color (putting into set U).
- This way, assign color to all vertices such that it satisfies all the constraints of m way coloring problem where m = 2.
- While assigning colors, if we find a neighbor which is colored with same color as current vertex, then the graph cannot be colored with 2 vertices (or graph is not Bipartite)
@Kumar-laxmi assign this to me under SSoC'23.
@Kumar-laxmi please assign me this task.
Stale issue message