1
Constraint Satisfaction Problems Problems
Artificial Intelligence AIMA 2nd edition, chapter 5 Section 1 – 3 Hadi Moradi
1
Outline
Constraint Satisfaction Problems (CSP)
B kt ki h f CSP
Backtracking search for CSPs Local search for CSPs
2
Constraint Satisfaction Problems Problems Artificial Intelligence - - PDF document
Constraint Satisfaction Problems Problems Artificial Intelligence AIMA 2 nd edition, chapter 5 Section 1 3 Hadi Moradi 1 Outline Constraint Satisfaction Problems (CSP) Backtracking search for CSPs B kt ki h f CSP Local
Artificial Intelligence AIMA 2nd edition, chapter 5 Section 1 – 3 Hadi Moradi
1
Constraint Satisfaction Problems (CSP)
Backtracking search for CSPs Local search for CSPs
2
CSP:
4
5
Solutions are complete and consistent assignments,
Binary CSP: each constraint relates two variables
Discrete variables
finite domains: infinite domains:
7 Continuous variables
Unary constraints involve a single variable, Binary constraints involve pairs of variables,
8
Higher-order constraints involve 3 or more
Assignment problems Timetabling problems Transportation scheduling
9
Factory scheduling
Let's start with the straightforward approach, then fix it
Initial state:
B anching facto
10
1.
Branching factor:
[ WA = red then NT = green ] same as [ NT = green then WA = red ]
backtracking search
11
12
13
14
15
16
General-purpose methods can give huge
Which variable should be assigned next? In what order should its values be tried?
17
Can we detect inevitable failure early?
18
Choose the Most constraining variable:
19
Given a variable, choose the least
Idea:
Keep track of remaining legal values for unassigned variables
p g g g
Terminate search when any variable has no legal values
21
22
23
24
Forward checking doesn't provide early detection for all
Simplest form of propagation makes each arc consistent
X Y is consistent iff
26
Simplest form of propagation makes each arc consistent
X Y is consistent iff
27
If X loses a value, neighbors of X need to be rechecked
30
Hill-climbing, simulated annealing typically work with
To apply to CSPs: 31
States: 4 queens in 4 columns (44 = 256 states)
constrain values and detect inconsistencies
33
constrain values and detect inconsistencies