1. Path consistency
Arc consistence can help reduce the domains of variables.
However, sometimes it tasks no effect.
Path consistency:
A two-variable set {Xi, Xj} is path-consistent wrt variable Xm if, for every
assignment {Xi = a, Xj = b} consistent with the constraints on {Xi, Xj}, there is an
assignment to Xm that satisfies the constraints on {Xi, Xm} and {Xm, Xj}.
2. Example
In the map coloring problem: if we use only
2 colors {red, blue}
Constraint: X ≠ Y
Arc-consistent?
Yes, since with each color of X,
Path-consistent?
Consider {HaNoi = red, BacNinh = blue},
3. PC-2 algorithm can enforce path consistency.
It is very similar to AC-3 algorithm.
4. K-consistency
A general form of local consistency.
A CSP is k-consistent if, for any set of k − 1 variables and for any consistent assignment
to those variables, a consistent value can always be assigned to any kth variable.
Some special cases:
1-consistency:
2-consistency:
3-consistency:
5. Global constraints
A global constraint is one involving an arbitrary number of variables
For example, the Alldiff constraint
6. Global constraints
Example 2: Atmost constraint: in the car assembly scheduling problem,
We can enforce consistency by deleting the maximum value of any domain if i
7. Sodoku problem
No digit appears twice in any row, column, or 3 ×
3 box.
Image:
(Russell,
2016)
8. Sudoku puzzle as a CSP
Variables:
Domains:
Constraints:
Image:
(Russell,
2016)
14. Motivation
Sudoku problems can be solved by inference over constraints (constraints propagation).
But many other CSPs cannot be solved by inference alone;
We could apply depth-first search:
However,
NOTE: CSPs have a property
Backtracking search
15. Ideas of Backtracking search
A depth first search that chooses values for one variable at a time and backtracks when
a variable has no legal values left to assign.
Main steps:
Backtracking search uses CSP components.
19. 1. Select next variable and value
For the selection of next variable:
Random selection:
For example,
Minimum remaining-values heuristic:
For example,
Degree heuristic:
For example,
20. 1. Select next variable and value
For the selection of next value:
Random selection:
Least-constraining-value heuristic:
For example:
21. 2. Inference
Propagation constraint to reduce domains of other
variables when having a new assignment (var = value).
Forward checking:
For example,
Forward checking doesn’t detect all inconsistencies, for example
Maintaining arc consistency:
PhuTho VinhPhuc BacNinh BacGiang
HaNoi = blue
HaiDuong =
22. 3. Backtracking strategies
Chronological backtracking:
Backjumping: store a conflict set – set of assignments conflicted with the value of
current variable.
For example,