Q8 — Constraint Satisfaction: AC and PC
Three mod-relations over {1..4}: compute the tables, watch arc-consistency shave value 3 off every domain, then hunt the unique solution 2,4,1.
The Question
Consider a CSP over 3 variables A, B, C where the domains and constraints are:
where, returns the remainder after dividing by , for example, , , .
Compute the three relations to match the domain constraints, then draw the constraint graph and matching-diagram, and then answer the sub-questions.
| # | Question | Official answer |
|---|---|---|
| 9.1 | Which of the following tuples occur in R_AC? | A, B, C |
| 9.2 | Which of the following tuples occur in R_BA? | A, B, D |
| 9.3 | Is the given CSP arc-consistent? | B |
| 9.4 | If the given CSP is not already arc-consistent, then make it arc-consistent, and then check if the resulting network is path consistent. | A |
| 9.5 | Does the given CSP have a solution? | 2,4,1 |
Step 0 — Compute the relations over
:
| Tuple | |||
|---|---|---|---|
| 1 | 2 | 2 | (2,1) ✓ option B |
| 2 | 4 | 1 | (1,2) ✓ option A |
| 3 | 6 | 0 ∉ | pruned |
| 4 | 8 | 2 | (2,4) ✓ option C |
Option D fails — no produces . → A, B, C exact.
:
| Tuple | ||
|---|---|---|
| 1 | 2 | (2,1) ✓ option B |
| 2 | 4 | (4,2) ✓ option D |
| 3 | 6 ∉ | pruned |
| 4 | 1 | (1,4) ✓ option A |
Option C fails → A, B, D exact.
:
By symmetry of the mod-7 form: .
9.3 — Arc-consistent? → B (No)
AC-3 test per arc: every value needs a partner on each neighbour.
- : offers no tuple with (needs ) → unsupported ⇒ not arc-consistent.
- Same fate for and (each would need partner 6).
9.4 — After enforcing AC → path-consistent? → A (Yes)
Revise all arcs (every value loses its "3" supports simultaneously):
Re-check every arc: all remaining values retain partners; a second pass changes nothing → arc-consistent now. Path consistency on a 3-variable network reduces to: for every consistent pair via , some works — equivalently here, the single composed cycle must admit a common triple. It does (next row), so path-consistent → A.
9.5 — Solution → 2,4,1
Enumerate 's three pairs and extend through and :
| ? | ||
|---|---|---|
| (2,1) | 4 | ? ✗ not in |
| (4,2) | 1 | ✓ |
| (1,4) | 2 | ? ✗ |
Unique solution:
Verify all three: ✓ · ✓ · ✓
Interactive trace — AC-3 revision cascade
Tricks & Tips
Answers: 9.1 A, B, C · 9.2 A, B, D · 9.3 B · 9.4 A · 9.5 2,4,1