CSP Relations and Arc/Path Consistency

From math definitions to pruning power — compute R_AC from mod constraints, then enforce arc and path consistency like the papers demand

The Simplest Explanation

A binary CSP has variables with domains and relations (allowed tuples) for each constrained pair.

  • Relation R_AC = set of pairs (a,c) that satisfy constraint between A and C
  • Arc consistent = for every value in every domain, there exists a compatible value in each neighbor's domain
  • Path consistent = for every pair of values, there exists a middle value completing the path
Remember This

Arc consistency prunes domains (values). Path consistency prunes relations (tuples).

Computing Relations from Math Constraints (26T1 Papers)

Domains: DA=DB=DC={1,2,3,4}D_A=D_B=D_C=\{1,2,3,4\}

Example 1: RAC:A=mod(2C,3)R_{AC}: A = \text{mod}(2C, 3)

For each CC, compute 2Cmod  32C \mod 3, then find matching AA:

CC2C2C2Cmod  32C \mod 3Allowed AATuples
1222(2,1)
2411(1,2)
360— (0 not in domain!)none
4822(2,4)

So RAC={(1,2),(2,1),(2,4)}R_{AC} = \{(1,2), (2,1), (2,4)\} — matches answer A,B,C.

Example 2: RBA:B=mod(3A,4)R_{BA}: B = \text{mod}(3A,4) (26T1 AN)

AA3Amod  43A \mod 4BBTuple
133(3,1)
222(2,2)
311(1,3)
400 not in domainnone

RBA={(3,1),(2,2),(1,3)}R_{BA}=\{(3,1),(2,2),(1,3)\} — tuples are (B,A)(B,A) order!

Crucial: Tuple order matches relation name: RACR_{AC} tuples are (A,C)(A,C), RBAR_{BA} are (B,A)(B,A).

Arc Consistency

A CSP is arc consistent iff for every arc X→YX→Y, every x∈DXx \in D_X has some y∈DYy \in D_Y with (x,y)∈RXY(x,y) \in R_{XY}.

Check each xx: if no supporting yy, delete xx from DXD_X and re-queue neighbors.

Is Our Example Arc-Consistent?

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

  • A=3A=3: No support in RACR_{AC} → Remove 3 from DAD_A
  • A=4A=4: No support → Remove 4
  • C=3C=3: No AA with (A,3)∈RAC(A,3) \in R_{AC} → Remove 3 from DCD_C

After pruning, papers answer: Not arc-consistent (No). After making it arc-consistent, re-check path consistency.

Path Consistency

For every pair (X,Y)(X,Y) and every tuple (x,y)∈RXY(x,y) \in R_{XY}, there must exist z∈DZz \in D_Z such that (x,z)∈RXZ(x,z) \in R_{XZ} and (z,y)∈RZY(z,y) \in R_{ZY}.

After arc pruning, 26T1 papers find it IS path consistent. Hence solution exists: e.g., A=2,B=2,C=1A=2, B=2, C=1 (AN) or A=2,B=4,C=1A=2,B=4,C=1 (FN).

Constraint Graph

  • Nodes = variables, edges = constrained pairs (triangle A-B-C)
  • Triangle is cyclic — but path consistency still applies (contrary to distractor "does not apply because cycle").
QuizR_AC tuples are ordered as...
QuizArc consistency removes...