Graphs · Exercise 51 of 100
Bipartite graphs
An undirected graph is bipartite if you can color its vertices with two colors so every edge joins different colors. Start in each uncolored component and give neighbors opposite colors as you explore. An edge whose endpoints are forced to share a color rules out a bipartition.
Try it yourself
Seats A, B, C and D are joined in a ring by AB, BC, CD and DA. Add the link AC. Can all five links have differently colored endpoints using just two colors? Answer yes or no.
One-step hint
Color A, then alternate colors around the original ring. Compare the colors at the endpoints of the added diagonal.
Worked solution
- Color A red. Link AB forces B to be blue, and link BC then forces C to be red.
- Link AC now joins two red seats. Swapping the color names leaves the same conflict, so the answer is no.