dsa1 min read
Possible Bipartition — Bipartite Check BFS/DFS
Check if people can be split into two groups with no dislikes within a group. Equivalent to bipartite check on dislikes graph.
Read →
webcoderspeed.com
3 articles
Check if people can be split into two groups with no dislikes within a group. Equivalent to bipartite check on dislikes graph.
Check if a graph can be 2-colored such that no adjacent nodes share a color. BFS/DFS 2-coloring on all connected components.
Check if a graph is bipartite using BFS 2-coloring. A graph is bipartite if and only if it contains no odd-length cycles — equivalent to being 2-colorable.