- 101 Views
- Uploaded on
- Presentation posted in: General

Constraint Satisfaction Problems (CSPs)

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Chapter 5

Constraint Satisfaction Problems (CSPs)

Date:2004/3/17Presenter: Shih, Ya-Ting

- CSPs
- Backtracking search for CSPs
- Local search for CSP
- Problem structure

- 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

- 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.

NT

Q

WA

SA

NSW

V

T

- 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

- 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

- 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

- 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?

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

- Degree heuristic-- tie-breaker among most constrained variables-- choose the variable with the most constrains on remaining variables

- 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

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

- 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.

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

- 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.

Consistent！！

Inconsistent！！

- 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 .

- 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

- min-conflicts heuristic choose value that violates the fewest constraints
- 8-Queens problem