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: , , , , .
| # | Question | Official answer |
|---|---|---|
| 8.1 | The 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.2 | What is the first solution found by the Forward-Checking algorithm? | a,e,2,5,p |
The Topic in 60 Seconds
| Idea | Rule |
|---|---|
| Variable order | fixed here: |
| Value order | alphabetic inside each domain: , , , |
| Binding rule | a value may be assigned only if it is consistent with ALL already-assigned neighbours |
| Forward check | after 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
| Step | Action | Forward-check outcome |
|---|---|---|
| 1 | assign | strike values of and incompatible with ; no domain empties |
| 2 | assign | is compatible with , so it binds — but the revision leaves some future domain empty → dead end detected immediately, undo |
| 3 | assign | revisions keep every future domain non-empty → descend |
| 4 | assign | has no assigned neighbour, so 1 binds — but forward checking over arcs / empties some future domain → dead end, undo 1 |
| 5 | assign | all future domains survive |
| 6 | candidate | rejected before counting as an assignment: breaks the matching-diagram relation on arc (proof: if 4 survived, the first solution would be a,e,2,4,p, contradicting 8.2) |
| 7 | assign | consistent with , , → descend |
| 8 | assign | complete: — 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 : (instant fail), , (instant fail), →
d,e,1,2. - Counting only bindings that stick (no immediate wipeout): , , , →
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: .
Answer: a,e,2,5,p
Interactive FC trace
Each step shows the binding made and the exact reason the search advances or retreats.
Tricks & Tips
Answers: 8.1 d,e,1,2 / e,2,5,p · 8.2 a,e,2,5,p