Graph Theory37 sections · 1633 units
Open in Course

Common Mistakes

What goes wrong

Bugs I see repeatedly:

1.1. Forgetting the outer loop. You only check one component, miss conflicts in others.

2.2. Wrong index bounds. Off-by-one errors with 11-indexed graphs.

3.3. Not building the graph correctly. Forgetting edges are bidirectional.

4.4. Checking color before assignment.

The order matters: check if colored, then check if conflict, then assign if uncolored.

5.5. Using 00 as "unvisited" when 00 is also a valid color. Use 1-1 for unvisited.