Download Constraint Processing - Embedded Intelligent Robotics - Lecture Slides and more Slides Robotics in PDF only on Docsity!
1
- Constraint Processing / Constraint Satisfaction Problem (CSP) paradigm
- Algorithms for CSPs
- Backtracking (systematic search)
- Constraint propagation (k-consistency)
- Variable ordering heuristics
- Backjumping and dependency-directed backtracking
- Viewing scheduling as a CSP
2
Constraint
Processing
4
Informal Definition of CSP
- CSP = Constraint Satisfaction Problem
- Given (1) a finite set of variables (2) each with a domain of possible values (often finite) (3) a set of constraints that limit the values the variables can take on
- A solution is an assignment of a value to each variable such that the constraints are all satisfied.
- Tasks might be:
- to decide if a solution exists,
- to find a solution,
- to find all solutions, or
- to find the “best solution” according to some metric.
5 Informal Example: Map Coloring
- Color the following map using three colors (red, green, blue) such that no two adjacent regions have the same color. E D A C B
7 Example: SATisfiability
- Given a set of propositions containing variables, find an assignment of the variables to {false,true} that satisfies them.
- Example, the clauses:
- A or B or ~C, ~A or D
- (equivalent to C - > A or B, D - > A)
- Are satisfied by A = false B = true C = false D = false
8 Real-world problems
- Scheduling
- Temporal reasoning
- Building design
- Planning
- Optimization/satisfaction
- Vision
- Graph layout
- Network management
- Natural language processing
- Molecular biology / genomics
- VLSI design Useful in the projects
10 Formal definition of a CN (cont.)
- Instantiations
- An instantiation of a subset of variables S is an
assignment of a legal domain value to each
variable in in S
- An instantiation is legal iff it does not violate any
(relevant) constraints.
- A solution is an instantiation of all of the variables in the network.
11 Typical Tasks for CSP
- Solutions:
- Does a solution exist?
- Find one solution
- Find all solutions
- Given a partial instantiation, do any of the above
- Transform the CN into an equivalent CN that is easier to solve.
13 Example: Crossword Puzzle 1 2 3 4 5
14
Running Example: XWORD Puzzle
- Variables and their domains
- X1 is 1 across D1 is 5-letter words
- X2 is 2 down D2 is 4-letter words
- X3 is 3 down D3 is 3-letter words
- X4 is 4 across D4 is 4-letter words
- X5 is 5 across D5 is 2-letter words
- Constraints (implicit/intensional)
- C12 is “the 3rd letter of X1 must equal the 1st letter of X2”
- C13 is “the 5th letter of X1 must equal the 1st letter of X3”.
- C24 is …
- C25 is …
- C34 is ...
16 Solving Constraint Problems
- Systematic search
- Generate and test
- Backtracking
- Constraint propagation (consistency)
- Variable ordering heuristics
- Backjumping and dependency-directed backtracking
17 Generate and test: XWORD
- Try each possible combination until you find one that works:
- Hoses – hike – run – hike – no
- Hoses – hike – run – hike – be
- Hoses – hike – run – hike – us
- Doesn’t check constraints until all variables have been instantiated
- Very inefficient way to explore the space of possibilities
19 Backtracking: XWORD (^1 2 ) 4 5
X1=hoses X1=laser X2=aron X2=same X2=hike X2=hike …
X3=run (^) X3=sun X3=let X4=hike … X4=same h o s e s u n a m e
20 Problems with backtracking
- Thrashing: keep repeating the same failed variable assignments - Consistency checking can help - Intelligent backtracking schemes can also help
- Inefficiency: can explore areas of the search space that aren’t likely to succeed - Variable ordering can help