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 , all three pairwise adjacent, processed in order A, B, C.
Constraint: adjacent regions must take different colours.
| # | Question | Official answer |
|---|---|---|
| 7.1 | Is the CSP arc consistent? | A — Yes |
| 7.2 | Is the CSP path consistent? | A — No |
| 7.3 | Solution (A,B,C) | g,r,b |
The Topic in 60 Seconds
- Arc consistent (per directed arc ): every has some with allowed. Prunes values.
- Path consistent (per triple): for every allowed pair on arc there is some 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:
| Arc | Value | Support in neighbour? |
|---|---|---|
| A→B | r | b ✓ · b: r ✓ · g: r ✓ |
| B→A | r | g ✓ · b: g ✓ |
| A→C | r, b, g | b ✓, r ✓, r ✓ |
| C→A | r, b | g ✓, g ✓ |
| B→C | r, b | b/r ✓ |
| C→B | r, b | g ✓ |
Every value has a support → arc consistent ✓. (Easy to miss: , 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 — is there compatible with both?
- : needs →
- : needs — impossible!
The other value fails the first test (). So the tuple 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:
- : then , and must differ from both and → dead end (this is exactly the path-inconsistency above).
- : symmetric dead end.
- : (or b), (or r) → ✓
Solution: A=g, B=r, C=b → g,r,b ✓
Tricks & Tips
Interactive trace — the all-different triangle:
Tricks & Tips
Answers: 7.1 A (Yes) · 7.2 A (No) · 7.3 g,r,b