GeeksforGeeks » Algorithms

a bipartite graph question

(2 posts)

Tags:

  1. gagan
    guest
    Posted 1 year ago #

    O(n^2) algorithm to find out if a graph is bipartite?

  2. nikhil jain
    guest
    Posted 11 months ago #

    bfs can be useful. initially make all nodes have white colour. then make bfs and mark the successor node of the parent of complementory colour let say black( for undiscovered node). If you find the node already discovered with same colour of parrent and its successor then it is not the bipartite. if all the vertices are traversed without conflicts then it is bipartite


Reply

You must log in to post.

RSS feed for this topic