Constraint Satisfaction — Backtracking + MRV + Forward Checking

Color the map so adjacent regions differ. Pick the most-constrained region (MRV), try a color, forward-check (shrink neighbor domains), and backtrack on a wipeout.

step 0

Map (regions & borders)

R G B unassigned
nodes explored: 0 · backtracks: 0

Domains (legal colors remaining)

Press Step to begin. We use MRV to pick the region with the fewest legal colors, try a color, then forward-check to shrink neighbors' domains.
Self-contained visualization. Constraint: adjacent regions get different colors (a binary CSP). MRV = pick the variable with the fewest remaining values (fail-first). Forward checking = remove the chosen color from unassigned neighbors; an empty domain (wipeout) forces a backtrack. See junior.md and middle.md.