CSP: Definition, Creation, and Algorithms - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

CSP: Definition, Creation, and Algorithms

Description:

Algorithms: Backtracking, Forward ... Introduction of CSP: Graph Coloring. Paint the graph with different colors. 3 Color? ... Example of Graph Coloring: ... – PowerPoint PPT presentation

Number of Views:109
Avg rating:3.0/5.0
Slides: 22
Provided by: ben85
Category:

less

Transcript and Presenter's Notes

Title: CSP: Definition, Creation, and Algorithms


1
CSP Definition, Creation, and Algorithms
  • Mr. Tianbing Lin t.lin_at_ieee.org
  • Dr. Goodwin Scott
  • University of Windsor

2
Outline
  • Introduction of Constraint Satisfaction Problem
  • Algorithms Backtracking, Forward Checking, Back
    Jump, Dynamic Backtracking
  • Evaluation Random CSP, N-Queen
  • Experimental Result
  • Question?

3
Introduction of CSP
  • Given a set of variables Xx1, x2xn and a
    finite set Di of possible values (its domain) for
    every variable.
  • Given some constraints restricting the values
  • How to assign values for all the variables so
    that all the constraints are satisfied?

4
Introduction of CSP N-Queen
  • Variables Q1, Q2, Q3, Q4
  • Domain 1, 2, 3, 4
  • Constraints
  • QiltgtQj Not in the same row
  • Qi-Qjltgti-j Not in diagonal
  • Extentional Constraints
  • (Q1, Q2) (1,3), (1,4), (2, 4), (3,1), (4, 1),
    (4, 2)
  • (Q1, Q3)

5
Introduction of CSP Graph Coloring
  • Paint the graph with different colors
  • 3 Color?

6
Algorithms Overview
  • Systematic Algorithms Backtracking, Forward
    Checking
  • Search the whole solution space systematically
  • In most cases, slow
  • Heuristical Algorithms Hill-climbing, Simulated
    Annealing, Genetic Algorithm
  • In some cases, fast
  • Might not get solution at all.

7
Algorithms Backtracking
8
Algorithms Forward Checking
9
Algorithms Back Jumping
  • if we find all the values of Variable C are
    invalid because they are conflict with the value
    of Variable A, then we don't need to change the
    value of B to check C again. We can directly jump
    to another value of Variable A, skip other values
    of B (under A1 value).
  • N-Queen problem can not demonstrate this
    algorithm.

10
Algorithms Dynamic Backtracking
  • When we back jump to A from C, we reset value of
    B.
  • Do we really have to reset B, if its not
    conflict with A or C?
  • We dynamically change the order of variables
    Before, A-gtB-gtC. Now B-gtA-gtC

11
Algorithms Dynamic Backtracking
  • Example of Graph Coloring
  • Weve finished painting the 3 slides in the north
    and 2 slides in the south.
  • We dont need to change the value of south slides.

12
Evaluation N-Queen
  • N-Queen is a nature test scheme.
  • Normally a PC can solve 30-Queen problem in
    reasonable time using above algorithms.
  • Drawback Every assignment create (almost) same
    number of no-good for other variables.

13
Evaluation Random CSP
  • Randomized constraints can be created according
    number of variables, average number of
    constraints, average tightness.
  • Use average solving time to compare different
    algorithms.

14
Experimental Results
15
Experimental Results Sort by Variable Number
16
Experimental Results Sort by Tightness
17
Considering Tightness
  • Constraint density cant assure the tightness of
    the CSP. For example, we have CSP A and CSP B
    (domain size 3, 3 variables)
  • Density of Constraint 1 and Density of Constraint
    2 are 33.3. Solution is empty, so the tightness
    is 0/27

18
Considering Tightness
  • Density of Constraint 1 and Density of Constraint
    2 are 33.3, Can have 9 solutions(1, 1, 1) (1,
    1, 2) (1, 1, 3) (2, 1, 1) (2, 1, 2) (2, 1, 3) (3,
    1, 1) (3, 1, 2) (3, 1, 3), which means the
    tightness is 9/2733.

19
Considering Tightness
  • The smallest constraint density of all the
    constraints is the maximum value of tightness the
    CSP can have. The exact value of the tightness
    depends on the relation of the constraint tables.

20
Reference
  • 1 Barták, R., Constraint Programming In
    Pursuit of the Holy Grail, in Proceedings of the
    Week of Doctoral Students (WDS99), Part IV,
    MatFyzPress, Prague, June 1999, pp. 555-564.
  • 2 Malek Mouhoub, class notes of Artificial
    Intelligence.
  • 3 Prosser, P., Binary constraint satisfaction
    problems Some are harder than others,
    Proceedings ECAI-94 (11th European Conference on
    Artificial Intelligence)
  • 4 White, S, Enhancing Knowledge Acquisition
    with Constraint Technology, PhD Thesis,
    University of Aberdeen
  • 5 Pedro Meseguer, CSP Constraint Programming
  • 6 Joe Culberson and Toby Walsh , Tightness of
    Constraint Satisfaction Problems
  • 7 Peter van Beek and Rina Dechter, Constraint
    Tightness and Looseness versus Local and Global
    Consistency

21
Thank you
  • Question?
Write a Comment
User Comments (0)
About PowerShow.com