SlideServe
Menu
Préférences
© SlideServe · v2026

Constraint Satisfaction Problem Solving

quemby-stanley avatar
14 diapositives · 338 Views · Nov 16, 2014

Constraint Satisfaction Problem Solving. Chapter 5. Example problems. Illustrative Map coloring Cryptarithmetic N-queens Real Class scheduling Scheduled Hubble telescope Discrete Optimization problems. Goal: solve the problem.

Constraint Satisfaction Problem Solving - slide 1
01 / 14Constraint Satisfaction Problem Solving
1 / 17

Télécharger la présentation

Constraint Satisfaction Problem Solving
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  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 C1…Cm. 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. C1 C2 C3 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:

  8. Naïve BackTracking Solution • X1 = red, X2= red, X3 = red, X1!=X2 #Fail • Short hand for table lookup (not in table) • X1= red, X2=red, X3=blue, X1!=X2 #Fail • X1= red, X2=red, X3=green….Fail • X1= red, X2=blue,…. 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 X3’s 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 • TWO+TWO = FOUR • edge between T and F gives: • (T+T+Carry )/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 (O+O)%10 = R and O\=R gives: O \= 0.