filtering for continuous multi-resources · 2013. 1. 9. · icaps08 4 context and contributions...

23
ICAPS08 1 Filtering for Continuous Multi-Resources cumulative Constraint with Resource Consumption - Production Emmanuel Poder 1 - Nicolas Beldiceanu 2 1 [email protected] 2 LINA UMR CNRS 6241, École des Mines de Nantes, France [email protected]

Upload: others

Post on 23-Jan-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Filtering for Continuous Multi-Resources · 2013. 1. 9. · ICAPS08 4 Context and contributions •(Beldiceanu and Poder , CPAIOR - 2007):–Task made of a sequence of positive or

ICAPS08 1

Filtering for Continuous Multi-Resourcescumulative Constraint with Resource

Consumption - Production

Emmanuel Poder1 - Nicolas Beldiceanu2

1 [email protected] LINA UMR CNRS 6241, École des Mines de Nantes, France

[email protected]

Page 2: Filtering for Continuous Multi-Resources · 2013. 1. 9. · ICAPS08 4 Context and contributions •(Beldiceanu and Poder , CPAIOR - 2007):–Task made of a sequence of positive or

ICAPS08 2

Outline

• Context and contributions

• Task model and piecewise linear cumulative cumulatives_pwl

• Filtering a task according to a minimum cumulated profile

– Minimum cumulated resource profile

– Filtering of the resource assignment

– Filtering of the temporal attributes

– Filtering of the heights of the sub-tasks

• Conclusion and perspectives

Page 3: Filtering for Continuous Multi-Resources · 2013. 1. 9. · ICAPS08 4 Context and contributions •(Beldiceanu and Poder , CPAIOR - 2007):–Task made of a sequence of positive or

ICAPS08 3

Context and contributions

Context: cumulative scheduling and producer/consumer model

• (Beldiceanu and Carlsson, CP - 2002):– Positive or negative rectangle task ; Multi-resources– Notions of minimum and maximum cumulated resource profiles– Implemented in SICStus

• (Poder, PhD 2002) (Poder et al., EJOR 2004):– Task made of a sequence of positive trapezoids ; one single resource– Compulsory part and Minimum cumulated profile– Implemented in CHIP (cumulative_trapeze constraint)– -> Main applications: cumulative scheduling, producer/consumer model

• (Sourd and Rogerie, EJOR- 2004): Continuous filling and emptying storage systems– Positive or negative triangular task– Minimum and maximum levels– Implemented in ILOG scheduler

Page 4: Filtering for Continuous Multi-Resources · 2013. 1. 9. · ICAPS08 4 Context and contributions •(Beldiceanu and Poder , CPAIOR - 2007):–Task made of a sequence of positive or

ICAPS08 4

Context and contributions

• (Beldiceanu and Poder , CPAIOR - 2007):– Task made of a sequence of positive or negative trapezoids– Multi-resources– Minimum and maximum cumulated resource profiles build using a

sweep algorithm

Contribution to ICAPS - 2008:

Filtering algorithm for the task model presented in CPAIOR - 2007i.e. given a resource and a task, how to filter

– the temporal attributes of such a task– the resource assignment of such a task

according to the minimum cumulated profile of the resource

Page 5: Filtering for Continuous Multi-Resources · 2013. 1. 9. · ICAPS08 4 Context and contributions •(Beldiceanu and Poder , CPAIOR - 2007):–Task made of a sequence of positive or

ICAPS08 5

Task model and piecewise linear cumulative cumulatives_pwl

A task T = (s, td, e, Seq, a) is defined by:

• a start s, an end e, a total duration td and a set a of possible resourceassignments

• a positive or negative piecewise linear resource function hT represented by

a sequence Seq of p consecutive trapezoid sub-tasks ST1, ST2,…, STp

where STi has a start height shi , an end height ehi and a duration di.

v → dom(v) = [vmin, vmax]

Definition (Cf CPAIOR07):

td d1 d2 d3 d4

sh3 eh4s e ST3

time

resource function

t

hT(t)

Page 6: Filtering for Continuous Multi-Resources · 2013. 1. 9. · ICAPS08 4 Context and contributions •(Beldiceanu and Poder , CPAIOR - 2007):–Task made of a sequence of positive or

ICAPS08 6

• All attributes of a task may be not fixed

• Multi-resources

• Sequence of trapezoid sub-tasks with variable durations where their

sum is equal to the duration of the task

⇒ no need to define relations of precedence between sub-tasks outside

• Trapezoid sub-tasks with positive heights and trapezoid sub-tasks with

negatives heights in a same task

Task model and piecewise linear cumulative cumulatives_pwl

Difficulties and interest of the model:

Page 7: Filtering for Continuous Multi-Resources · 2013. 1. 9. · ICAPS08 4 Context and contributions •(Beldiceanu and Poder , CPAIOR - 2007):–Task made of a sequence of positive or

ICAPS08 7

Task model and piecewise linear cumulative cumulatives_pwl

Given :• Tasks, a collection of Tasks T1, T2, …, Tn where Ti = (si, tdi, ei, Seqi, ai)

(start, total duration, end, Sequence of sub-tasks, assignment)• Resources, a set of integers C1, C2, …, Cq where Ck is:

The capacity of the resource k if Constraint =‘≤’ The minimum level to reach of the resource k if Constraint =‘≥’

Constraint, one of the constraint ‘≤’ or ‘≥’

The constraint cumulatives_pwl(Tasks, Resources, Constraint) holds iff:

1. 2.

3. Case ‘≤’ :

Case ‘≥’: !

"i =1..n, d j

j=1

pi

# = tdi

!

"i =1..n,si+ td

i= e

i

!

"k =1..q( ) "t # R( ) hTi (t) $ Ck

i / ai ={k}

%

!

"k =1..q( ) "t # R /$i,t # si,ei[ [( ) hTi (t) % Ck

i / ai ={k}

&

Page 8: Filtering for Continuous Multi-Resources · 2013. 1. 9. · ICAPS08 4 Context and contributions •(Beldiceanu and Poder , CPAIOR - 2007):–Task made of a sequence of positive or

ICAPS08 8

Filtering a task according to a minimum cumulated profile

B - Notion of minimum cumulated profile

Definition: The minimum cumulated profile mcrP(r) of a resource r is such

that its resource function verifies for any t:

where mP(Ti) is the minimum profile of the task Ti and is build from the

compulsory part CP(Ti+) of the positive sub-tasks Ti

+ of Ti and of the enveloppe

Env(Ti- ) of the negative sub-tasks Ti

- of Ti :!

hmcrP r( ) t( ) = h

mP Ti( ) t( )

Ti/ r"a

i

#

!

hmP Ti( )(t) = h

CP(Ti+)(t) + h

Env(Ti")(t)

Remarks:

• For any t, we can’t have both and

• If Ti is assigned to the resource r then both CP(Ti+) and Env(Ti

- ) are taken intoaccount within mcrP(r). Else, if Ti is not yet assigned to the resource r then onlyEnv(Ti

- ) are taken into account within mcrP(r)!

hCP(Ti

+)(t) " 0

!

hEnv(T

i

")(t) # 0

Page 9: Filtering for Continuous Multi-Resources · 2013. 1. 9. · ICAPS08 4 Context and contributions •(Beldiceanu and Poder , CPAIOR - 2007):–Task made of a sequence of positive or

ICAPS08 9

Filtering a task according to a minimum cumulated profile

From now on, we consider:• A resource R with maximum capacity C• A fixed trapezoid trap1 of the minimum cumulated profile mcrP(R) of the resource R.• A task T that is or may be assigned to the resource R and that is or may be executed inparallel with trap1

We are interested in:A - Filtering the resource assignment of the task TB - Filtering its temporal attributes (start, duration, end and duration of its sub-tasks)C - Filtering the heights of its sub-tasks according to the minimum resource profile of the resource R

t

1 2 4 5 63 7 8

-10

-2

1C=2

-3

MinimumprofilemcrP(R)

trap1

Resource R

-1

1 2 3 4 5 6

012

-2

3

Task T(shape)

Page 10: Filtering for Continuous Multi-Resources · 2013. 1. 9. · ICAPS08 4 Context and contributions •(Beldiceanu and Poder , CPAIOR - 2007):–Task made of a sequence of positive or

ICAPS08 10

Filtering a task according to a minimum cumulated profile

B - Filtering of the resource assignment

We distinguish two cases

• T has a known contribution already registered within mcrP(R). If this contribution

is absolutely required to avoid a capacity overflow then:

o We assign T to the resource R

o We filter the latest start and the earliest end of T so as to they include trap1

• There exits no registered contribution of T within mcrP(R). If the assignment of T

to the resource R would lead to a capacity overflow then we remove R from the

resource assignment variable of T

Page 11: Filtering for Continuous Multi-Resources · 2013. 1. 9. · ICAPS08 4 Context and contributions •(Beldiceanu and Poder , CPAIOR - 2007):–Task made of a sequence of positive or

ICAPS08 11

Filtering a task according to a minimum cumulated profile

C - Filtering of the temporal attributes of a task

Two phases:

1. We browse all sub-tasks of T and, for each such sub-task, we compute the interval of non

feasible values for its starts and duration according to trap1

2. We propagate back these non-feasible values the others temporal attributes using the

following linear constraints (holes within the origin/end of sub-tasks matter) :

(1) The sum of the durations of all the sub-tasks is equal to the total duration of the task,

(2) The start plus the total duration of the task is equal to its end,

(3) The start of a sub-task plus its duration is equal to the start of the next sub-task.

Page 12: Filtering for Continuous Multi-Resources · 2013. 1. 9. · ICAPS08 4 Context and contributions •(Beldiceanu and Poder , CPAIOR - 2007):–Task made of a sequence of positive or

ICAPS08 12

Filtering a task according to a minimum cumulated profile

In the following:• trap2 denotes the sub-task of T we want to filter according to trap1

• assumes that the contribution of T within trap1 has been removed before the filtering

C - Filtering of the temporal attributes of a task (phase 1)

To filter the attributes of trap2 , we first transform the problem ofscheduling trap2 according to trap1 without exceeding Cin a particular non-overlapping problem

Page 13: Filtering for Continuous Multi-Resources · 2013. 1. 9. · ICAPS08 4 Context and contributions •(Beldiceanu and Poder , CPAIOR - 2007):–Task made of a sequence of positive or

ICAPS08 13

Cumulativeview

Non-overlapping

view

Filtering a task according to a minimum cumulated profile

resource

Trapezoid sub-task tofilter

timetrap2

sh2 eh2

time

resource

sh1eh1

st1 et1

trap1

Fixed trapezoid of aminimum cumulated profile

C

time

C

time

feasiblescheduling/placement

on top of thecumulative profile

between trap1 andtrap2

Remainingspace

trap2

trap1

eh2

sh2

time

C

time

C

non-feasiblescheduling/placement

Exceeding above C

Overlap betweentrap1 and trap2

trap2

trap1

sh2

eh2

C-1. transforming a cumulative scheduling problem into a particular non-overlapping problem

Page 14: Filtering for Continuous Multi-Resources · 2013. 1. 9. · ICAPS08 4 Context and contributions •(Beldiceanu and Poder , CPAIOR - 2007):–Task made of a sequence of positive or

ICAPS08 14

Filtering a task according to a minimum cumulated profile

• Case when the duration of trap2 is fixed to d2*:

Last feasible start for trap2 before trap1

i.e. the earliest possible overlapping

γ(d2*)

First feasible start for trap2 after trap1

i.e. the latest possible overlapping

δ(d2*)

We translate trap2 according to trap1 and C

C

time

trap2

trap1

d2*

The non feasible starts of trap2 is the interval ] γ(d2*), δ( d2*) [

]///////////////////////[

Remark : five cases for the computation of γ(d2*) and five cases for the computation of δ(d2*)

C-2. Computing the interval of non feasible starts of trap2

Page 15: Filtering for Continuous Multi-Resources · 2013. 1. 9. · ICAPS08 4 Context and contributions •(Beldiceanu and Poder , CPAIOR - 2007):–Task made of a sequence of positive or

ICAPS08 15

• Case when the duration of trap2 is not fixed but d2 ∈ [d2

min, d2max]:

The non feasible starts of trap2 is the interval ] γ(d2min), δ( d2

max) [

γ(d2min) δ(d2

max)

trap2

time

C

]/////////////////////////[

]///////////////[

d2maxd2

min

γ(d2*) δ(d2*)

Remark : The earliest start st2min and the latest end et2

max can also be taken into account forthe computation of this interval (more pruning).

Filtering a task according to a minimum cumulated profileC-2. Computing the interval of non feasible starts of trap2

Page 16: Filtering for Continuous Multi-Resources · 2013. 1. 9. · ICAPS08 4 Context and contributions •(Beldiceanu and Poder , CPAIOR - 2007):–Task made of a sequence of positive or

ICAPS08 16

The non feasible durations of trap2 is ] max(dbefore, dafter), +∞ [

time

C

st2min et2max

trap1

1. We fix the heights sh2 and eh2 of trap2 at their minimum respective value sh2min and eh2

min

sh2min

eh2min

dbefore

trap2

2. We place trap2 with d2=d2min

, if possible, before trap1 at its earliest start st2min and stretch itsduration as much as possible (i.e., without overlapping) -> we obtain a duration dbefore

dafter

trap2

3. We place trap2 with d2=d2min, if possible, after trap1 at its latest end et2max and stretch its

duration as much as possible (i.e., without overlapping) -> we obtain a duration dafter

Filtering a task according to a minimum cumulated profileC-3. Computing the interval of non feasible durations of trap2

Page 17: Filtering for Continuous Multi-Resources · 2013. 1. 9. · ICAPS08 4 Context and contributions •(Beldiceanu and Poder , CPAIOR - 2007):–Task made of a sequence of positive or

ICAPS08 17

time

C

st2min

eh2min

et2max

d2min

• Non feasible values for the start height sh2 of trap2:

1. We fix the duration d2 and the end height eh2 of trap2 at their minimum respective valued2

min and eh2min

2. We place trap2, if possible, before trap1 at its earliest start st2min and stretch its start heightas much as possible (i.e., without overlapping) -> we obtain the value shbefore

3. We place trap2, if possible, after trap1 at its latest end et2max and stretch its start height as

much as possible (i.e., without overlapping) -> we obtain the value shafter

The non feasible values for sh2 is ] max(shbefore, shafter), +∞ [

• Non feasible values for the end height eh2 of trap2: Similar

Filtering a task according to a minimum cumulated profileD. Computing the interval of non feasible heights of trap2

Page 18: Filtering for Continuous Multi-Resources · 2013. 1. 9. · ICAPS08 4 Context and contributions •(Beldiceanu and Poder , CPAIOR - 2007):–Task made of a sequence of positive or

ICAPS08 18

Conclusion and Perspectives

Results:

• Efficient algorithm for pruning all tasks attributes

Perspectives:

• Generalize edge finding to this task modelQUESTION: is it possible to have a polynomial algorithm

which gives the exact minimum intersection of a task

(with non-fixed attributes) with a fixed interval ?

Further information: Poder PhD Thesis 2002 available athttp://epoder.neuf.fr/

Page 19: Filtering for Continuous Multi-Resources · 2013. 1. 9. · ICAPS08 4 Context and contributions •(Beldiceanu and Poder , CPAIOR - 2007):–Task made of a sequence of positive or

ICAPS08 19

Compulsory Part, Envelope, minimum cumulated profile

Definition: the compulsory part (CP) of a positive task is the intersection of all its feasibleinstances (A. Lahrichi, 1979)

Definition: The enveloppe (Env) of a positive task is the union of all its feasibleinstances.

!

s

!

s

!

h

!

d

!

s

!

s

!

h

!

d

Envelope

!

s

!

s

!

h

!

d

Non empty Compulsory Part Empty Compulsory Part

Page 20: Filtering for Continuous Multi-Resources · 2013. 1. 9. · ICAPS08 4 Context and contributions •(Beldiceanu and Poder , CPAIOR - 2007):–Task made of a sequence of positive or

ICAPS08 20

Compulsory Part and Envelope of a positive task

(A) Task T

Valleys

Tops

•• •

••

!

st2

!

st1

!

st3

!

st4

(=s) (=e)!

eh1

!

sh3

!

sh1

!

eh2

!

eh3

!

sh1

!

sh1

time

•• •

resource profile

!

+"

!

st2

!

st2

!

st3

!

st3

!

sh3

!

eh1

!

s

!

s

!

e

!

e

time

!

st3

!

st3

!

s

!

s

!

e

!

e

!

sh2

!

eh2

!

eh3

• • • • • •resource profile

time

!

st1

!

st1

!

st2

!

st3

!

st4

!

st2

!

st3

!

st4

!

s

!

s

!

e

!

e

(D) Level Top Task on [ , [

!

s

!

e

(C) Level Valley Task on [ , [

!

s

!

e

(B) Earliest and latest starts of each sti

-> Give Tmin and Tmax

Page 21: Filtering for Continuous Multi-Resources · 2013. 1. 9. · ICAPS08 4 Context and contributions •(Beldiceanu and Poder , CPAIOR - 2007):–Task made of a sequence of positive or

ICAPS08 21

Compulsory Part and Envelope of a positive task

time

!

st2

!

st2

!

st3

!

s

!

e

•• •

!

st1

!

st4

time

•• •

• LVT(T)

Env(T) = Tmin ∪ Tmax ∪ LTT(T)CP(T) = Tmin ∩ Tmax ∩ LVT(T)

CP(T)

time

!

st3

!

st3

!

s

!

s

!

e

!

e

• • • • • •

••

!

st1

!

st2

!

st3

!

st4

Tmin

••

!

st1

!

st2

!

st3

!

st4

Tmax

!

st1

!

st2

!

st3

!

st4

Tmin

••

!

st1

!

st2

!

st3

!

st4

Tmax

time

• • • • • •

LTT(T)

Env(T)

Page 22: Filtering for Continuous Multi-Resources · 2013. 1. 9. · ICAPS08 4 Context and contributions •(Beldiceanu and Poder , CPAIOR - 2007):–Task made of a sequence of positive or

ICAPS08 22

Minimum and maximum profiles of a task

Tasks and their feasible sub-sequences:

Minimum profiles mP of the four tasks on the resources r1 et r2:

s2 ∈ [1,2]; a2 ∈ {1} s4 ∈ [1,6];a4 ∈ {1,2}

s3 ∈ [0,3]; a3 ∈ {1}s1∈[1,2]; a1∈{1,2}

mP(T2) on r1

2 4 5 63 7

-1-2

012

mP(T1) on r1 and r2

3 4 5 6

-10

mP(T3) on r1

4 5 63

01

mP(T4) on r1 and r2

time

1 2 4 5 63 7 8

-10

-1

1 2 3 4 5 6

012

-2

3

012

1 2 4 5 63

0

1 2

-1012

1 2 3 4 5

-1

012

-11 2 3 4

012

1 2 3 4 5

-1

012

-11 2 3 4

Page 23: Filtering for Continuous Multi-Resources · 2013. 1. 9. · ICAPS08 4 Context and contributions •(Beldiceanu and Poder , CPAIOR - 2007):–Task made of a sequence of positive or

ICAPS08 23

Minimum and maximum cumulated resource profiles

Minimum Profiles of tasks T1,T2,T3 and T4 on resources 1 and 2:

Minimum cumulated profilesof resources 1 and 2:

mP(T1)a1 = {1,2}

t1 2 4 5 63 7 8

-10

t

1 2 4 5 63 7 810

t

1 2 4 5 63 7 8

-10

-2

123

t1 2 4 5 63 7 8

-10

mP(T2)a2 = {1}

mP(T3)a3 = {1}

mP(T4)a4 = {1,2}

-1

-1

-1 -1

1

0

0 0

!

hmP T

4( ) t( )!

hmP T

3( ) t( )

!

hmP T

2( ) t( )!

hmP T

1( ) t( )

t

1 2 4 5 63 7 8

-10

-2

12

-3

!

hmcrP r

1( ) t( ) = hmP T

1( ) t( ) + hmP T

2( ) t( ) + hmP T

3( ) t( ) + hmP T

4( ) t( )

-30

t1 2 4 5 63 7 8

-10

-2!

hmcrP r

2( ) t( ) = hmP T

1( ) t( ) + hmP T

4( ) t( )

-2 -1

mcrP(r1)

mcrP(r2)