Notes 6: Constraint Satisfaction Problems. ICS 270A Spring 2003. Summary. The constraint network model Variables, domains, constraints, constraint graph, solutions Examples: graph-coloring, 8-queen, cryptarithmetic, crossword puzzles, vision problems,scheduling, design
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.
ICS 270A Spring 2003
Example: map coloring
Variables - countries (A,B,C,etc.)
Values - colors (e.g., red, green, yellow)
2Example 1: The 4-queen problem
Place 4 Queens on a chess board of 4x4 such that no two queens reside in the same row, column or diagonal.
1 2 3 4
1 X, Y, Z, T 3
Y = Z
1 X, Y, Z, T 3
Y = Z
domain of x domain of y
Arc is arc-consistent if for any value of there exist a matching value of
Algorithm Revise makes an arc consistent
1. For each a in Di if there is no value b in Di that matches a then delete a from the Dj.
Revise is , k is the number of value in each domain.
1. until there is no change do
2. For every directed arc (X,Y)
Complexity: , e is the number of arcs, n number of variables, k is the domain size.
Mackworth and Freuder, 1986 showed an algorithm
Mohr and Henderson, 1986:
Use constraint propagation to rank order the promise in non-rejected values.
Example: look-ahead value ordering (LVO) is based of forward-checking propagation
LVO uses a heuristic measure to transform this information to ranking of the values
Empirical work shows the approach is cost-effective only for large and hard problems.
Example: party problem
Is it possible that Chris goes to the party but Becky does not?
1. Generate a random assignment to all variables
2. Repeat until no improvement made or solution found:
// hill-climbing step
3. flip a variable (change its value) that
increases the number of satisfied constraints
Easily gets stuck at local maxima
Greatly improves hill-climbing by adding
restarts and sideway moves
Adds random walk to GSAT:
With probability p
random walk – flip a variable in some unsatisfied constraint
With probability 1-p
perform a hill-climbing step
Randomized hill-climbing often solves
large and hard satisfiable problems