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 DA=DB=DC={1,2,3,4}D_A = D_B = D_C = \{1,2,3,4\}:

RAC: A= mod (2C,3)RBA: B= mod (3A,4)RCB: C= mod (2B,3)R_{AC}:\ A = \bmod(2C, 3) \qquad R_{BA}:\ B = \bmod(3A, 4) \qquad R_{CB}:\ C = \bmod(2B, 3)

#QuestionOfficial answer
9.1Tuples in R_AC?A, B, C
9.2Tuples in R_BA?A, B, C
9.3Is the CSP arc-consistent?B (No)
9.4Make it arc-consistent; path-consistent afterwards?A
9.5Does the CSP have a solution?2,2,1

Step 0 — Compute the relations

RACR_{AC}: A= mod (2C,3)A = \bmod(2C, 3)

CC mod (2C,3)\bmod(2C,3)(A,C)(A,C)
12(2,1)
21(1,2)
30 ∉ domainpruned
42(2,4)

RAC={(2,1),(1,2),(2,4)}R_{AC} = \{(2,1), (1,2), (2,4)\}

RBAR_{BA}: B= mod (3A,4)B = \bmod(3A, 4)

AA mod (3A,4)\bmod(3A,4)(B,A)(B,A)
13(3,1)
22(2,2)
31(1,3)
412 mod 4 = 0 ∉ domainpruned

RBA={(3,1),(2,2),(1,3)}R_{BA} = \{(3,1), (2,2), (1,3)\}

RCBR_{CB}: C= mod (2B,3)C = \bmod(2B, 3)

BB mod (2B,3)\bmod(2B,3)(C,B)(C,B)
12(2,1)
21(1,2)
30 ∉ domainpruned
42(2,4)

RCB={(2,1),(1,2),(2,4)}R_{CB} = \{(2,1), (1,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:

  • A=3A = 3: needs a tuple in RBAR_{BA} with second coordinate 3 — (1,3)(1,3) exists ✓ supported... but check AA's OTHER arc RACR_{AC}: values of AA there are {1,2}\{1, 2\} — no (3,C)(3, C) tuple ⇒ A=3A=3 unsupported.
  • B=4B = 4: RBAR_{BA} contains no (4,A)(4, A) ⇒ unsupported.

One unsupported value anywhere ⇒ not arc-consistent → B.

9.4 — Enforce AC → path-consistent → Yes

Delete unsupported values:

DA={1,2} (via RAC),DB={1,2,3},DC={1,2,4}D_A = \{1,2\}\ (\text{via } R_{AC}), \qquad D_B = \{1,2,3\}, \qquad D_C = \{1,2,4\}

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 RBAR_{BA}'s tuples and extend:

(B,A)(B,A)C= mod (2B,3)C = \bmod(2B,3)In RACR_{AC} as (A,C)(A,C)?
(3,1) mod (6,3)=0\bmod(6,3) = 0 ✗ out of domain—
(2,2) mod (4,3)=1\bmod(4,3) = 1 → (2,1)(2,1) ✓ presentsolution
(1,3) mod (2,3)=2\bmod(2,3) = 2 → (3,2)(3,2) ✗ absent—

Unique solution:

(A,B,C)=(2, 2, 1)(A, B, C) = \mathbf{(2,\ 2,\ 1)}

Verify: 2= mod (2⋅1,3)2 = \bmod(2\cdot1, 3) ✓ · 2= mod (3⋅2,4)2 = \bmod(3\cdot2, 4) ✓ · 1= mod (2⋅2,3)1 = \bmod(2\cdot2, 3) ✓

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