Constraint Satisfaction: An Overview - PowerPoint PPT Presentation

About This Presentation
Title:

Constraint Satisfaction: An Overview

Description:

Principles of Intelligent Systems Constraint Satisfaction + Local Search Written by Dr John Thornton School of IT, Griffith University Gold Coast – PowerPoint PPT presentation

Number of Views:107
Avg rating:3.0/5.0
Slides: 29
Provided by: Schoolof48
Category:

less

Transcript and Presenter's Notes

Title: Constraint Satisfaction: An Overview


1
Principles of Intelligent SystemsConstraint
Satisfaction Local Search
Written by Dr John ThorntonSchool of IT,
Griffith University Gold Coast
2
Outline
  • The Constraint Satisfaction Paradigm
  • Variables, Domains and Constraints
  • Example Problem Domains
  • Constraint Satisfaction Algorithms
  • Local Search Algorithms
  • Summary

3
The Constraint Satisfaction Paradigm
  • Knowledge represented by constraints
  • What is allowed or disallowed.
  • Transforms broad range of problems into a
    computable form
  • Standard representation means general purpose
    algorithms can be used
  • solvers know how to solve problems
  • issue becomes how to model a problem

4
Variables, Domains and Constraints
  • A Constraint Satisfaction Problem (CSP) is
  • a set of variables each with
  • a set of domain of values, and
  • a set of constraints that define which
    combinations of variable values are allowed
  • the task is to find a domain value for each
    variable such that all constraints are
    simultaneously satisfied

5
Problem Domains
  • N-Queens
  • Satisfiability Problems
  • Binary Constraint Satisfaction
  • Nurse Rostering
  • University Timetabling

6
Local Search Algorithms
  • Getting stuck
  • Variable and Constraint-based Search
  • Random Walk
  • Tabu Search
  • NOVELTY and RNOVELTY
  • Constraint Weighting

7
Satisfiability Problems
  • Conjunctive Normal Form Example
  • ?x Ú ?y Ú ?z Ù x Ú y Ú ?z Ù ?x Ú y Ù ?y Ú
    z
  • To Solve
  • All clauses evaluate true
  • e.g. x false, y true, z true
  • As a CSP
  • Each clause is a constraint, each literal is a
    variable with a true, false domain

8
Predicate to Conjunctive Form
  • Predicate ?(X) (dog (X) ? animal (X))
  • Clause (? dog(X) Ú animal(X))
  • Clause is false only if ? dog(X) is false and
    animal(X) is false, i.e. if X is a dog and X is
    not an animal - in other words if X is a dog then
    X is an animal

9
Binary Constraint Satisfaction
  • Two variable constraint representation
  • Non-binary to binary transformation
  • Phase transition
  • p2crit 1 - m-2/p1(n - 1)
  • where p1 constraint density
  • p2 constraint tightness
  • m uniform domain size
  • n number of variables

10
Nurse Scheduling
11
Binary Constraint Representation
Variable 1
0 1 2 3 4
0
1
Variable 2
2
3
12
Random Walk Local Search
  • if randomly generated probability lt p
  • Take best cost local move
  • else
  • Take randomly selected local move

13
Tabu Search
  • if cost(best local move) lt best cost yet
  • Take best local move
  • else
  • Take best cost local move from the set of domain
    values that have not been used in the last n moves

14
The Eight Queens Problem
Domain
Variable
Constraint
15
Constraint Satisfaction Algorithms
  • Backtracking
  • Algorithm
  • 8-Queens Example
  • 8-Queens Performance
  • Local Search
  • Algorithm
  • 8-Queens Example
  • 8-Queens Performance

16
Summary
  • Constraint Satisfaction
  • practical knowledge representation
  • allows general purpose approaches
  • Algorithms
  • Backtracking
  • Local Search

17
Backtracking Algorithm
V list of all variables vi (i 1 to n) U
empty TryVariable() select next vi from V and
move to U for each domain value di of vi if di
satisfies all constraints with U Value(vi)
di if(V is empty) SaveSolution() else
TryVariable() move vi from U back to V
18
Basic Local Search Algorithm
assign a domain value di to each variable
vi while no solution and not stuck and not timed
out bestCost ? ? bestList ? ? for each
variable vi Cost(Value(vi)) gt 0 for each
domain value di of vi if Cost(di) lt bestCost
bestCost ? Cost(di) bestList ? di
else if Cost(di) bestCost bestList ?
bestList ? di Take a randomly selected move from
bestList
19
Backtracking Performance
20
Local Search Performance
21
Local Search Diagram
22
Eight Queens using Backtracking
23
Eight Queens using Local Search
24
Variable/Constraint-based Search
  • Variable-based search
  • Randomly select variable in constraint violation
  • Try all domain values for that variable
  • Constraint-based search
  • Randomly select a violated constraint
  • Try all domain values for all variables in the
    constraint that improve the constraint

25
NOVELTY
  • select best and second best cost moves that
    improve a violated constraint
  • if best cost move not most recent or p gt random
    value
  • select best cost move
  • else
  • select second best cost move

26
RNOVELTY
  • Same as NOVELTY except when best cost move is
    also most recent, then
  • if second best cost - best cost lt c or p lt
    random value
  • select second best cost move
  • else
  • select best cost move

27
Constraint Weighting
  • Add weight to all constraints violated at a local
    minimum graph colouring example
  • Use these weights to calculate cost of subsequent
    moves
  • Adding weights changes shape of cost surface
    fills in the minimum

28
Constraint Weighting Example
  • Graph Colouring

(a) Local minimum, cost 2w (b) After
Weighting, cost 3w (c) Final solution,
cost w
Write a Comment
User Comments (0)
About PowerShow.com