Local Search and Consistency Techniques for CSP - PowerPoint PPT Presentation

1 / 23
About This Presentation
Title:

Local Search and Consistency Techniques for CSP

Description:

Arc-consistency checks inconsistencies between two variables, which is inadequate sometimes. ... Therefore, enforcing path-consistency may add constraints or ... – PowerPoint PPT presentation

Number of Views:225
Avg rating:3.0/5.0
Slides: 24
Provided by: Computin64
Category:

less

Transcript and Presenter's Notes

Title: Local Search and Consistency Techniques for CSP


1
Local Search and Consistency Techniques for CSP
  • -Constraint propagation for CSP

2
Local Search
  • Local search usually refers to search methods
    that are incomplete. Stochastic search is one
    example (a later lecture), and general
    i-consistency is another.

3
Contents
  • I-consistency
  • Path-consistency
  • Singleton consistency
  • Global constraints
  • Bounds-consistency

4
Higher level consistency
  • Arc-consistency checks inconsistencies between
    two variables, which is inadequate sometimes.
  • Example
  • Dx Dy D z red, blue
  • x ! y, y ! z, z ! x
  • Although we can have assignments ltx, redgt and
  • lty, bluegt, satisfying the first constraint, no
    color for z will be consistent with ltx, redgt and
    lty, bluegt, respectively.

5
I-consistency
  • A CSP is i-consistent iff given any consistent
    instantiation of i-1 variables, there exists an
    instantiation of any ith variable such that the i
    values taken together satisfy all of the
    constraints among the i variables.
  • A CSP is strongly i-consistent iff it is
    j-consistent for all j lt i.
  • Globally consistent A CSP is strongly
    i-consistent where i is the number of variables.
  • Globally consistent CSPs immediate solution
    without search. But enforcing global consistency
    takes exponential time.

6
  • i1 Node-consistency
  • e.g. x gt 100
  • All values of domain of x less than 100
  • can be removed.
  • i2 Arc-consistency (AC)
  • i3 3-consistency (coincides with
    path-consistency for binary CSPs)

7
Path-consistency
  • Given a CSP, a two variable pair (x,y) is
    path-consistent
  • relative to z iff for any consistent assignment
    x ? a,
  • y ? b, there is a value c ? Dz such that x ? a,
    z ? c is
  • consistent and y ? b, z? c is consistent.
  • A binary constraint c(x,y) is path consistent
    relative to z iff for every pair (a,b) ? c(x,y),
    there is a value c ? Dz, which is a neighbor of
    both x and y, such that (a,c) ? c(x,z) and (b,c)
    ? C(y,z).
  • A CSP is path consistent iff for every constraint
    c(x,y) and for any z, z is a neighboring variable
    of both x and y, but different from x and y,
    c(x,y) is path consistent relative to z.

8
Example
  • Domains of all variables, x , y and z, are 0,1
  • c(x,y) (0,1),(1,0)
  • c(x,z) (0,1),(1,0)
  • c(z,y) (0,1),(1,0)
  • This CSP is arc-consistent but not
    path-consistent.
  • Consider (0,1) ? c(x,y), there is no value v for
    z such that (0,v) ?c(x,z) and (v,1) ? c(z,y).

9
Example
  • All domains are 0,1,2,3
  • c(x,y) (0,0),(0,1),(1,2),(1,3),(2,0),(2,1),
    (3,2),(3,3)
  • c(x,z) (0,0),(0,1),(1,2),(1,3),(2,0),(2,1),
    (3,2),(3,3)
  • c(z,y) (0,2),(1,3),(2,0),(3,1),(1,2),(0,3),
    (3,0),(2,1)
  • This CSP is arc-consistent.
  • But for any pair (a,b) ? c(x,y), there is no
    value v ? Dz that can be used to verify
    path-consistency.

10
Higher level consistency is about tuples being no
good
  • Unlike arc-consistency, enforcing
    path-consistency doesnt reduce domains directly.
  • Rather, when a CSP is not path-consistent, it
    simply means some pair of values cannot take
    place simultaneously in any solution of the CSP.
  • Therefore, enforcing path-consistency may add
    constraints or tighten constraints (delete
    tuples).

11
In picture

x
y
z
Picture of x and y being path-consistent relative
to z.
12
CSP in Picture DxDyDz red, blue
x ! y, y ! z, z ! x

x
r
b
b
r
y
r
z
b
Enforcing the constraint (x ! y)
path-consistent relative to z will empty it,
declaring inconsistency.
13
Enforcing path-consistency may add constraints
  • Example
  • DxDyDz 1,2
  • c(x,z) (1,1),(2,2), c(y,z)
    (1,1),(2,1)
  • No constraint over x and y, meaning every
    tuple is allowed. But variable pair ltx,ygt is not
    path-consistent w. r.t. z. Enforcing
    path-consistency on ltx,ygt results in a new, but
    equivalent CSP, by adding
  • c(x,y) (1,1), (1,2)
  • This means, the tuples over x and y, namely
    (2,1) and (2,2) are inconsistent.

14
Singleton arc-consistency (SAC)
  • Idea (filtering of single values)
  • Suppose we commit a value v to a variable x,
    and then
  • enforce AC. If any domain becomes empty, then it
    means the value v for x cannot lead to any
    solution. So, we can safely remove v from Dx.
  • Definition of SAC
  • A CSP is singleton arc-consistent iff for any
    variable x with a non-empty domain, and for any a
    ? Dx, the CSP obtained by restricting the domain
    Dx to a, can be made arc-consistent with
    non-empty domains.

15
Singleton i-consistency
  • Similarly, the idea of SAC can be applied to any
    i-consistency
  • Restricting a variable to a value, and enforce
    i-consistency If this leads to inconsistency
    (some constraint cannot be satisfied), then the
    value is removed from the domain of the variable.
  • The process is done for each value and each
    variable. So, zero or more values may be removed.

16
Example (earlier)
  • All domains are 0,1,2,3
  • c(x,y) (0,0),(0,1),(1,2),(1,3),(2,0),(2,1),
    (3,2),(3,3)
  • c(x,z) (0,0),(0,1),(1,2),(1,3),(2,0),(2,1),
    (3,2),(3,3)
  • c(z,y) (0,2),(1,3),(2,0),(3,1),(1,2),(0,3),
    (3,0),(2,1)
  • This CSP is arc-consistent but not SAC Suppose
    we restrict Dx to 0, we get a CSP
  • c(x,y) (0,0),(0,1)
  • c(x,z) (0,0),(0,1)
  • c(z,y) (0,2),(1,3),(2,0),(3,1),(1,2),(0,3),
    (3,0),(2,1)
  • Enforcing arc-consistency removes 2 and 3 from Dy
    and all the values from Dz. The fact that a
    domain becomes empty means ltx,0gt is no good.

17
Global Constraints
  • Two objectives
  • Easier modeling
  • Efficient processing Specialized propagators
    designed for frequently used constraints
  • allDifference(x1,,xn)
  • values assigned to these variables be mutually
    different.

18
AllDifference
  • Alldifference can be expressed by a collection of
    binary non-equal constraints but applying
    arc-consistency often has no effect.
  • CSP
  • DxDyDz Ds 1,2
  • x ! y, x ! z, x ! s
  • y ! z, y ! s
  • z ! s
  • Though clearly this CSP has no solution, it is
    arc-consistent.

19
Global Constraints
  • A large collection, E.g.,
  • Sum making one variable equal to the sum of k
    variables.
  • Knapsack constraint A generalization of Sum
  • Global cardinality constraint (generalizes
    allDifference) A set of variables
  • X x1,xn
  • take their values in a subset of
  • V v1,vm
  • such that the number of times a value vi is
    assigned to a variable in X in constrained in an
    interval 1,k.

20
Global Constraints
  • Cumulative constraints
  • Enforce, at each point in time, that the
    cumulative
  • resource consumption of a set of tasks that
  • overlaps does not exceed the specified capacity.
  • Each task has a start, a duration, and a resource
  • consumption (which are all domain variables).

21
Bounds-consistency
  • Idea
  • For large integer domains, we can narrow variable
    domains by moving the bounds inwards (increase
    lower bound and reduce the upper bound).
  • E.g. DxDy1,1000
  • x gt y 500
  • Immediately we know the domains can be cut,
  • New domain of x 501,1000
  • New domain of y 1,499

22
Bounds-consistency Definition
  • Let c(xi,,xj) be a constraint where the variable
    domains are all well-defined orders.
  • Notation min(Dx ) denotes the minimum value of
    Dx .
  • A variable x ? xi,,xj is bounds-consistent
    relative to c(xi,,xj) if the value min(Dx)
    (resp. max(Dx)) can be extended to a full tuple t
    of c(xi,,xj).
  • A constraint is bounds-consistent if each of its
    variables is bounds-consistent.

23
Example
  • Variables x1, , x6, all with domain 1,6
  • c1 x4 gt x1 3 c3 x5
    gt x3 3
  • c2 x4 gt x2 3 c4 x5
    gt x4 1
  • c5 allDifferent(x1, x2, x3, x4, x5)
  • Enforcing bounds-consistency
  • Using constraints c1 through c4 (repeatedly)
  • D1D2 1,2, D31,2,3,
    D44,5, D55,6
  • Using C5 produces
  • D3 3
  • Now, C3 is no longer bounds-consistent, using it
    we get
  • D5 6.
  • Is the resulting CSP arc-consistent?
Write a Comment
User Comments (0)
About PowerShow.com