Use a constraint to prune a seating plan
Keep the names of states and actions distinct. · 192 words
A constraint satisfaction problem represents choices as variables, each with a domain of allowed values, plus constraints that valid assignments must obey. For a dinner table, guests Ana, Ben, and Cara have six numbered chairs arranged in a circle. Ana cannot sit beside Ben. If Ana takes chair 2, chairs 1 and 3 are beside her, so both values disappear from Ben's domain. Ben now has only chairs 4, 5, or 6. This early removal is called forward checking: it eliminates values that conflict with a current assignment.
At a museum reading event, seats 1 through 4 form one row. Mei must sit immediately to the left of Raul, and each guest needs her own seat. The left-right constraint removes seat 4 from Mei's domain because no seat is to its right, and removes seat 1 from Raul's domain because no seat is to its left. After Mei is assigned seat 2, Raul can only use seat 3, so his other values are removed. Pruning Raul after an assignment is forward checking. Even before assignment, removing an endpoint with no possible partner illustrates the idea of a consistency check between two domains.
Check your recall
After Ana is assigned chair 2, which values are pruned from Ben's domain, and what is this technique called?
Check your answer
Chairs 1 and 3 are pruned from Ben's domain because both would place Ana and Ben beside each other. This constraint-based pruning technique is called forward checking.
Sources and credits
Original KeyTouch lesson. Background reading · UC Berkeley · Introduction to Artificial Intelligence.