Graph Theory37 sections · 1633 units
Open in Course

LeetCode 886 Possible Bipartition - Story

The party problem

Imagine you are planning a party. Some guests do not get along. You want to split them into two rooms so that enemies are not in the same room. Each "dislike" pair means those two people cannot be together. If person A dislikes person B, they must be in different rooms.

This is exactly the bipartite question. People are nodes. Dislikes are edges. Can you 22-color the graph so every edge connects different colors (rooms)?