JU Ch5
JU Ch5
(Comp551)
1
JIMMA UNIVERSITY
JIMMA INSTITUTE OF TECHNOLOGY
DEPARTMENT OF COMPUTING
CHAPTER FIVE
CONSTRAINT SATISFACTION PROBLEMS
Topics we will cover
2
?
D
constraints: “no
neighboring regions
?
F
E have the same
?
color”
?
?
Exercise: Coloring Problem
7
2. Continuous variables
In a continuous CSP, variables can take one from a continuous
range of values.
For example, real numbers are continuous.
e.g., start/end times for Hubble Space Telescope observations
Varieties of CSPs
10
Backtracking Search:
The most common technique for solving incremental
formulations of CSPs.
Basically a depth-first search with a single variable assigned at
each level of the tree.
If no legal assignments are possible then we backtrack to try
other branches of the tree.
Variable assignments are commutative, i.e., Commutative
simply means that the order of operations does not
matter.
[ WA = red followed by NT = green ] is the same as
[ NT = green followed by WA = red ]
Only need to consider assignments to a single variable at
each node
b = d and there are dn leaves
(b=branching factor, d=size of domain, n = number of variables)
Backtracking example (1)
13
Backtracking example (2)
14
Backtracking example (3)
15
Backtracking example (4)
16
Improving Efficiency of Backtracking Search
17
Table: The forward checking algorithm applied to the Australia map-colouring problem
Finally we reach a state where we can see that there are no legal values
for SA, which would cause the algorithm to backtrack immediately.
Local search for CSPs
23
To apply to CSPs:
Allow states with unsatisfied constraints – start with random state.
Operators reassign variable values.
Incremental formulation:
Start with empty state, iteratively assign values.
Backtracking = depth-first search with one variable assigned per node.
Heuristics help significantly:
MRV (Minimum Remaining Values)
Most constraining variable
Least constraining value
Complete-state formulation
Start with complete state, iteratively change values.
Local search with min-conflicts is usually effective in practice.