SLIDE 1
ECE 4524 Artificial Intelligence and Engineering Applications - - PowerPoint PPT Presentation
ECE 4524 Artificial Intelligence and Engineering Applications - - PowerPoint PPT Presentation
ECE 4524 Artificial Intelligence and Engineering Applications Meeting 7: Constraint Satisfaction Reading: AIAMA 6.1-6.2 Todays Schedule: Review of problem solving using state space search States with factored representations Define
SLIDE 2
SLIDE 3
Review of the Problem Solving Agent
Problem Solving Agents formulate problems by
◮ representing (model) the world as atomic states, ◮ defining an initial state that represents the initial condition of
the world,
◮ defining a goal state that represents what they want the
world to look like,
◮ and defining a function for allowable state transitions which
map onto actions in the world.
SLIDE 4
Some problems have states that can be factored
◮ state = variables with values ◮ constraints specify allowed or prohibited relationships among
the variables
◮ general purpose heuristics can be applied
A classic example is Einstein’s Riddle (Zebra puzzle).
SLIDE 5
Einstein’s Riddle
- 1. There are five houses.
- 2. The Englishman lives in the red house.
- 3. The Spaniard owns the dog.
- 4. Coffee is drunk in the green house.
- 5. The Ukrainian drinks tea.
- 6. The green house is immediately to the right of the ivory house.
- 7. The Old Gold smoker owns snails.
- 8. Kools are smoked in the yellow house.
- 9. Milk is drunk in the middle house.
- 10. The Norwegian lives in the first house.
- 11. The man who smokes Chesterfields lives in the house next to
the man with the fox.
- 12. Kools are smoked in the house next to the house where the
horse is kept.
- 13. The Lucky Strike smoker drinks orange juice.
- 14. The Japanese smokes Parliaments.
- 15. The Norwegian lives next to the blue house.
SLIDE 6
Formally a CSP is
◮ X, a finite set of variables ◮ D, a set of Domains for each variable, each Domain also a set ◮ C, a set of constraints, each defined as (scope, relation)
◮ scope - set of variables, a subset of X involved in the relation ◮ relation - the relationship among them, a function of the scope
variables that returns True or False
SLIDE 7
Warmup
NPR’s Weekend Edition Sunday usually has a word puzzle, e.g. “Think of a well-known actor, three letters in the first name, seven letters in the last. One of the letters is an ”S.” Change the ”S” to a ”K” and rearrange the result, and you’ll name a well-known fictional character. Who is it?” Describe the above as a CSP.
SLIDE 8
Exercise
Consider the following CSP. X = X1, X2 D = X1 ∈ Strictly Positive Real Numbers, X2 ∈ Strictly Positive Integers C = X 2
1 + X 2 2 < 2
What is the solution (manual), i.e. what are allowed values of X1 and X2?
SLIDE 9
CSP solutions
An assignment of variables to values in their respective domain can be
◮ consistent - violates no constraints ◮ partial, if some variables unassigned ◮ complete, if all variables are assigned a value
A solution to the CSP is a complete and consistent assignment.
SLIDE 10
Some terminology
◮ Domains may be continuous or discrete, finite or infinite ◮ Constraints may be
◮ unary - only one variable in the scope ◮ binary - only two variables in the scope ◮ n-ary - n variables in scope ◮ global - arbitrary number of variables are in the scope (often
all of them)
SLIDE 11
Most CSP algorithms assume binary constraints.
How might one in general convert all n-ary constraints to binary
- nes?
Give it some thought, can you see a solution in the case A + B = C? (Exercise 6.6 in the text)
SLIDE 12
Example: Map Coloring
SLIDE 13
Example: Scheduling
◮ How to schedule experiments on an expensive piece of
equipment, e.g. Large Hadron Collider or Hubble Space Telescope.
◮ How to schedule courses (or meetings in general) ◮ How to schedule jobs on CPUs or computer clusters ◮ How to schedule tasks on a large construction project ◮ How to pack containers and vehicles ◮ etc.
SLIDE 14
Example: Sukodu
SLIDE 15
Example: KenKen
SLIDE 16
Inference using Local Consistency
◮ Node Consistency ◮ Arc Consistency ◮ Path Consistency
SLIDE 17
AC-3 Algorithm
SLIDE 18
Exercise
A CSP: X : {X1, X2, X3} D : X1 ∈ {A, B, C} , X2 ∈ {A, C, E} , X3 ∈ {E, B, C, A} C : {X1 = X2 = X3} Apply AC-3 to check for an inconsistency.
SLIDE 19