Constraint Satisfaction - PowerPoint PPT Presentation

About This Presentation
Title:

Constraint Satisfaction

Description:

... awm/731/constraint07-2x2.pdf. The Waltz Algorithm. More on Waltz Algorithm ... Using only the numbers 1, 2, 3, and 4, arrange four sets of these numbers into a ... – PowerPoint PPT presentation

Number of Views:292
Avg rating:3.0/5.0
Slides: 21
Provided by: elaine8
Category:

less

Transcript and Presenter's Notes

Title: Constraint Satisfaction


1
Constraint Satisfaction
R N Chapter 5
2
Constraint Satisfaction Early Use
From http//www-2.cs.cmu.edu/awm/731/constraint07
-2x2.pdf
3
The Waltz Algorithm
4
More on Waltz Algorithm
The constraints come from the fact that a line
must have the same label at both ends.
5
Crossword Puzzles
6
Latin Squares
Using only the numbers 1, 2, 3, and 4, arrange
four sets of these numbers into a four-by-four
array so that no column or row contains the same
two numbers. The result is known as a Latin
square. Here are two examples of Latin squares of
order 4
1 2 3 4 2 1 4 3 3 4 1 2 4 3 2 1
1 2 3 4 3 4 1 2 4 3 2 1 2 1 4 3
http//www.sciencenews.org/20000506/mathtrek.asp
7
Satisfiability
(P ? Q ? ?S) ? (A ? ? Q ? B) ? (P ? ? B ? ?C)
? (? A ? B ? C) ? (Q ? ?A ? ?C) Example
applications
8
Real Examples
Scheduling What else?
9
Algorithms for CSPs
  • Branching
  • State space usually incremental formulation
  • Straight line
  • State space usually complete-state formulation

10
Cryptarithmetic
SEND MORE MONEY
PEAS description
  • State space when formulated as a CSP variables,
    domain, constraints
  • Incremental state space formulation
  • Complete state formulation

11
Cryptarithmetic
SEND MORE MONEY
Representing the constraints As formulas As a
graph Using special constraints Alldiff
12
Cryptarithmetic Best First Search
SEND MORE MONEY
M 1
M 2
M 2
13
Cryptarithmetic Best First Search
SEND MORE MONEY
M 1
M 2
M 2
M 1 S 2 O 3
14
Cryptarithmetic Branching Algorithms
  • Backtracking
  • Minimum remaining values
  • Degree heuristic
  • Least-constraining value

SEND MORE MONEY
M 1
M 2
M 2
15
Cryptarithmetic Constraint Propagation
Forward checking After assigning a value to a
variable X, look at all the variables connected
to X and prune inconsistent values. Constraint
propagation using arc consistency The
tradeoff how much time to spend propagating vs.
searching.
SEND MORE MONEY
16
Backtracking Chronological vs. Dependency
Directed
17
Straight-Line Algorithms Min-Conflicts
function Min-Conflicts(csp, max_steps) returns a
solution or failure inputs csp, a constraint
satisfaction problem max_steps, the number of
steps allowed before giving up current ? an
initial assignment for csp for i 1 to
max_steps do if current is a solution for csp
then return current var ? a randomly chosen,
conflicted variable from Variablescsp value
? the value v for var that minimizes
Conflicts(var, v, current, csp) set var
value in current return failure
18
Do Straight-Line Algorithms Work?
Does Min-Conflicts work?
From http//www.cs.mu.oz.au/303/slides/week03ah.p
df
19
Do Straight-Line Algorithms Work?
20
Another Win of Straight Line Algorithms
They can be used to perturb a solution that
ceases to be correct Most scheduling problems
Write a Comment
User Comments (0)
About PowerShow.com