An optimal Arc Consistency algorithm for a chain of Atmost - - PowerPoint PPT Presentation

an optimal arc consistency algorithm for a chain of
SMART_READER_LITE
LIVE PREVIEW

An optimal Arc Consistency algorithm for a chain of Atmost - - PowerPoint PPT Presentation

The AtMostSeqCard constraint Filtering the domains Experimental results LAAS-CNRS Conclusion & Future work An optimal Arc Consistency algorithm for a chain of Atmost constraints with cardinality Mohamed Siala , Emmanuel Hebrard, and


slide-1
SLIDE 1

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

An optimal Arc Consistency algorithm for a chain

  • f Atmost constraints with cardinality

Mohamed Siala , Emmanuel Hebrard, and Marie-Jos´ e Huguet Toulouse, France

Mohamed SIALA October 2012 CP 2012 1 / 23

slide-2
SLIDE 2

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Outline

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

Mohamed SIALA October 2012 CP 2012 2 / 23

slide-3
SLIDE 3

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Definition

AtMostSeqCard(u, q, d, [x1, . . . , xn]) ⇔

n−q

  • i=0

(

q

  • l=1

xi+l ≤ u) ∧ (

n

  • i=1

xi = d)

Mohamed SIALA October 2012 CP 2012 3 / 23

slide-4
SLIDE 4

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Definition

AtMostSeqCard(u, q, d, [x1, . . . , xn]) ⇔

n−q

  • i=0

(

q

  • l=1

xi+l ≤ u) ∧ (

n

  • i=1

xi = d)

Example AtMostSeqCard(2, 4, 4, [x1, . . . , x7])

1 1 1 1 — — — — — — — — — — — — — — — — 1 1 1 1 — — — — — — — — — — — — — — — —

Mohamed SIALA October 2012 CP 2012 3 / 23

slide-5
SLIDE 5

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Context

Sequence Constraints

  • Let [x1, . . . , xn] be a sequence of integer variables.

Mohamed SIALA October 2012 CP 2012 4 / 23

slide-6
SLIDE 6

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Context

Sequence Constraints

  • Let [x1, . . . , xn] be a sequence of integer variables.
  • The Among constraint ensures that the number of
  • ccurrences of values in {v1..vk} in a subsequence

[xi1, . . . , xiq] is bounded between l and u.

Mohamed SIALA October 2012 CP 2012 4 / 23

slide-7
SLIDE 7

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Context

Sequence Constraints

  • Let [x1, . . . , xn] be a sequence of integer variables.
  • The Among constraint ensures that the number of
  • ccurrences of values in {v1..vk} in a subsequence

[xi1, . . . , xiq] is bounded between l and u.

  • AmongSeq : the conjunction of all n − q + 1 Among on q

consecutive variables (i.e. n−q

i=0 Among([xi+1, . . . , xi+q])).

Mohamed SIALA October 2012 CP 2012 4 / 23

slide-8
SLIDE 8

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Context

Sequence Constraints

  • Let [x1, . . . , xn] be a sequence of integer variables.
  • The Among constraint ensures that the number of
  • ccurrences of values in {v1..vk} in a subsequence

[xi1, . . . , xiq] is bounded between l and u.

  • AmongSeq : the conjunction of all n − q + 1 Among on q

consecutive variables (i.e. n−q

i=0 Among([xi+1, . . . , xi+q])).

  • Gen-Sequence: Conjunction of (consecutive) Among

Mohamed SIALA October 2012 CP 2012 4 / 23

slide-9
SLIDE 9

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Context

Sequence Constraints

  • Let [x1, . . . , xn] be a sequence of integer variables.
  • The Among constraint ensures that the number of
  • ccurrences of values in {v1..vk} in a subsequence

[xi1, . . . , xiq] is bounded between l and u.

  • AmongSeq : the conjunction of all n − q + 1 Among on q

consecutive variables (i.e. n−q

i=0 Among([xi+1, . . . , xi+q])).

  • Gen-Sequence: Conjunction of (consecutive) Among
  • AtMostSeqCard ≡ AmongSeq ⊕ a cardinality constraint

Mohamed SIALA October 2012 CP 2012 4 / 23

slide-10
SLIDE 10

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Context

Sequence Constraints

  • Let [x1, . . . , xn] be a sequence of integer variables.
  • The Among constraint ensures that the number of
  • ccurrences of values in {v1..vk} in a subsequence

[xi1, . . . , xiq] is bounded between l and u.

  • AmongSeq : the conjunction of all n − q + 1 Among on q

consecutive variables (i.e. n−q

i=0 Among([xi+1, . . . , xi+q])).

  • Gen-Sequence: Conjunction of (consecutive) Among
  • AtMostSeqCard ≡ AmongSeq ⊕ a cardinality constraint

→ AtMostSeqCard can be encoded with a Gen-Sequence

Mohamed SIALA October 2012 CP 2012 4 / 23

slide-11
SLIDE 11

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Context

Sequence Constraints

  • Let [x1, . . . , xn] be a sequence of integer variables.
  • The Among constraint ensures that the number of
  • ccurrences of values in {v1..vk} in a subsequence

[xi1, . . . , xiq] is bounded between l and u.

  • AmongSeq : the conjunction of all n − q + 1 Among on q

consecutive variables (i.e. n−q

i=0 Among([xi+1, . . . , xi+q])).

  • Gen-Sequence: Conjunction of (consecutive) Among
  • AtMostSeqCard ≡ AmongSeq ⊕ a cardinality constraint

→ AtMostSeqCard can be encoded with a Gen-Sequence → AtMostSeqCard can be encoded with a Global Sequencing Constraint (Gsc)

Mohamed SIALA October 2012 CP 2012 4 / 23

slide-12
SLIDE 12

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Existing complexities

Gen-Sequence

  • cost-Regular encoding: O(2qn) [Van Hoeve et al, 2009]
  • Gen-Sequence: O(n3) [Van Hoeve et al, 2009]
  • Flow-based Algorithm: O(n2) [Maher et al, 2008]

Gsc

  • Gcc encoding, Not AC, NP-Hard [Puget and R´

egin, 1997]

Mohamed SIALA October 2012 CP 2012 5 / 23

slide-13
SLIDE 13

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Why the AtMostSeqCard constraint? [1]

Figure: The car-sequencing problem

Mohamed SIALA October 2012 CP 2012 6 / 23

slide-14
SLIDE 14

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Why the AtMostSeqCard constraint? [2]

7 days, 4 employees, 3 periods, 40h per week, Atmost(1,3)

D E N D E N D E N D E N D E N D E N D E N d emp1 1 1 1 1 1 5 emp2 1 1 1 1 1 5 emp3 1 1 1 1 1 5 emp4 1 1 1 1 1 5

Table: Crew-rostering problem

Mohamed SIALA October 2012 CP 2012 7 / 23

slide-15
SLIDE 15

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

The proposed algorithm

  • Let (x1, . . . , xn) be a boolean sequence subject to

AtMostSeqCard(u, q, d, [x1, . . . , xn])

  • Our filtering algorithm is based on a greedy procedure

(denoted by leftmost).

  • leftmost: computes an assignment w maximizing the

cardinality of the sequence with respect to the AtMost constraints.

Mohamed SIALA October 2012 CP 2012 8 / 23

slide-16
SLIDE 16

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . . 1 1 . . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-17
SLIDE 17

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 → . — . 1 1 . . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-18
SLIDE 18

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 → . — — . 1 1 . . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-19
SLIDE 19

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 → . — — . — 1 1 . . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-20
SLIDE 20

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 → . — 1 — . — 1 — 1 . . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-21
SLIDE 21

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 . 1 1 . . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-22
SLIDE 22

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 . 1 1 . . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-23
SLIDE 23

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . — 1 1 1 → — 1 . 1 1 . . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-24
SLIDE 24

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . — 1 1 1 → — 1 1 . — 1 1 . . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-25
SLIDE 25

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . — 1 1 1 → — 1 1 2 . — 1 — 1 . . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-26
SLIDE 26

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 → — 1 1 2 1 . — 1 — 1 . — . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-27
SLIDE 27

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 1 1 2 1 2 . 1 1 . . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-28
SLIDE 28

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 1 1 2 1 2 . 1 1 . . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-29
SLIDE 29

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . — 1 1 1 — 1 1 2 1 2 → . — 1 1 1 . . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-30
SLIDE 30

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . — 1 1 1 — 1 1 2 1 2 → . — 1 2 1 — 1 . . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-31
SLIDE 31

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 — 1 1 2 1 2 → . — 1 2 1 1 — 1 . — . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-32
SLIDE 32

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 1 1 2 1 2 → . — 1 2 1 1 1 — 1 . — . — . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-33
SLIDE 33

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 1 1 2 1 2 . 1 2 1 1 2 1 1 . . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-34
SLIDE 34

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 1 1 2 1 2 . 1 2 1 1 2 1 1 . . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-35
SLIDE 35

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . — 1 1 1 — 1 1 2 1 2 . — 1 2 1 1 2 → 1 — 1 2 . . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-36
SLIDE 36

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 — 1 1 2 1 2 . — 1 2 1 1 2 → 1 — 1 2 1 . — . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-37
SLIDE 37

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 1 1 2 1 2 . — 1 2 1 1 2 → 1 — 1 2 1 1 . — . — . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-38
SLIDE 38

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 1 1 2 1 2 . 1 2 1 1 2 → 1 — 1 2 1 1 1 . — . — . — . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-39
SLIDE 39

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 1 1 2 1 2 . 1 2 1 1 2 1 1 2 1 1 1 2 . . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-40
SLIDE 40

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 1 1 2 1 2 . 1 2 1 1 2 1 1 2 1 1 1 2 . . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-41
SLIDE 41

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 — 1 1 2 1 2 . — 1 2 1 1 2 1 — 1 2 1 1 1 2 → . — 1 . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-42
SLIDE 42

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 1 1 2 1 2 . — 1 2 1 1 2 1 — 1 2 1 1 1 2 → . — 1 1 . — . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-43
SLIDE 43

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 1 1 2 1 2 . 1 2 1 1 2 1 — 1 2 1 1 1 2 → . — 1 1 1 . — . — . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-44
SLIDE 44

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 1 1 2 1 2 . 1 2 1 1 2 1 1 2 1 1 1 2 → . — 1 1 1 . — . — — . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-45
SLIDE 45

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 1 1 2 1 2 . 1 2 1 1 2 1 1 2 1 1 1 2 . 1 1 1 1 . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-46
SLIDE 46

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 1 1 2 1 2 . 1 2 1 1 2 1 1 2 1 1 1 2 . 1 1 1 1 1 . . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-47
SLIDE 47

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 1 1 2 1 2 . — 1 2 1 1 2 1 — 1 2 1 1 1 2 . — 1 1 1 1 1 → . — 2 . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-48
SLIDE 48

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 1 1 2 1 2 . 1 2 1 1 2 1 — 1 2 1 1 1 2 . — 1 1 1 1 1 → . — 2 2 . — . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-49
SLIDE 49

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 1 1 2 1 2 . 1 2 1 1 2 1 1 2 1 1 1 2 . — 1 1 1 1 1 → . — 2 2 1 . — — . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-50
SLIDE 50

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 1 1 2 1 2 . 1 2 1 1 2 1 1 2 1 1 1 2 . 1 1 1 1 1 → . — 2 2 1 . — — . — 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-51
SLIDE 51

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 1 1 2 1 2 . 1 2 1 1 2 1 1 2 1 1 1 2 . 1 1 1 1 1 . 2 2 1 2 . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-52
SLIDE 52

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 1 1 2 1 2 . 1 2 1 1 2 1 1 2 1 1 1 2 . 1 1 1 1 1 . 2 2 1 2 . . 1 1 . . 1 1 . .

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-53
SLIDE 53

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 1 1 2 1 2 . 1 2 1 1 2 1 1 2 1 1 1 2 . 1 1 1 1 1 . 2 2 1 2 . 2 1 2 1 1 1 . 1 1 1 1 2 2 1 2 1 1 2 2 1 2 2 . 2 1 2 1 2 . 1 2 1 1 2 1 1 2 1 1 1 2 . 1 1 1 1 1 . 2 2 1 2

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-54
SLIDE 54

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

− → w = leftmost (u = 2, q = 4)

xi w c max 1 2 3 4 . 1 1 1 1 1 2 1 2 . 1 2 1 1 2 1 1 2 1 1 1 2 . 1 1 1 1 1 . 2 2 1 2 . 2 1 2 1 1 1 . 1 1 1 1 2 2 1 2 1 1 2 2 1 2 2 . 2 1 2 1 2 . 1 2 1 1 2 1 1 2 1 1 1 2 . 1 1 1 1 1 . 2 2 1 2

→ Complexity = O(n.q)

Mohamed SIALA October 2012 CP 2012 9 / 23

slide-55
SLIDE 55

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

leftmost count

  • leftmost count([x1, . . . , xn], u, q, d): a linear time

implementation of leftmost but returning the maximum cardinality that we can add to the sequence until i.

Mohamed SIALA October 2012 CP 2012 10 / 23

slide-56
SLIDE 56

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

leftmost count

  • leftmost count([x1, . . . , xn], u, q, d): a linear time

implementation of leftmost but returning the maximum cardinality that we can add to the sequence until i.

  • L (resp. R): the result of leftmost count from left to right

(resp. right to left).

Mohamed SIALA October 2012 CP 2012 10 / 23

slide-57
SLIDE 57

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

leftmost count

  • leftmost count([x1, . . . , xn], u, q, d): a linear time

implementation of leftmost but returning the maximum cardinality that we can add to the sequence until i.

  • L (resp. R): the result of leftmost count from left to right

(resp. right to left).

  • Example:

D(xi ) . 0 . . . . . . 0 1 0 . . . . . . . . . . 1 leftmost[i] 1 0 1 1 1 0 0 0 0 1 0 1 1 1 0 0 0 1 0 1 1 1 leftmost count[i] 0 1 1 2 3 4 4 4 4 4 4 4 5 6 7 7 7 7 8 8 9 10 10 Mohamed SIALA October 2012 CP 2012 10 / 23

slide-58
SLIDE 58

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

leftmost count

  • leftmost count([x1, . . . , xn], u, q, d): a linear time

implementation of leftmost but returning the maximum cardinality that we can add to the sequence until i.

  • L (resp. R): the result of leftmost count from left to right

(resp. right to left).

  • Example:

D(xi ) . 0 . . . . . . 0 1 0 . . . . . . . . . . 1 leftmost[i] 1 0 1 1 1 0 0 0 0 1 0 1 1 1 0 0 0 1 0 1 1 1 leftmost count[i] 0 1 1 2 3 4 4 4 4 4 4 4 5 6 7 7 7 7 8 8 9 10 10

  • O(n) implementation

Mohamed SIALA October 2012 CP 2012 10 / 23

slide-59
SLIDE 59

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

leftmost count

  • leftmost count([x1, . . . , xn], u, q, d): a linear time

implementation of leftmost but returning the maximum cardinality that we can add to the sequence until i.

  • L (resp. R): the result of leftmost count from left to right

(resp. right to left).

  • Example:

D(xi ) . 0 . . . . . . 0 1 0 . . . . . . . . . . 1 leftmost[i] 1 0 1 1 1 0 0 0 0 1 0 1 1 1 0 0 0 1 0 1 1 1 leftmost count[i] 0 1 1 2 3 4 4 4 4 4 4 4 5 6 7 7 7 7 8 8 9 10 10

  • O(n) implementation

c c[1] c[2] c[3] .. c[q] ptr ↑

Mohamed SIALA October 2012 CP 2012 10 / 23

slide-60
SLIDE 60

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

leftmost count

  • leftmost count([x1, . . . , xn], u, q, d): a linear time

implementation of leftmost but returning the maximum cardinality that we can add to the sequence until i.

  • L (resp. R): the result of leftmost count from left to right

(resp. right to left).

  • Example:

D(xi ) . 0 . . . . . . 0 1 0 . . . . . . . . . . 1 leftmost[i] 1 0 1 1 1 0 0 0 0 1 0 1 1 1 0 0 0 1 0 1 1 1 leftmost count[i] 0 1 1 2 3 4 4 4 4 4 4 4 5 6 7 7 7 7 8 8 9 10 10

  • O(n) implementation

c c[1] c[2] c[3] .. c[q] ptr ↑

Mohamed SIALA October 2012 CP 2012 10 / 23

slide-61
SLIDE 61

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

leftmost count

  • leftmost count([x1, . . . , xn], u, q, d): a linear time

implementation of leftmost but returning the maximum cardinality that we can add to the sequence until i.

  • L (resp. R): the result of leftmost count from left to right

(resp. right to left).

  • Example:

D(xi ) . 0 . . . . . . 0 1 0 . . . . . . . . . . 1 leftmost[i] 1 0 1 1 1 0 0 0 0 1 0 1 1 1 0 0 0 1 0 1 1 1 leftmost count[i] 0 1 1 2 3 4 4 4 4 4 4 4 5 6 7 7 7 7 8 8 9 10 10

  • O(n) implementation

c c[1] c[2] c[3] .. c[q] ptr ↑ ..

Mohamed SIALA October 2012 CP 2012 10 / 23

slide-62
SLIDE 62

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

leftmost count

  • leftmost count([x1, . . . , xn], u, q, d): a linear time

implementation of leftmost but returning the maximum cardinality that we can add to the sequence until i.

  • L (resp. R): the result of leftmost count from left to right

(resp. right to left).

  • Example:

D(xi ) . 0 . . . . . . 0 1 0 . . . . . . . . . . 1 leftmost[i] 1 0 1 1 1 0 0 0 0 1 0 1 1 1 0 0 0 1 0 1 1 1 leftmost count[i] 0 1 1 2 3 4 4 4 4 4 4 4 5 6 7 7 7 7 8 8 9 10 10

  • O(n) implementation

c c[1] c[2] c[3] .. c[q] ptr

Mohamed SIALA October 2012 CP 2012 10 / 23

slide-63
SLIDE 63

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

The Arc consistency algorithm

Mohamed SIALA October 2012 CP 2012 11 / 23

slide-64
SLIDE 64

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

The Arc consistency algorithm

leftmost count from left to right :

L[n] < ub L[n] > ub L[n] = ub

Fail Nothing to do

leftmost count from right to left :

L[i] + R[n − i + 1] ≤ ub L[i − 1] + R[n − i] < ub

D(xi) = {0} D(xi) = {1} L[i] R[i]

Mohamed SIALA October 2012 CP 2012 11 / 23

slide-65
SLIDE 65

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

The Arc consistency algorithm

leftmost count from left to right :

L[n] < ub L[n] > ub L[n] = ub

Fail Nothing to do

leftmost count from right to left :

L[i] + R[n − i + 1] ≤ ub L[i − 1] + R[n − i] < ub

D(xi) = {0} D(xi) = {1} L[i] R[i]

→ Complexity = O(n)

Mohamed SIALA October 2012 CP 2012 11 / 23

slide-66
SLIDE 66

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

AC(u = 4, q = 8, d = 12, ub = 10)

D(xi ) . . . . . . . 1 . . . . . . . . . . 1 Mohamed SIALA October 2012 CP 2012 12 / 23

slide-67
SLIDE 67

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

AC(u = 4, q = 8, d = 12, ub = 10)

D(xi ) . . . . . . . 1 . . . . . . . . . . 1 − → w [i] 1 1 1 1 1 1 1 1 1 1 1 1 Mohamed SIALA October 2012 CP 2012 12 / 23

slide-68
SLIDE 68

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

AC(u = 4, q = 8, d = 12, ub = 10)

D(xi ) . . . . . . . 1 . . . . . . . . . . 1 − → w [i] 1 1 1 1 1 1 1 1 1 1 1 1 ← − w [i] 1 1 1 1 1 1 1 1 1 1 1 1 Mohamed SIALA October 2012 CP 2012 12 / 23

slide-69
SLIDE 69

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

AC(u = 4, q = 8, d = 12, ub = 10)

D(xi ) . . . . . . . 1 . . . . . . . . . . 1 − → w [i] 1 1 1 1 1 1 1 1 1 1 1 1 ← − w [i] 1 1 1 1 1 1 1 1 1 1 1 1 L[i] 1 1 2 3 4 4 4 4 4 4 4 5 6 7 7 7 7 8 8 9 10 10 Mohamed SIALA October 2012 CP 2012 12 / 23

slide-70
SLIDE 70

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

AC(u = 4, q = 8, d = 12, ub = 10)

D(xi ) . . . . . . . 1 . . . . . . . . . . 1 − → w [i] 1 1 1 1 1 1 1 1 1 1 1 1 ← − w [i] 1 1 1 1 1 1 1 1 1 1 1 1 L[i] 1 1 2 3 4 4 4 4 4 4 4 5 6 7 7 7 7 8 8 9 10 10 R[n − i + 1] 10 9 9 9 8 7 6 6 6 6 6 6 5 4 3 3 3 3 3 2 1 Mohamed SIALA October 2012 CP 2012 12 / 23

slide-71
SLIDE 71

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

AC(u = 4, q = 8, d = 12, ub = 10)

D(xi ) . . . . . . . 1 . . . . . . . . . . 1 − → w [i] 1 1 1 1 1 1 1 1 1 1 1 1 ← − w [i] 1 1 1 1 1 1 1 1 1 1 1 1 L[i] 1 1 2 3 4 4 4 4 4 4 4 5 6 7 7 7 7 8 8 9 10 10 R[n − i + 1] 10 9 9 9 8 7 6 6 6 6 6 6 5 4 3 3 3 3 3 2 1 L[i] + R[n − i + 1] 11 10 11 12 12 11 10 10 10 10 10 11 11 11 10 10 10 11 11 11 11 10 Mohamed SIALA October 2012 CP 2012 12 / 23

slide-72
SLIDE 72

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

AC(u = 4, q = 8, d = 12, ub = 10)

D(xi ) . . . . . . . 1 . . . . . . . . . . 1 − → w [i] 1 1 1 1 1 1 1 1 1 1 1 1 ← − w [i] 1 1 1 1 1 1 1 1 1 1 1 1 L[i] 1 1 2 3 4 4 4 4 4 4 4 5 6 7 7 7 7 8 8 9 10 10 R[n − i + 1] 10 9 9 9 8 7 6 6 6 6 6 6 5 4 3 3 3 3 3 2 1 L[i] + R[n − i + 1] 11 10 11 12 12 11 10 10 10 10 10 11 11 11 10 10 10 11 11 11 11 10 L[i − 1] + R[n − i] 9 10 10 10 10 10 10 10 10 10 10 9 9 9 10 10 10 10 10 9 9 10 Mohamed SIALA October 2012 CP 2012 12 / 23

slide-73
SLIDE 73

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

AC(u = 4, q = 8, d = 12, ub = 10)

D(xi ) . . . . . . . 1 . . . . . . . . . . 1 − → w [i] 1 1 1 1 1 1 1 1 1 1 1 1 ← − w [i] 1 1 1 1 1 1 1 1 1 1 1 1 L[i] 1 1 2 3 4 4 4 4 4 4 4 5 6 7 7 7 7 8 8 9 10 10 R[n − i + 1] 10 9 9 9 8 7 6 6 6 6 6 6 5 4 3 3 3 3 3 2 1 L[i] + R[n − i + 1] 11 10 11 12 12 11 10 10 10 10 10 11 11 11 10 10 10 11 11 11 11 10 L[i − 1] + R[n − i] 9 10 10 10 10 10 10 10 10 10 10 9 9 9 10 10 10 10 10 9 9 10 ac(D(xi )) 1 . . . . 1 1 1 1 . . 1 1 1 Mohamed SIALA October 2012 CP 2012 12 / 23

slide-74
SLIDE 74

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

AC(u = 4, q = 8, d = 12, ub = 10)

D(xi ) . . . . . . . 1 . . . . . . . . . . 1 − → w [i] 1 1 1 1 1 1 1 1 1 1 1 1 ← − w [i] 1 1 1 1 1 1 1 1 1 1 1 1 L[i] 1 1 2 3 4 4 4 4 4 4 4 5 6 7 7 7 7 8 8 9 10 10 R[n − i + 1] 10 9 9 9 8 7 6 6 6 6 6 6 5 4 3 3 3 3 3 2 1 L[i] + R[n − i + 1] 11 10 11 12 12 11 10 10 10 10 10 11 11 11 10 10 10 11 11 11 11 10 L[i − 1] + R[n − i] 9 10 10 10 10 10 10 10 10 10 10 9 9 9 10 10 10 10 10 9 9 10 ac(D(xi )) 1 . . . . 1 1 1 1 . . 1 1 1 Mohamed SIALA October 2012 CP 2012 12 / 23

slide-75
SLIDE 75

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Car-sequencing

Constraints

  • Each class c is associated with a demand Dc.
  • For each option j, each sub-sequence of size qj must contain

at most uj cars requiring the option j.

Mohamed SIALA October 2012 CP 2012 13 / 23

slide-76
SLIDE 76

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Models

1 sum 2 gsc 3 amsc 4 amcs + gsc

Heuristics

{lex, mid}, {class, opt}, {1, q/u, d, δ, n − σ, ρ}, {≤, ≤Euc, ≤lex}. → 34 heuristics x 5 randomized tests.

Benchmarks (CSP Lib)

  • Groupe 1: 70 satisfiable instances
  • Groupe 2: 4 satisfiable instances
  • Groupe 3: 5 unsatisfiable instances
  • Groupe 4: 7 satisfiable instances

Mohamed SIALA October 2012 CP 2012 14 / 23

slide-77
SLIDE 77

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Experimental results

Table: Experimental results : Car-sequencing

Models G1 (70 × 34 × 5) G2 (4 × 34 × 5) G3 (5 × 34 × 5) G4 (7 × 34 × 5) 11900 680 850 1190 #sol time #sol time #sol time #sol time sum 8480 13.93 95 76.60 > 1200 64 43.81 gsc 11218 3.60 325 110.99 31 276.06 140 56.61 amsc 10702 4.43 360 72.00 16 8.62 153 33.56 amsc+gsc 11243 3.43 339 106.53 32 285.43 147 66.45 Mohamed SIALA October 2012 CP 2012 15 / 23

slide-78
SLIDE 78

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Experimental results

Table: Experimental results : Car-sequencing

Models G1 (70 × 34 × 5) G2 (4 × 34 × 5) G3 (5 × 34 × 5) G4 (7 × 34 × 5) 11900 680 850 1190 #sol time #sol time #sol time #sol time sum 8480 13.93 95 76.60 > 1200 64 43.81 gsc 11218 3.60 325 110.99 31 276.06 140 56.61 amsc 10702 4.43 360 72.00 16 8.62 153 33.56 amsc+gsc 11243 3.43 339 106.53 32 285.43 147 66.45

  • The level of filtering obtained by enforcing AC on the

AtMostSeqCard constraint is incomparable with that of the Gcc encoding of the Gsc constraint

Mohamed SIALA October 2012 CP 2012 15 / 23

slide-79
SLIDE 79

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Experimental results

Table: Experimental results : Car-sequencing

Models G1 (70 × 34 × 5) G2 (4 × 34 × 5) G3 (5 × 34 × 5) G4 (7 × 34 × 5) 11900 680 850 1190 #sol time #sol time #sol time #sol time sum 8480 13.93 95 76.60 > 1200 64 43.81 gsc 11218 3.60 325 110.99 31 276.06 140 56.61 amsc 10702 4.43 360 72.00 16 8.62 153 33.56 amsc+gsc 11243 3.43 339 106.53 32 285.43 147 66.45

  • The level of filtering obtained by enforcing AC on the

AtMostSeqCard constraint is incomparable with that of the Gcc encoding of the Gsc constraint

  • The Gsc propagator seems to save more backtracks than

AtMostSeqCard.

Mohamed SIALA October 2012 CP 2012 15 / 23

slide-80
SLIDE 80

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Experimental results

Table: Experimental results : Car-sequencing

Models G1 (70 × 34 × 5) G2 (4 × 34 × 5) G3 (5 × 34 × 5) G4 (7 × 34 × 5) 11900 680 850 1190 #sol time #sol time #sol time #sol time sum 8480 13.93 95 76.60 > 1200 64 43.81 gsc 11218 3.60 325 110.99 31 276.06 140 56.61 amsc 10702 4.43 360 72.00 16 8.62 153 33.56 amsc+gsc 11243 3.43 339 106.53 32 285.43 147 66.45

  • The level of filtering obtained by enforcing AC on the

AtMostSeqCard constraint is incomparable with that of the Gcc encoding of the Gsc constraint

  • The Gsc propagator seems to save more backtracks than

AtMostSeqCard.

  • However, it’s much slower than AtMostSeqCard (overall a

factor of 12.5 on the number of nodes explored per second!)

Mohamed SIALA October 2012 CP 2012 15 / 23

slide-81
SLIDE 81

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Crew-rostering

Week 1 W 2 W 3 W 4 d emp1

  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -

17 emp2

  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -

.. .. .. 17 ..

  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -

.. .. .. 17 emp20

  • - -
  • - -
  • - -
  • - -
  • - -
  • - -
  • - -

.. .. .. 17 demande: 6;6;3 6;6;3 6;6;3 6;6;3 6;6;3 2;2;1 2;2;1 .. .. .. 17*20

Constraints

  • A required demand for each period.
  • Each employee has to work 34 hours per week (17 shifts
  • verall).
  • Atmost 8h working shift per day.
  • Atmost 5 days per week.

Mohamed SIALA October 2012 CP 2012 16 / 23

slide-82
SLIDE 82

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Models

  • sum
  • gsc
  • amsc

Heuristics

  • worst employee: MIN(σi = ni − 21di

5 ), MIN(σ′ j = mj − ds j ).

  • worst shift: MIN(σ′

j = mj − ds j ), MIN(σi = ni − 21di 5 )

Benchmarks

  • 281 instances with different employee unavailabilities (ranging

from from 18% to 46% by increment of 0.1).

  • Set 1: 126 sat instances.
  • Set 2: 111 instances (mostly sat).
  • Set 3: 44 instances (mostly unsat).

Mohamed SIALA October 2012 CP 2012 17 / 23

slide-83
SLIDE 83

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Experimental results

Table: Experimental results: Crew-Rostering

Benchmarks G1 (5 × 2 × 126) G2 (5 × 2 × 111) G3 (5 × 2 × 44) 1260 1110 440 #sol time #sol time #sol time sum 1229 12.72 574 38.45 272 5.56 gsc 1210 29.19 579 77.78 276 24.14 amsc 1237 5.82 670 31.01 284 6.22 Mohamed SIALA October 2012 CP 2012 18 / 23

slide-84
SLIDE 84

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Experimental results

Table: Experimental results: Crew-Rostering

Benchmarks G1 (5 × 2 × 126) G2 (5 × 2 × 111) G3 (5 × 2 × 44) 1260 1110 440 #sol time #sol time #sol time sum 1229 12.72 574 38.45 272 5.56 gsc 1210 29.19 579 77.78 276 24.14 amsc 1237 5.82 670 31.01 284 6.22

  • By analogy with the car-sequencing, there is one class with
  • ne option for each employee since we treat boolean variables.

Mohamed SIALA October 2012 CP 2012 18 / 23

slide-85
SLIDE 85

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Experimental results

Table: Experimental results: Crew-Rostering

Benchmarks G1 (5 × 2 × 126) G2 (5 × 2 × 111) G3 (5 × 2 × 44) 1260 1110 440 #sol time #sol time #sol time sum 1229 12.72 574 38.45 272 5.56 gsc 1210 29.19 579 77.78 276 24.14 amsc 1237 5.82 670 31.01 284 6.22

  • By analogy with the car-sequencing, there is one class with
  • ne option for each employee since we treat boolean variables.
  • The Gsc constraint here is equivalent to the

AtMostSeqCard hence can not do better that our propagator.

Mohamed SIALA October 2012 CP 2012 18 / 23

slide-86
SLIDE 86

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Experimental results

Table: Experimental results: Crew-Rostering

Benchmarks G1 (5 × 2 × 126) G2 (5 × 2 × 111) G3 (5 × 2 × 44) 1260 1110 440 #sol time #sol time #sol time sum 1229 12.72 574 38.45 272 5.56 gsc 1210 29.19 579 77.78 276 24.14 amsc 1237 5.82 670 31.01 284 6.22

  • By analogy with the car-sequencing, there is one class with
  • ne option for each employee since we treat boolean variables.
  • The Gsc constraint here is equivalent to the

AtMostSeqCard hence can not do better that our propagator.

  • AtMostSeqCard is much faster than the Gsc : a factor

20.4 in terms of explored nodes per second!

Mohamed SIALA October 2012 CP 2012 18 / 23

slide-87
SLIDE 87

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Contributions

  • Best existing complexity: O(n2) [Maher et al, 2008].
  • A complete filtering algorithm with a linear time complexity

O(n).

  • Car-sequencing
  • Crew-Rostering

Future work

  • Adapt the filtering rule with more general sequence

constraints.

  • Using the AtMostSeqCard algorithm and more generally

filtering algorithms in a CP-based SMT-Solver.

Mohamed SIALA October 2012 CP 2012 19 / 23

slide-88
SLIDE 88

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Thank you!

Questions?

Mohamed SIALA October 2012 CP 2012 20 / 23

slide-89
SLIDE 89

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Computing the Cardinality of Subsequences

  • When moving one step forward, we get one new subsequence

(and lose another one)

i

Mohamed SIALA October 2012 CP 2012 21 / 23

slide-90
SLIDE 90

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Computing the Cardinality of Subsequences

  • When moving one step forward, we get one new subsequence

(and lose another one)

  • i − 1 mod q points to the first subsequence at step i

i

Mohamed SIALA October 2012 CP 2012 21 / 23

slide-91
SLIDE 91

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Computing the Cardinality of Subsequences

  • When moving one step forward, we get one new subsequence

(and lose another one)

  • i − 1 mod q points to the first subsequence at step i
  • Replace c(i − 1 mod q) by

c(i + q − 1 mod q) + w[i + q] − w[i]

i i + q − 1

Mohamed SIALA October 2012 CP 2012 21 / 23

slide-92
SLIDE 92

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Computing the Cardinality of Subsequences

  • When assigning w[i] to 1, we should increment all

subsequences

  • O(q) operations

Mohamed SIALA October 2012 CP 2012 22 / 23

slide-93
SLIDE 93

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Computing the Cardinality of Subsequences

  • When assigning w[i] to 1, we should increment all

subsequences

  • O(q) operations
  • In the previous formula: only the negative delta
  • w[i + q − 1] is equal to the minimum value in D(xi+q−1)
  • w[i] might be equal to 1 because of an assignment

i i + q − 1

Mohamed SIALA October 2012 CP 2012 22 / 23

slide-94
SLIDE 94

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Computing the Cardinality of Subsequences

  • When assigning w[i] to 1, we should increment all

subsequences

  • O(q) operations
  • In the previous formula: only the negative delta
  • w[i + q − 1] is equal to the minimum value in D(xi+q−1)
  • w[i] might be equal to 1 because of an assignment
  • However, the positive delta is the same for all:

i

l=1(w[l] − min(xl))

  • Cardinality of the jth subsequence:

c[(i + j − 2) mod q] + i

l=1(w[l] − min(xl))

i i + q − 1

Mohamed SIALA October 2012 CP 2012 22 / 23

slide-95
SLIDE 95

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Computing the Maximum Cardinality of any Subsequence

  • Computing the max, or keeping the cardinalities sorted?
  • O(q) operations

Mohamed SIALA October 2012 CP 2012 23 / 23

slide-96
SLIDE 96

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Computing the Maximum Cardinality of any Subsequence

  • Computing the max, or keeping the cardinalities sorted?
  • O(q) operations
  • We keep the number of subsequences of each cardinality
  • Increment all subsequences in O(1)

3 1 2 1 2 3

Mohamed SIALA October 2012 CP 2012 23 / 23

slide-97
SLIDE 97

The AtMostSeqCard constraint Filtering the domains Experimental results Conclusion & Future work

LAAS-CNRS

Computing the Maximum Cardinality of any Subsequence

  • Computing the max, or keeping the cardinalities sorted?
  • O(q) operations
  • We keep the number of subsequences of each cardinality
  • Increment all subsequences in O(1)
  • The maximum cardinality of any subsequence can only change

by 1

  • If the number of subsequences of card MAX(c) becomes 0,

then MAX(c) − 1 is the new maximum

3 1 2 1 2 3

Mohamed SIALA October 2012 CP 2012 23 / 23