1 / 28

Constraint Satisfaction Problems (CSPs)

Chapter 5. Constraint Satisfaction Problems (CSPs). Date:2004/3/17 Presenter: Shih, Ya-Ting. Outline. CSPs Backtracking search for CSPs Local search for CSP Problem structure. 1 CSPs. a type of Assignment Problems for problem solving

jorryn
Download Presentation

Constraint Satisfaction Problems (CSPs)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 5 Constraint Satisfaction Problems (CSPs) Date:2004/3/17Presenter: Shih, Ya-Ting

  2. Outline • CSPs • Backtracking search for CSPs • Local search for CSP • Problem structure

  3. 1 CSPs • a type of Assignment Problems for problem solving • states & goal test : a standard, structured, & very simple representation • CSP is defined by –a set of variables, X1,X2,…,Xn,with values from domain D1,D2,…,Dn,and a set of constraints, C1,C2,…,Cn,specifying allowance combinations of values for subsets of variables

  4. 1 CSPs (cont.) • State is defined by an assignment of values to some or all of the variables,{ Xii= vi , Xjj= vj , … } • Consistent ( or legal) assignment is an assignment that does not violate any constraints. • Complete assignment is one in which every variable is mentioned. • Solution is a complete assignment that satisfies all the constraints.

  5. 1.1 Example: Map-Coloring NT Q WA SA NSW V T

  6. 1.1 Example: Map-Coloring (cont.)

  7. 1.2 Constraint graph

  8. 1.3 Varieties of CSPs • Discrete variables- finite domains:eg. Mapping coloring、8-Queens puzzle - infinite domains: (integers , strings , etc.)need a constraint language eg. Job scheduling ,StartJob1+5<StartJob3 • Continuous variables eg. Hubble Space Telescope observation Linear programming problems

  9. 1.4 Varieties of Constraints • Unary constraint:involves a single variableeg. SA ≠ green • Binary constraint:involves pairs of variableseg. SA ≠ WA • Higher-order constraint:involves 3 or more variableseg. Cryptarithemetic puzzles (F5.2(a))(p.148) • Preference constrainteg. red is better than greenoften representable by a cost for each variable assignment constrained optimization problems

  10. 2 Backtracking search for CSPs • In all CSPs, variable assignment are commutative. (if…)eg. [ WA = red then NT = green ] same as [ NT = green then WA = red ] • Only need to consider assignment to a single value at each node. • Backtracking search-- a form of DSF search for CSP with single–variable assignments

  11. 2.1 Backtracking Example

  12. 2.2 Some Key Questions of Backtracking Search • Variable and value orderingwhich variable should be assigned next, and in what order should its values be tried? • Propagating information through constraintswhat are the implications of the current variable assignments for the other unassigned variables? • Intelligent backtrackingwhen a path fails– that is, a state is reached in which a variable has no legal value – can the search avoid repeating this failure in subsequent paths?

  13. 2.2.1 Most constrained variable • Minimum remaining variable (MRV) heuristicor Most constrained variable heuristicor Fail-First heuristic-- choose the variable with the fewer legal values

  14. 2.2.2 Most constraining variable • Degree heuristic-- tie-breaker among most constrained variables-- choose the variable with the most constrains on remaining variables

  15. 2.2.3 Least constraining value • Least-constraining-value heuristic-- try to leave the maximum flexibility for subsequent variable assignment-- prefer the value that rules out the fewest choices for the neighboring variables in the constraint graph

  16. 2.3 Constraint Propagation • Propagation the implications of a constraint on one variable onto other variables -- Forward checking-- Arc consistency (more stronger)

  17. 2.3.1 Forward Checking • Idea:Keep track of remaining legal values for unassigned variables. Terminate search when any variable has no legal values. • Whenever a variable X is assigned, the forward checking process looks at each unassigned variable Y that is connected to X by a constraint and deletes from Y’s domain. Any value that is inconsistent with the value chosen for X.

  18. 2.3.1 Forward Checking (cont.) WA NT Q NSW V SA T Initial domains After WA=red After Q=green After V=blue Figure 5.6 Partial assignment { WA=red, Q=green V=blue } is inconsistent with the constraint of the problem

  19. 2.3.2 Arc Consistency • Simplest form of propagation makes each arc consistent. • X→Y is consistent iff for every value x of X, there is some allowed y • Applying arc consistency has result in early detection of an inconsistency that is not detected by pure forward checking.

  20. 2.3.2 Arc Consistency (cont.-1) Consistent!!

  21. 2.3.2 Arc Consistency (cont.-2) Inconsistent!!

  22. 2.3.2 Arc Consistency (cont.-3)

  23. 2.4 Intelligent backtracking • called chronological backtrackingcause the most recent decision point is revisited-- to go all the way back to one of the set of variables that caused the failure-- conflict set • The backjumping method backtracks to the most recent variable in the conflict set • Backjumping occurs when every value in a domain is in conflict with the current assignment .

  24. 2.4 Intelligent backtracking (cont.) • fixed variable ordering Q, NSW, V, T, SA, WA, NT • partial assignment {Q=red, NSW=green, V=blue, T=red} (conflict set for SA) every value violates a constraint 7 1 6 2 5 3 4

  25. 3 Local Search for CSP • min-conflicts heuristic choose value that violates the fewest constraints • 8-Queens problem

  26. 4 Problem structure

  27. 4.1 Tree-structured CSPs

  28. 4.2 Nearly tree-structured CSPs

More Related