Constraint Satisfaction Problem Solving - PowerPoint PPT Presentation

About This Presentation
Title:

Constraint Satisfaction Problem Solving

Description:

Find bindings for all the variables that satisfy all the constraints. ... Goal: assign colors so touching countries have different colors. C2. C1. C3. Model ... – PowerPoint PPT presentation

Number of Views:54
Avg rating:3.0/5.0
Slides: 15
Provided by: ics5
Learn more at: https://ics.uci.edu
Category:

less

Transcript and Presenter's Notes

Title: Constraint Satisfaction Problem Solving


1
Constraint SatisfactionProblem Solving
  • Chapter 5

2
Example problems
  • Illustrative
  • Map coloring
  • Cryptarithmetic
  • N-queens
  • Real
  • Class scheduling
  • Scheduled Hubble telescope
  • Discrete Optimization problems

3
Goal solve the problem
  • Find bindings for all the variables that satisfy
    all the constraints.
  • Corresponds to boolean satisfiability, except
    that now variables take on values from discrete
    sets.

4
Formal Model
  • Finite set of variables X1,Xn
  • Variable Xi has values in finite domain Di.
  • Constraints C1Cm. A constraint specifies legal
    combinations of the values. Tables.
  • Assignment selection of values for all
    variables.
  • Consistent assignment satisfies all constraints.

5
Note Constraints can be made binary
  • Constraints table of legal values
  • One trinary table between(a,b,c).
  • Between(2,4,5)
  • Replaced by conjunction of two binary relations
  • Less(2,4) Less(4,5)

6
Simple Mapcolors red, blue, greenGoal assign
colors so touching countries have different colors
7
Model
  • Variables X1, X2, X3
  • Domains Di red,blue,green.
  • X1 !X2 Table with 6 entries

red blue
red green
blue red
blue green
green red
green blue
8
Naïve BackTracking Solution
  • X1 red, X2 red, X3 red, X1!X2 Fail
  • Short hand for table lookup (not in table)
  • X1 red, X2red, X3blue, X1!X2 Fail
  • X1 red, X2red, X3green.Fail
  • X1 red, X2blue,.
  • Continue to Solution..
  • UGH. But it is the way Prolog works.

9
Selections in Backtracking
  • Selecting a variable to bind
  • Selecting a value to assign to the variable
  • Does Order Matter?
  • Yes and no
  • No search is complete any ordering will find a
    solution if one exists.
  • Yes search cost changes.

10
Controlling Backtracking
  • Choosing a variable to bind
  • Minimum remaining values (MRV)
  • Intuition need to solve eventually so do hardest
    case first
  • Degree Heuristic
  • choose variable involved in largest number of
    constraints. (tie-breaker)
  • Choosing a binding/value for variable
  • Least constraining variable
  • Intuition maximize search options

11
Forward Checking
  • Constraint Propagation
  • If variable X is bound, find all variables Y
    that are connected to it by a constraint.
    Eliminate values that are inconsistent.
  • Can yield dramatic improvement.
  • Provably better than backtracking
  • Guaranteed to do less work

12
Relook at Map-coloringUsing Forward Checking
  • X1 red remove red from X2 and X3 domains
  • X2 blue remove blue from X3s domain
  • X3 green.
  • Done!

13
Arc-Consistency (3)
  • Binary CSP (can always force this)
  • Arc edge between variables that are in same
    constraint.
  • Let X-Y be arc.
  • for each x in Domain X if there is no value y
    in domain Y that allows constraint to be met,
    then delete x from domain X.
  • Just look in the tables
  • Can be done as preprocessing or during search.

14
AC3 Example
  • TWOTWO FOUR
  • edge between T and F gives
  • (TTCarry )/10 F we see that only
  • T in 5,6,7,8,9 can work for F 1.
  • Edge between F and R says R \ 1.
  • Edge between (OO)10 R and O\R
  • gives O \ 0.
Write a Comment
User Comments (0)
About PowerShow.com