Q8 — CSP: Arc Consistency, Path Consistency, Solution

Sparse relations over {1..9} — the matching diagram is arc consistent, path consistency fails on (2,6), and 3,5,7 saves the day.

The Question

CSP over A, B, C (processed in that order), DA=DB=DC={1,…,9}D_A = D_B = D_C = \{1, \dots, 9\}:

RAB={(2,6),(3,5)}RAC={(2,8),(3,7)}RBC={(5,7),(5,8),(6,7)}R_{AB} = \{(2,6), (3,5)\} \qquad R_{AC} = \{(2,8), (3,7)\} \qquad R_{BC} = \{(5,7), (5,8), (6,7)\}

#QuestionOfficial answer
8.1Is the CSP arc consistent?A — Yes
8.2After making it arc consistent (if needed): path consistent?B — not path consistent
8.3Solution (A,B,C)3,5,7

The Topic in 60 Seconds

  • Arc consistent: every domain value on the matching diagram has a support in each neighbour.
  • Path consistent: every allowed pair (x,y)(x, y) on an arc has a middle value zz compatible with both.
  • Arc consistency does not imply path consistency.

Deep-dive: Arc Consistency, Forward Checking.

The matching diagram

Only the values that appear in the relations can ever be used — draw them:

8.1 — Arc consistent → Yes

On the matching diagram, every value has support in each neighbour:

ValueSupports
A = 2B = 6 ✓, C = 8 ✓
A = 3B = 5 ✓, C = 7 ✓
B = 5A = 3 ✓, C = 7, 8 ✓
B = 6A = 2 ✓, C = 7 ✓
C = 7A = 3 ✓, B = 5, 6 ✓
C = 8A = 2 ✓, B = 5 ✓

No value pruned → arc consistent ✓ (values outside the relations — 1, 4, 9, … — are already excluded by the constraints themselves.)

8.2 — Path consistency → B (not path consistent)

Test the pair (A, B) with tuple (2,6)(2, 6) — need c∈DCc \in D_C with (2,c)∈RAC(2, c) \in R_{AC} and (c,6)∈RBC(c, 6) \in R_{BC}:

  • (2,c)∈{(2,8),(3,7)}(2, c) \in \{(2,8), (3,7)\} → c=8c = 8
  • (8,6)∈RBC(8, 6) \in R_{BC}? RBC={(5,7),(5,8),(6,7)}R_{BC} = \{(5,7), (5,8), (6,7)\} → no!

Tuple (2,6)(2,6) has no middle support through C → not path consistent → B ✓

8.3 — Solution → 3,5,7

Try the tuples: (3,5)(3, 5) on A–B, then CC must satisfy (3,c)∈RAC(3, c) \in R_{AC} → c=7c = 7, and (5,7)∈RBC(5, 7) \in R_{BC} ✓

A=3,B=5,C=7⇒3,5,7A = 3,\quad B = 5,\quad C = 7 \Rightarrow \texttt{3,5,7} ✓

(Check the other branch: (2,6)(2,6) forces c=8c = 8, but (6,8)∉RBC(6,8) \notin R_{BC} — dead end, exactly the path-inconsistency found above.)

Tricks & Tips

Interactive tuple hunt — arc consistency passes, then path consistency catches the impostor:

1 / 4
A=2 → B:6 ✓ C:8 ✓ · A=3 → B:5 ✓ C:7 ✓ B=5 → A:3 ✓ C:7,8 ✓ · B=6 → A:2 ✓ C:7 ✓ C=7 → A:3 ✓ B:5,6 ✓ · C=8 → A:2 ✓ B:5 ✓ Every value has support on every incident relation → arc consistent → 8.1 = A.
under examinationsupported / part of solutionfailed test

Tricks & Tips

QuizWhy does the tuple (2,6) on R_AB break path consistency?

Answers: 8.1 A (Yes) · 8.2 B (not path consistent) · 8.3 3,5,7