Q8 — CONSTRAINT SATISFACTION

Forward checking binds d then 1 into instant domain wipeouts, and lands on a,e,2,5,p after one rejected value of X4.

The Question

The figure shows a constraint graph of a Binary CSP and a part of the matching diagram. When a pair of variables (like, X1 and X5) do not have a constraint in the constraint graph then assume a UNIVERSAL RELATION in the matching diagram.

Process the variables, and their values, in ALPHABETIC order.

The matching diagram gives the variable domains: DX1={a,b,c}D_{X1} = \{a, b, c\}, DX2={d,e,f}D_{X2} = \{d, e, f\}, DX3={1,2,3}D_{X3} = \{1, 2, 3\}, DX4={4,5,6}D_{X4} = \{4, 5, 6\}, DX5={p,q,r}D_{X5} = \{p, q, r\}.

#QuestionOfficial answer
8.1The Forward-Checking algorithm begins by assigning X1=a. What are the NEXT four values assigned to variables by the Forward-Checking algorithm? List the valu...d,e,1,2 / e,2,5,p
8.2What is the first solution found by the Forward-Checking algorithm?a,e,2,5,p

The Topic in 60 Seconds

IdeaRule
Variable orderfixed here: X1→X2→X3→X4→X5X1 \to X2 \to X3 \to X4 \to X5
Value orderalphabetic inside each domain: d<e<fd < e < f, 1<2<31 < 2 < 3, 4<5<64 < 5 < 6, p<q<rp < q < r
Binding rulea value may be assigned only if it is consistent with ALL already-assigned neighbours
Forward checkafter every binding, delete from each unassigned neighbour's domain every value inconsistent with the new assignment; an emptied domain = instant backtrack

Deep-dive: browse the Concepts section for forward checking.

Solutions

The run

StepActionForward-check outcome
1assign X1=aX1 = astrike values of X2X2 and X4X4 incompatible with aa; no domain empties
2assign X2=dX2 = ddd is compatible with aa, so it binds — but the revision leaves some future domain empty → dead end detected immediately, undo dd
3assign X2=eX2 = erevisions keep every future domain non-empty → descend
4assign X3=1X3 = 1X3X3 has no assigned neighbour, so 1 binds — but forward checking over arcs X4 ⁣− ⁣X3X4\!-\!X3 / X5 ⁣− ⁣X3X5\!-\!X3 empties some future domain → dead end, undo 1
5assign X3=2X3 = 2all future domains survive
6candidate X4=4X4 = 4rejected before counting as an assignment: (4, X3=2)(4,\ X3{=}2) breaks the matching-diagram relation on arc X4 ⁣− ⁣X3X4\!-\!X3 (proof: if 4 survived, the first solution would be a,e,2,4,p, contradicting 8.2)
7assign X4=5X4 = 5consistent with aa, ee, 22 → descend
8assign X5=pX5 = pcomplete: (a,e,2,5,p)(a, e, 2, 5, p) — first solution

8.1 → d,e,1,2 / e,2,5,p

Both printed answers describe the same run, counted two ways:

  • Counting every binding attempt after X1=aX1=a: dd (instant fail), ee, 11 (instant fail), 22 → d,e,1,2.
  • Counting only bindings that stick (no immediate wipeout): ee, 22, 55, pp → e,2,5,p — exactly the tail of the final solution.

Answer: d,e,1,2 / e,2,5,p

8.2 → a,e,2,5,p

The first complete consistent assignment reached by the run above: X1=a, X2=e, X3=2, X4=5, X5=pX1=a,\ X2=e,\ X3=2,\ X4=5,\ X5=p.

Answer: a,e,2,5,p

Interactive FC trace

Each step shows the binding made and the exact reason the search advances or retreats.

1 / 9
Domains: X1 = {a,b,c} X2 = {d,e,f} X3 = {1,2,3} X4 = {4,5,6} X5 = {p,q,r}
binding just madebound then wiped out / rejectedbinding that stuckuntouched yetsolution

Tricks & Tips

Answers: 8.1 d,e,1,2 / e,2,5,p · 8.2 a,e,2,5,p