Global Constraints - PowerPoint PPT Presentation

1 / 37
About This Presentation
Title:

Global Constraints

Description:

Even numbered CSP vars represent truth assignment. Odd numbered CSP vars 'junk' to ensure N odd values in each block. X_2jN 2i odd iff xi true ... – PowerPoint PPT presentation

Number of Views:32
Avg rating:3.0/5.0
Slides: 38
Provided by: cseUn
Category:

less

Transcript and Presenter's Notes

Title: Global Constraints


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
SLIDE meta-constraint
  • Even hotter off the press than the value
    PRECEDENCE constraint
  • Under review for IJCAI 07!

4
SLIDE meta-constraint
  • A constructor for generating many sequencing and
    related global constraints
  • REGULAR
  • CONTIGUITY
  • LEX
  • CARD PATH
  • Slides a constraint down one or more sequences of
    variables
  • Ensuring constraint holds at every point
  • Fixed parameter tractable

5
Basic SLIDE
  • SLIDE(C,X1,..Xn) holds iff
  • C(Xi,..Xik) holds for every i
  • AMONG SEQ constraint
  • Used by ILOG for assembly line car sequencing at
    Renault
  • At most 1 in 3 cars have a sun roof
  • SLIDE(C,X1,..Xn) where C(X1,X2,X3) holds iff
    AMONG(X1,X2,X3,0,1,D) where D is set of cars
    ordered with sunroofs

6
GSC
  • Global sequence constraint in ILOG Solver
  • Combines AMONG SEQ with GCC
  • Regin and Puget give partial propagator
  • We can show why!

7
GSC
  • Global sequence constraint in ILOG Solver
  • Combines AMONG SEQ with GCC
  • Regin and Puget give partial propagator
  • We can show why!
  • It is NP-hard to enforce GAC on GSC
  • Can actually prove this when GSC is AMONG SEQ
    plus an ALL DIFFERENT
  • ALL DIFFERENT is a special case of GCC

8
GSC
  • Reduction from 1in3 SAT on positive clauses
  • The jth block of 2N clauses will ensure jth
    clause
  • Even numbered CSP vars represent truth assignment
  • Odd numbered CSP vars junk to ensure N odd
    values in each block
  • X_2jN2i odd iff xi true
  • AMONG SEQ(X1,,N,N,2N,1,3,..)
  • This ensures truth assignment repeated along
    variables!

9
GSC
  • Reduction from 1in3 SAT on positive clauses
  • Suppose jth clause is (x or y or z)
  • X_2jN2x, X_2jN2y, X_2jN2z in 4NM4j,
    4NM4j1, 4NM4j2
  • As ALL DIFFERENT, only one of these odd
  • For i other than x, y or z, X_2jN2i in 4jN4i,
    4jN4i1 and X_2jN2i1 in 4jN4i2, 4jn4i3

10
SLIDE down multiple sequences
  • Can SLIDE down more than one sequence at a time
  • LEX(X1,..Xn,Y1,..Yn)
  • Introduce sequence of Boolean vars B1,..Bn1
  • Play role of alpha in LEX propagator

11
SLIDE down multiple sequences
  • Can SLIDE down more than one sequence at a time
  • LEX(X1,..Xn,Y1,..Yn)
  • Set B10, and Bn11 (strict lex), Bn1 in 0,1
    (lex)
  • SLIDE(C,X1..Xn,Y1,..Yn,B1,..Bn1) holds iff
    C(Xi,Yi,Bi,Bi1) holds for each i

12
SLIDE down multiple sequences
  • Can SLIDE down more than one sequence at a time
  • LEX(X1,..Xn,Y1,..Yn)
  • Set B10, and Bn11 (strict lex), Bn1 in 0,1
    (lex)
  • SLIDE(C,X1..Xn,Y1,..Yn,B1,..Bn1)
  • C(Xi,Yi,Bi,Bi1) holds iff Bi1 or (BiBi10 and
    XiYi) or (Bi0, Bi11 and XiltYi)

13
SLIDE down multiple sequences
  • Can SLIDE down more than one sequence at a time
  • LEX(X1,..Xn,Y1,..Yn)
  • Set B10, and Bn11 (strict lex), Bn1 in 0,1
    (lex)
  • SLIDE(C,X1..Xn,Y1,..Yn,B1,..Bn1)
  • C(Xi,Yi,Bi,Bi1) holds iff Bi1 or (BiBi10 and
    XiYi) or (Bi0, Bi11 and XiltYi)
  • Highly efficient, incremental, ..

14
SLIDE down multiple sequences
  • CONTIGUITY(X1,..Xn)
  • 001100
  • Two simple SLIDEs

15
SLIDE down multiple sequences
  • CONTIGUITY(X1,..Xn)
  • 001100
  • Two simple SLIDEs
  • Introduce Yi in 0,1,2
  • SLIDE(gt,Y1,..Yn)

16
SLIDE down multiple sequences
  • CONTIGUITY(X1,..Xn)
  • 001100
  • Two simple SLIDEs
  • Introduce Yi in 0,1,2
  • SLIDE(gt,Y1,..Yn)
  • SLIDE(C,X1,..Xn,Y1,..Yn) where C(Xi,Yi) holds
    iff Xi1 lt-gt Yi1

17
SLIDE down multiple sequences
  • REGULAR(Q,X1,..Xn)
  • X1 .. Xn is a string accepted by FDA Q
  • Encodes into simple SLIDE
  • Introduce Yi to represent state of the automaton
    after i symbols

18
SLIDE down multiple sequences
  • REGULAR(Q,X1,..Xn)
  • X1 .. Xn is a string accepted by FDA Q
  • Introduce Yi to represent state of the automaton
    after i symbols
  • SLIDE(C,X1,..Xn,Y1,..Yn1) where
  • Y1 is starting state of Q
  • Yn1 is limited to accepting states of Q
  • C(Xi,Yi,Yi1) holds iff Q moves from state Yi to
    state Yi1 on seeing Xi

19
SLIDE down multiple sequences
  • REGULAR(A,X1,..Xn)
  • X1 .. Xn is a string accepted by FDA A
  • Introduce Qi to represent state of the automaton
    after i symbols
  • SLIDE(C,X1,..Xn,Q1,..Qn1) where
  • Y1 is starting state of A
  • Yn1 is limited to accepting states of A
  • C(Xi,Qi,Qi1) holds iff A moves from state Qi to
    state Qi1 on seeing Xi
  • Gives highly efficient and effective propagator!

20
SLIDE with counters
  • AMONG(X1,..Xn,v,N)
  • Introduce sequence of counts, Yi
  • SLIDE(C,X1,..Xn,Y1,..Yn1) where
  • Y10, Yn1N
  • C(Xi,Yi,Yi1) holds iff (Xi in v and Yi11Yi)
    or (Xi not in v and Yi1Yi)

21
SLIDE with counters
  • CARD PATH
  • SLIDE is a special case of CARD PATH
  • SLIDE(C,X1,..Xn) iff CARD PATH(C,X1,..Xn,n-k1
    )

22
SLIDE with counters
  • CARD PATH
  • SLIDE is a special case of CARD PATH
  • SLIDE(C,X1,..Xn) iff CARD PATH(C,X1,..Xn,n-k1
    )
  • CARD PATH is a special case of SLIDE
  • SLIDE(D,X1,..Xn,Y1,..Yn1) where
  • Y10, Yn1N, and
  • D(Xi,..Xik,Yi,Yi1) holds iff
  • (Yi11Yi and C(Xi,..Xik)) or
  • (Yi1Yi and not C(Xi,..Xik))

23
SLIDE with parameters
  • Slide constraints may share parameters
  • LINKSET2BOOLEANS(S,X1,..Xn)
  • Converts set variable into characteristic
    function
  • Encodes as SLIDE(C,X1,..Xn) where
  • C(S,Xi) holds iff Xi in S
  • S is parameter common to each slide constraint

24
SLIDE over sets
  • Value precedence for set vars
  • PRECENDCE(vj,vk,S1,..Sn) holds iff
  • min(i,i vj in Si and vk not in Si or in1) lt
  • min(i,i vk in Si and vj not in Si or in2)

25
SLIDE over sets
  • Value precedence for set vars
  • PRECENDCE(vj,vk,S1,..Sn) holds iff
  • min(i,i vj in Si and vk not in Si or in1) lt
  • min(i,i vk in Si and vj not in Si or in2)
  • Introduce sequence of Booleans to indicate
    whether vars have been distinguished apart yet or
    not

26
SLIDE over sets
  • Value precedence for set vars
  • PRECENDCE(vj,vk,S1,..Sn) holds iff
  • min(i,i vj in Si and vk not in Si or in1) lt
  • min(i,i vk in Si and vj not in Si or in2)
  • SLIDE(C,S1,..Sn,B1,..Bn1) where
  • B10 and
  • C(Si,Bi,Bi1) holds iff
  • BiBi11,
  • or BiBi10 and (vj, vk in Si or vj, vk not
    in Si), or Bi0, Bi11, vj in Si and vk not in Si

27
SLIDE over sets
  • Open stacks problem
  • IJCAI 05 modelling challenge
  • Three SLIDEs and one ALL DIFFERENT
  • First SLIDE Si1 Si u customer(Xi)
  • Second SLIDE Ti-1 Ti u customer(Xi)
  • Third SLIDE Si intersect Ti lt OpenStacks

28
Circular SLIDE
  • STRETCH used in shift rostering
  • Given sequence of vars X1,.. Xn
  • Each stretch of identical values a occurs at
    least shortest(a) and at most longest(a) time
  • For example, at least 0 and at most 3 night
    shifts in a row
  • Each transition Xi/Xi1 is limited to given
    patterns
  • For example, only Xinight, Xi1off is permitted

29
Circular SLIDE
  • STRETCH can be efficiently encoded using SLIDE
  • SLIDE(C,X1,..Xn,Y1,..Yn1) where
  • Y11
  • C(Xi,Xi1,Yi,Yi1) holds iff
  • XiXi1, Yi11Yi, Yi1ltlongest(Xi),
  • or Xi/Xi1, Yigtshortest(Xi) and (Xi,Xi1) in
    set of permitted changes

30
Circular SLIDE
  • Circular forms of STRETCH are needed for
    repeating shift patterns
  • Circular form of SLIDE useful in such situations
  • SLIDEo(C,X1,..Xn) holds iff
  • C(Xi,..X1(ik-1)mod n) holds for 1ltiltn

31
SLIDE algebra
  • SLIDEOR(C,X1..Xn) holds iff
  • C(Xi,..Xik) holds for some I
  • Encodes as CARD PATH (and thus as SLIDE)
  • Other more complex combinations
  • NOT(SLIDE(C,X1,..Xn)) iff SLIDEOR(C,X1,..Xn)
  • SLIDE(C1,X1,..Xn) and SLIDE(C2,X1,..Xn) iff
    SLIDE(C1 and C2,X1,..Xn)
  • ..

32
Propagating SLIDE
  • But how do we propagate global constraints
    expressed using SLIDE?

33
Propagating SLIDE
  • SLIDE(C,X1,..Xn)
  • Just post sequence of constraints, C(Xi,..Xik)
  • If constraint graph is Berge acyclic, then we
    will achieve GAC
  • Gives efficient GAC propagators for CONTIGUITY,
    DOMAIN, ELEMENT, LEX, PRECEDENCE, REGULAR,

34
Propagating SLIDE
  • SLIDE(C,X1,..Xn)
  • Just post sequence of constraints, C(Xi,..Xik)
  • If constraint graph is Berge acyclic, then we
    will achieve GAC
  • Gives efficient GAC propagators for CONTIGUITY,
    DOMAIN, ELEMENT, LEX, PRECEDENCE, REGULAR,
  • But what about case constraint graph is not
    Berge-acyclic?
  • Slide constraints overlap on more than one
    variable

35
Propagating SLIDE
  • SLIDE(C,X1,..Xn)
  • Slide constraints overlap on more than one
    variable
  • Enforce GAC using dynamic programming
  • pass support down sequence

36
Propagating SLIDE
  • SLIDE(C,X1,..Xn)
  • Equivalently a dual encoding
  • Consider AMONG SEQ(2,2,3,X1,..X5,a) where
  • X1a, X2,X3,X4,X5 in a,b
  • AMONG(X1,X2,X3,2,a)
  • AMONG(X2,X3,X4,2,a)
  • AMONG(X3,X4,X5,2,a)
  • Enforcing GAC sets X4a
  • GAC can be enforced in O(ndk1) time and O(ndk)
    space where constraints overlap on k variables
  • Fixed parameter tractable

37
Conclusions
  • SLIDE is a very useful meta-constraint
  • Many global constraints for sequencing and other
    problems can be encoded as SLIDE
  • SLIDE can be propagated easily
  • Constraints overlap on just one variable gt
    simply post slide constraints
  • Constraints overlap on more than one variable gt
    use dynamic programming or equivalently a simple
    dual encoding
Write a Comment
User Comments (0)
About PowerShow.com