Global%20Constraints - PowerPoint PPT Presentation

About This Presentation
Title:

Global%20Constraints

Description:

for each a in dom(X), there is a support. each a in ub(S) appears in one support ... O(nd nt^3/2) where d=max(dom(Xi)) and t=|lb(T)| ROOTS constraint ... – PowerPoint PPT presentation

Number of Views:27
Avg rating:3.0/5.0
Slides: 40
Provided by: cseUn
Category:

less

Transcript and Presenter's Notes

Title: Global%20Constraints


1
Global Constraints
  • Toby Walsh
  • National ICT Australia and
  • University of New South Wales
  • www.cse.unsw.edu.au/tw

2
Course outline
  • Introduction
  • All Different
  • Lex ordering
  • Value precedence
  • Complexity
  • GAC-Schema
  • Soft Global Constraints
  • Global Grammar Constraints
  • Roots Constraint
  • Range Constraint
  • Slide Constraint
  • Global Constraints on Sets

3
ROOTS and RANGE
  • Large catalog of global constraints
  • but very little taxonomy?
  • global grammar constraints specify a family of
    useful global constraints
  • ROOTS and RANGE let us define many counting and
    occurrence constraints

4
Counting and Occurrence Constraints
  • Many (resource bounded) optimization decision
    problems contain
  • occurrence constraints (on values that occur)

5
Counting and Occurrence Constraints
  • Many (resource bounded) optimization decision
    problems contain
  • occurrence constraints (on values that occur)
  • E.g. the value Thur 3-5pm should occur once in
    the timetable of any PhD student following the
    course on global constraints

6
Counting and Occurrence Constraints
  • Many (resource bounded) optimization decision
    problems contain
  • counting constraints (on number of vals or vars
    satisfying a condition)

7
Counting and Occurrence Constraints
  • Many (resource bounded) optimization decision
    problems contain
  • counting constraints (on number of vals or vars
    satisfying a condition)
  • E.g. the value night shift can be used by at
    most 3 variables in any 7!

8
Using ROOTS and RANGE
  • Simple, declarative language for specifying many
    counting occurrence constraints
  • two new primitives
  • ROOTS and RANGE global constraints
  • Executable language
  • propagate primitives
  • need just to provide propagators within the
    constraint solver for ROOTS and RANGE

9
Specification language
  • Based around properties of functions
  • consider sequence of vars X1,..,Xn each taking a
    value in a D
  • then one view of X1,..,Xn is a function
    X1,n-gtD
  • For example
  • X1a, X2b, X3a

10
Specification language
  • Based around properties of functions
  • consider sequence of vars X1,..,Xn each taking a
    value in a D
  • then one view of X1,..,Xn is a function
    X1,n-gtD
  • For example
  • X1a, X2b, X3a
  • X(1)a, X(2)b, X(3)a

11
Specification language
  • Based around properties of functions
  • consider sequence of vars X1,..,Xn each taking a
    value in a D
  • then one view of X1,..,Xn is a function
    X1,n-gtD
  • This view is useful for specifying global
    constraints
  • NVALUES(X1,..,Xn,N) is equivalent to
    RANGE(X)N

12
RANGE constraint
  • Restricts range of function to a given subset
  • RANGE(X1,..,Xn,S,T) iff X(S)T

S
T
1,n
13
RANGE constraint
  • Restricts range of function to a given subset
  • RANGE(X1,..,Xn,S,T) iff X(S)T
  • e.g. RANGE(1,3,1,2,5,2,4,5,2,3,5)

S
T
1,n
14
RANGE constraint
  • Restricts range of function to a given subset
  • RANGE(X1,..,Xn,S,T) iff X(S)T
  • useful to describe values used (when values are
    resources)
  • Some examples
  • RANGE(X1,..Xn,1,..n,T) and TN is NValues
  • RANGE(X1,..Xn,1,..n,T) and Tn is
    AllDifferent

15
RANGE constraint
  • RANGE constraint involves both finite-domain
    variables (X1,..,Xn) and set variables(S,T)
  • to describe propagation, need to define new type
    of local consistency
  • hybrid consistency is a local consistency
    property for global constraints involving both
    finite domain and set variables

16
Hybrid Consistency
  • Constraint is hybrid consistent (HC)
  • for each a in dom(X), there is a support
  • each a in ub(S) appears in one support
  • each a in lb(S) appears in all supports
  • Reduces to GAC on finite domain vars,and BC on
    set vars

17
Hybrid Consistency
  • Constraint is hybrid consistent (HC)
  • for each a in dom(X), there is a support
  • each a in ub(S) appears in one support
  • each a in lb(S) appears in all supports
  • Consider RANGE(X1,..X4,S,T) where
  • X1,X2 in 1,2,5, X3 in 3,4 and X4 in 1
  • 4 subseteq S subseteq 1,2,3,4
  • subseteq T subseteq 1,2

18
RANGE constraint
  • Restricts range of function to a given subset
  • RANGE(X1,..,Xn,S,T) iff X(S)T
  • Polynomial to make HC
  • O(ndnt3/2) where dmax(dom(Xi)) and tlb(T)

19
ROOTS constraint
  • Restricts domain to those mapping to a given
    subset
  • ROOTS(X1,..,Xn,S,T) iff SX-1(T)

S
T
1,n
20
ROOTS constraint
  • Restricts domain to those mapping to a given
    subset
  • ROOTS(X1,..,Xn,S,T) iff SX-1(T)
  • E.g. ROOTS(3,1,2,3,0,1,4,5,0,3)

S
T
1,n
21
ROOTS constraint
  • Restricts domain to those mapping to a given
    subset
  • ROOTS(X1,..,Xn,S,T) iff SX-1(T)
  • E.g. RANGE(3,1,2,3,0,1,5,0,3)

S
T
1,n
22
ROOTS constraint
  • Restricts domain to those mapping to a given
    subset
  • ROOTS(X1,..,Xn,S,T) iff SX-1(T)
  • Useful to describe variables using particular
    values
  • An example
  • ROOTS(X1,..,Xn,S,d1,..,dm) SN is AMONG
    constraint

23
ROOTS constraint
  • Restricts domain to those mapping to a given
    subset
  • ROOTS(X1,..,Xn,S,T) iff SX-1(T)
  • NP-hard to make HC
  • but O(nd) when Xi or T are ground (all cases
    here!)

24
ROOTS constraint
  • ROOTS(X1,..,Xn,S,T) iff SX-1(T)
  • Reduction from 3SAT in N vars and M clauses
  • nNM
  • Xi in i,-i for 1ltiltN
  • Xi i iff xi is false

25
ROOTS constraint
  • ROOTS(X1,..,Xn,S,T) iff SX-1(T)
  • Reduction from 3SAT in N vars and M clauses
  • nNM
  • Xi in i,-i for 1ltiltN
  • XNj in i,-k,l iff jth clause is (xi or -xk or
    xl)

26
ROOTS constraint
  • ROOTS(X1,..,Xn,S,T) iff SX-1(T)
  • Reduction from 3SAT in N vars and M clauses
  • nNM
  • Xi in i,-i for 1ltiltN
  • XNj in i,-k,l iff jth clause is (xi or -xk or
    xl)
  • subseteq T subsetqe Union_i i, -i

27
ROOTS constraint
  • ROOTS(X1,..,Xn,S,T) iff SX-1(T)
  • Reduction from 3SAT in N vars and M clauses
  • nNM
  • Xi in i,-i for 1ltiltN
  • XNj in i,-k,l iff jth clause is (xi or -xk or
    xl)
  • subseteq T subseteq Union_i i, -i
  • SN1, NM

28
Specification language
  • Equalities and inequalities
  • X N, XN, ...
  • Set constraints
  • S subseteq T, SN, ...
  • Two global constraints
  • ROOTS and RANGE

29
Some examples
  • ALLDIFFERENT(X1,..,Xn) iff RANGE(X1,..,Xn,1,.
    .,n,T) Tn
  • unfortunately enforcing HC on decomposition does
    not make ALLDIFFERENT constraint GAC
  • E.g. X1, X2 in 1,2, X3 in 1,2,3,4
  • 1,2 subseteq T subseteq 1,2,3,4
  • so sometimes worth developing specialized
    propagators

30
Some examples
  • PERMUTATION(X1,..,Xn) iff RANGE(X1,..,Xn,1,..
    ,n,1,..,n)
  • special case of ALLDIFFERENT
  • clearly enforcing HC on decomposition makes
    constraint GAC
  • so sometimes this specification language is a
    good way to implement specific global constraints

31
Some examples
  • NVALUES(X1,..,Xn,N)
  • Xi 1in N
  • RANGE(X1,..,Xn,1,..,n,T) TN
  • enforcing HC on decomposition does not enforce
    GAC on NVALUES
  • but this is to be expected as it is NP-hard to do
    so!
  • one way (at least) to implement this global
    constraint

32
Some examples
  • AMONG(X1,..,Xn,d1,..,dm,N)
  • i Xidj N
  • ROOTS(X1,..,Xn,S,d1,..,dm) SN
  • enforcing HC on decomposition enforces GAC on
    AMONG
  • again example of where specification language is
    a good way to implement a specific global
    constraint

33
Some examples
  • COMMON(N,M,X1,..,Xn,Y1,..,Ym)
  • i ?j . XiYj N and j ?i . XiYj M
  • RANGE(Y1,..,Ym,1,..m,T)
  • ROOTS(X1,..,Xn,S,T) SN
    RANGE(X1,..,Xn,1,..n,V)
  • ROOTS(Y1,..,Yn,U,V) UM

34
Some examples
  • COMMON(N,M,X1,..,Xn,Y1,..,Ym)
  • i ?j . XiYj N and j ?i . XiYj M
  • Enforcing HC on decomposition does not enforce
    GAC on COMMON
  • but to be expected as NP-hard to do so!

35
Some examples
  • LINKSET2BOOLEANS(S,B1,..Bn) holds iff
  • Bij iff j in S
  • ROOTS(B1,..Bn,S,1)
  • Decomposition clearly does not hinder propagation
  • ROOTS is polynomial to enforce HC

36
Some examples
  • NOTALLEQUAL(X1,..Xn)
  • Nasty large disjunction
  • RANGE(X1,..Xn,1,..n,T) Tgt1

37
Other examples
  • GCC
  • SYMALLDIFFERENT
  • ELEMENT
  • DOMAIN
  • CONTIGUITY
  • ...
  • Whilst we can express many such global
    constraints, not all give effective propagators
    (e.g. GCC).

38
Global grammar constraints
  • Filtering algorithms from finite sized
    automata/membership of a regular language
  • How do they compare?
  • Such approaches are complementary
  • these automata can specify CONTIGUITY
  • but not PERMUTATION

39
Conclusions
  • Counting and Occurrence constraints can be
    specified using simple declarative language
  • needs two new global constraints ROOTS and RANGE
  • Efficient and effective means to implement a
    number of such constraints
  • when propagating specification achieves GAC
  • or constraint is NP-hard to propagate
  • however, we may still need to design a
    specialized propagator (e.g. gcc)
Write a Comment
User Comments (0)
About PowerShow.com