Sample Midterm 2
100 points
Closed book, notes, laptop, cell phone, calculator. 1 page of notes
Use SHORT answers unless told to do otherwise.
G
A
C
B
F
D
E
1.
Conflict Sets
a. What is the conflict set for G?
{F=G, B=R, E=B}
The conflict set is every variable involved in a constraint with G and has a value
assigned to it. In our example, the constraint graph shows that G has constraints on F,
D, B and E and that F, B and E have been assigned values at this point in the search so
the variables in the conflict set are{F, B and E}. By themselves, they aren’t causing
problems for G, it’s the values they have, as a group, that are causing G problems, so
the conflict set needs to include those. The conflict set is therefore {F=G, B=R, E=B}.
b. Suppose we have made the following assignments in the following order:
B=R
Æ
E=B
Æ
F=G
Æ
A=B
Æ
C=R
Æ
G=R
We have already tried G=B and G=G and rejected them. If we are using conflict-directed back
jumping, what is the next node depth-first search will evaluate?
F
It won’t be G because it has no legal assignments left (we already tried B and G).
Backtracking takes us to C but that’s not in the conflict set we found above. Going back
from there is A, also not in the conflict set. Next up is F, which is in the conflict set, so
the node we’ll re-evaluate is F.
2.
CSP Heuristics
a. When choosing which variable to assign, what heuristics are available? How do they work?
MRV – choose the variable that has the smallest domain / fewest remaining values
Degree – choose the variable that is involved the most constraints