Q7 — Map Colouring CSP: Arc Consistency, Path Consistency, Solution

Three mutually adjacent regions, domains {r,b,g}/{r,b}/{r,b} — arc consistent, NOT path consistent, but solvable: g,r,b.

The Question

Map colouring with 3 regions {A,B,C}\{A, B, C\}, all three pairwise adjacent, processed in order A, B, C.

DA={r,b,g},DB={r,b},DC={r,b}D_A = \{r, b, g\}, \qquad D_B = \{r, b\}, \qquad D_C = \{r, b\}

Constraint: adjacent regions must take different colours.

#QuestionOfficial answer
7.1Is the CSP arc consistent?A — Yes
7.2Is the CSP path consistent?A — No
7.3Solution (A,B,C)g,r,b

The Topic in 60 Seconds

  • Arc consistent (per directed arc X→YX \to Y): every x∈DXx \in D_X has some y∈DYy \in D_Y with (x,y)(x,y) allowed. Prunes values.
  • Path consistent (per triple): for every allowed pair (x,y)(x,y) on arc X ⁣− ⁣YX \!-\! Y there is some z∈DZz \in D_Z compatible with both. Prunes relations (tuples).
  • Arc consistency does not imply path consistency — this question is the counter-example.

Deep-dive: Arc Consistency, Forward Checking.

The constraint graph

7.1 — Arc consistency → Yes

Check every directed arc; "compatible" = different colours:

ArcValueSupport in neighbour?
A→Brb ✓ · b: r ✓ · g: r ✓
B→Arg ✓ · b: g ✓
A→Cr, b, gb ✓, r ✓, r ✓
C→Ar, bg ✓, g ✓
B→Cr, bb/r ✓
C→Br, bg ✓

Every value has a support → arc consistent ✓. (Easy to miss: g∉DBg \notin D_B, but arc consistency only needs some compatible neighbour value, not the same colour.)

7.2 — Path consistency → No

Take the pair (A, C) with the allowed tuple (r,b)(r, b) — is there z=b′∈DBz = b' \in D_B compatible with both?

  • (a,z)=(r,b′)(a, z) = (r, b'): needs b′≠rb' \ne r → b′=bb' = b
  • (z,c)=(b,b)(z, c) = (b, b): needs b≠bb \ne b — impossible!

The other DBD_B value rr fails the first test ((r,r)(r,r)). So the tuple (r,b)(r,b) on arc A–C has no middle support through B → not path consistent → option A ✓

7.3 — Solution → g,r,b

Assign in order A, B, C with all-different:

  • A=rA = r: then B=bB = b, and C∈{r,b}C \in \{r,b\} must differ from both rr and bb → dead end (this is exactly the path-inconsistency above).
  • A=bA = b: symmetric dead end.
  • A=gA = g: B=rB = r (or b), C=bC = b (or r) → g≠r≠b≠gg \ne r \ne b \ne g ✓

Solution: A=g, B=r, C=b → g,r,b ✓

Tricks & Tips

Interactive trace — the all-different triangle:

1 / 4
Every value needs just ONE differing neighbour value: r → b or g ✓ · b → r ✓ · g → r ✓ (g ∉ D_B is fine — only difference matters) All arcs pass → arc consistent → 7.1 = A.
under examinationconsistent assignmentdead end

Tricks & Tips

QuizWhy does A=r fail despite the CSP being arc consistent?

Answers: 7.1 A (Yes) · 7.2 A (No) · 7.3 g,r,b