Maths WorkshopMaths problems with full solutions
Exercise 958Combinatorics › Graph theoryL1Added 3 Nov 2026

Bipartite graphs

#bipartite#2-coloring#odd cycle

Statement

Show that a graph is bipartite iff it has no odd cycle.

Hint

(⇒)(\Rightarrow): an odd cycle cannot be 2-colored. (⇐)(\Leftarrow): BFS/DFS coloring, showing consistency.

Show solutionHide solution

Solution

(⇒)(\Rightarrow). In a bipartite graph with parts X,YX,Y, any cycle alternates XX-YY-XX-YY, so its length is even.

(⇐)(\Leftarrow). Suppose no odd cycles. Color each component as follows: pick a root, color it red; color each neighbor blue; propagate. If a conflict occurs (two adjacent vertices of the same color), we find a path between them of opposite parity, giving an odd cycle.

Conclusion. Bipartite   ⟺  \iff no odd cycle.