To choose a variable:
Choose the variable with the minimum remaining values ("MRV"
heuristic)
most constrained
we'll find out sooner if the current assignment is doomed to fail
Tie, choose the variable that is involved in the most
constraints with other variables ("degree" heuristic)
Suppose a variable has been chosen.
Under the "leastconstrainingvalue" heuristic for ordering values
prefer the value that rules out the fewest choices for the neighboring
variables in the constraint graph.
In this cryptarithmetic problem, each letter stands for a different
number between 1 and 9. Representing this as a CSP:
two
two

four
Variables:
t, w, o, f, u, r, c1, c2, c3
The C* variables are the carries, numbered from the right.
The carries may be 08; the letters may be 19
Constraints:
alldiff(t, w, o, f, u, r)
o + o = r + c1 * 10
w + w + c1 = u + c2 * 10
t + t + c2 = o + c3 * 10
f = c3
Assignment = {}
Choose next variable:
MRV, all ties
Degree: stop and think; which would you choose?
Suppose you choose f.
It only shares constraints with c3 and
the other letters.
So, it has more successors than any other
variable.
Let's choose another variable, with fewer
successors.
Less of the state space to search!
Which has highest degree:
My proposal for a definition of the degree of variable V:
sum = 0
for all square boxes B connected to V:
sum += number of edges of B  1
degree(f) = 5 + 1
= 6
degree(c2) = 3 + 3 = 6
degree(w) = 5 + 3 = 8
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '11
 wiebe
 Artificial Intelligence, Constraint, HWA, Wiebe

Click to edit the document details