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), :
| # | Question | Official answer |
|---|---|---|
| 8.1 | Is the CSP arc consistent? | A — Yes |
| 8.2 | After making it arc consistent (if needed): path consistent? | B — not path consistent |
| 8.3 | Solution (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 on an arc has a middle value 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:
| Value | Supports |
|---|---|
| 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 ✓ |
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 — need with and :
- →
- ? → no!
Tuple has no middle support through C → not path consistent → B ✓
8.3 — Solution → 3,5,7
Try the tuples: on A–B, then must satisfy → , and ✓
✓
(Check the other branch: forces , but — dead end, exactly the path-inconsistency found above.)
Tricks & Tips
Interactive tuple hunt — arc consistency passes, then path consistency catches the impostor:
Tricks & Tips
Answers: 8.1 A (Yes) · 8.2 B (not path consistent) · 8.3 3,5,7