Problem 785 · Medium

Is Graph Bipartite?

Two-colour the graph with BFS; an edge joining equal colours proves an odd cycle.

Open the interactive visualisation