Q9 — Constraint Satisfaction: AC and PC
Mod-relations with a twist of 3s and 4s: tables computed cell by cell, arc-consistency trims the fat, and the unique solution reads 2,2,1.
The Question
CSP over A, B, C with :
| # | Question | Official answer |
|---|---|---|
| 9.1 | Tuples in R_AC? | A, B, C |
| 9.2 | Tuples in R_BA? | A, B, C |
| 9.3 | Is the CSP arc-consistent? | B (No) |
| 9.4 | Make it arc-consistent; path-consistent afterwards? | A |
| 9.5 | Does the CSP have a solution? | 2,2,1 |
Step 0 — Compute the relations
:
| 1 | 2 | (2,1) |
| 2 | 1 | (1,2) |
| 3 | 0 ∉ domain | pruned |
| 4 | 2 | (2,4) |
:
| 1 | 3 | (3,1) |
| 2 | 2 | (2,2) |
| 3 | 1 | (1,3) |
| 4 | 12 mod 4 = 0 ∉ domain | pruned |
:
| 1 | 2 | (2,1) |
| 2 | 1 | (1,2) |
| 3 | 0 ∉ domain | pruned |
| 4 | 2 | (2,4) |
Each relation keeps exactly three of the four offered option tuples — the keyed triples (A,B,C) twice over.
9.3 — Arc-consistent? → No
Scan for unsupported values:
- : needs a tuple in with second coordinate 3 — exists ✓ supported... but check 's OTHER arc : values of there are — no tuple ⇒ unsupported.
- : contains no ⇒ unsupported.
One unsupported value anywhere ⇒ not arc-consistent → B.
9.4 — Enforce AC → path-consistent → Yes
Delete unsupported values:
Re-revise every arc until stable — remaining tuples all mutually support each other. Path consistency on a three-variable cycle reduces to the composed triple test: the network admits the consistent triple below, so path-consistent → A.
9.5 — Solution → 2,2,1
Walk 's tuples and extend:
| In as ? | ||
|---|---|---|
| (3,1) | ✗ out of domain | — |
| (2,2) | → ✓ present | solution |
| (1,3) | → ✗ absent | — |
Unique solution:
Verify: ✓ · ✓ · ✓
Interactive trace
1 / 4
D(A)=D(B)=D(C)={1,2,3,4}
Arcs: R_AC, R_BA, R_CB
domain shrinkingarc consistentvalue deleted
Tricks & Tips
Answers: 9.1 A, B, C · 9.2 A, B, C · 9.3 B · 9.4 A · 9.5 2,2,1