m5 CSP
m5 CSP
Problems
Chapter 5
Section 1 – 3
CSP:
state is defined by variables Xi with values from domain Di
Continuous variables
e.g., start/end times for Hubble Space Telescope observations
linear constraints solvable in polynomial time by linear programming
4 Feb 2004 CS 3243 - Constraint Satisfaction 7
Varieties of constraints
Unary constraints involve a single variable,
e.g., SA ≠ green
Variables: F T U W
R O X 1 X2 X 3
Domains: {0,1,2,3,4,5,6,7,8,9}
Constraints: Alldiff (F,T,U,W,R,O)
O + O = R + 10 · X1
X1 + W + W = U + 10 · X2
X2
4 Feb 2004 + T + T = O + CS
103243
· X3- Constraint Satisfaction 9
Real-world CSPs
Assignment problems
e.g., who teaches what class
Timetabling problems
e.g., which class is offered when and where?
Transportation scheduling
Factory scheduling
Combining these
4 Feb 2004 CS 3243 heuristics makes 1000
- Constraint Satisfaction 21
Forward checking
Idea:
Keep track of remaining legal values for unassigned variables
Terminate search when any variable has no legal values
Constraint propagation
4 Feb 2004 CS 3243 repeatedly enforces constraints
- Constraint Satisfaction 26
Arc consistency
Simplest form of propagation makes each arc consistent
X Y is consistent iff
To apply to CSPs:
allow states with unsatisfied constraints
Value selection by CS
4 Feb 2004 min-conflicts heuristic:
3243 - Constraint Satisfaction 32
Example: 4-Queens
States: 4 queens in 4 columns (44 = 256 states)