reasoning with conditional time-intervals

41
Reasoning with Conditional Time-intervals P. Laborie and J. Rogerie [plaborie,jrogerie]@ilog.fr

Upload: philippe-laborie

Post on 05-Dec-2014

171 views

Category:

Technology


1 download

DESCRIPTION

Reasoning with conditional time-intervals representing activities or tasks that may or may not be executed in the final schedule is crucial in many scheduling applications. In Constraint-Based Scheduling, those problems are usually handled by defining new global constraints over classical integer variables. The approach described in this paper takes a different perspective by introducing a new type of variable (namely a time-interval variable) that intrinsically embeds the notion of conditionality. This dual perspective facilitates the modelling process while ensuring a strong constraint propagation and an efficient search in the engine. The approach forms the foundations of the new generation of scheduling model and algorithms provided in ILOG CP Optimizer. This slide deck was presented at the FLAIRS 2008 conference. Philippe Laborie

TRANSCRIPT

Page 1: Reasoning with Conditional Time-intervals

Reasoning with Conditional Time-intervals

 

P. Laborie and J. Rogerie[plaborie,jrogerie]@ilog.fr

Page 2: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Overview

Motivations

Model

Constraint Propagation

Extensions & Conclusion

Page 3: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Motivations

Optional time-intervals in scheduling: Some activities can be left unperformed

A C

B

Page 4: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Motivations

Optional time-intervals in scheduling: Some activities can be left unperformed

A C

B

C

Page 5: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Motivations

Optional time-intervals in scheduling: Some activities can be left unperformed

A

B

Page 6: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Motivations

Optional time-intervals in scheduling: Some parts of the schedule can be left unperformed

A

B

C

DE

Page 7: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Motivations

Optional time-intervals in scheduling: Some parts of the schedule can be left unperformed

A

B

C

DE

C

DE

Page 8: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Motivations

Optional time-intervals in scheduling: Some parts of the schedule can be left unperformed

A

B

Page 9: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Motivations

Optional time-intervals in scheduling: Some parts of the schedule can be left unperformed

Dependencies: exec(E)exec(C)exec(D)

A

B

C

DE

Page 10: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Motivations

Optional time-intervals in scheduling: Alternative combination of resources

A

B

CXOR

C: Mode 2

C: Mode 1

C: Mode 3

Page 11: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Motivations

Optional time-intervals in scheduling: Alternative combination of resources

A

BC: Mode 1C: Mode 1

Page 12: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Motivations

Optional time-intervals in scheduling: Alternative combination of resources

A

BC: Mode 2C: Mode 2

Page 13: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Motivations

Optional time-intervals in scheduling: Alternative combination of resources

A

B

C: Mode 3C: Mode 3

Page 14: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Motivations

Optional time-intervals in scheduling: Alternative recipes (common in manufacturing)

A

B

XOR

C

C: Recipe 1

Op11 Op12 Op13

C: Recipe 2

Op21 Op22

Op23

Page 15: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Motivations

Optional time-intervals in scheduling: Alternative recipes (common in manufacturing)

A

B

C: Recipe 1

Op11 Op12 Op13

C: recipe 1

Op11 Op12 Op13

Page 16: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Motivations

Optional time-intervals in scheduling: Alternative recipes (common in manufacturing)

A

B

C: Recipe 2

Op21 Op22

Op23C: Recipe 2

Op21 Op22

Op23

Page 17: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Motivations

Objective: Make it easier to model and solve scheduling problems involving optional activities/tasks/processes/recipes/…

Constraint Optimization framework Basic ingredients:

Optional time-intervals variables (a,b,c,… )

Logical constraints (exec(a) exec(b))

Precedence constraints (endBeforeStart(a,b))

Decomposition constraints (span(a,{b1,…bn}))

Alternative constraints (alternative(a,{b1,…bn}))

Page 18: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Focus of this talk

Time-interval variables

Basic constraints:logical, precedence,

span, alternative Basic constraintpropagation

MODEL PROBLEM SOLVING

Page 19: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

What we won’t talk about here

Time-interval variables

Basic constraints:logical, precedence,

span, alternative Basic constraintpropagation

Resource-related constraints:

sequencing, cumul, states, calendars

Resource-related constraint

propagation

Search & optimizationtechniques

MODEL PROBLEM SOLVING

Page 20: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Model: Time interval variables

Extension of classical CSPs

A new type of first class citizen decision variable: Time-interval variable

Domain of values for a time-interval variable a :

Dom(a) {} { [s,e) | s,eℤ, s≤e }

Non executed Interval of integers

Page 21: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Model: Time interval variables

Domain of values for a time-interval variable a :

Dom(a) {} { [s,e) | s,eℤ, s≤e }

Notations: Let a be a fixed time-interval variable

If a={[s,e)} (a is executed), we denote:

x(a)=1, s(a)=s, e(a)=e, d(a)=e-s

If a={} (a is non-executed), we denote:

x(a)=0 (in this case, s(a),e(a),d(a) are meaningless)

Page 22: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Model: Logical constraints

Execution unary constraint exec(a) means that a is executed (x(a)=1)

2-SAT clauses over execution constraints:

[¬]exec(a) [¬]exec(b)

Expressivity: Same execution status:

¬exec(a)exec(b),exec(a)¬exec(b)

Incompatibility: ¬exec(a)¬exec(b)

Implication: ¬exec(a)exec(b)

Page 23: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Model: Precedence constraints

Simple Precedence Constraints ti+z≤tj reified by

execution statuses

Example: endBeforeStart(a,b,z) means

x(a)x(b) e(a)+z≤s(b)

startBeforeStart, startBeforeEndendBeforeStart, endBeforeEndstartAtStart, startAtEndendAtStart, endAtEnd

Page 24: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Model: Span constraint

Span constraint span(a,{b1,…,bn}) means that if a

is executed, it spans all executed intervals from {b1,…,bn}. Interval a is not executed iff none of

intervals {b1,…,bn} is executed.

b1 b4

b3

b5

a

b2

Page 25: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Model: Alternative constraint

Alternative constraint alternative(a,{b1,…,bn})

means that if a is executed, then exactly one of the {b1,…,bn} is executed and synchronized with

a. Interval a is not executed iff none of intervals {b1,…,bn} is executed.

b2

b3

aXOR

b1

Page 26: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Model: Simple example

Inspired from [Barták&Čepek 2007]

CollectMaterial (1)

GetTube

XORSawTube (30)

ClearTube (20)

BuyTube (40)

WeldTube (15)

AssemblePiston (5)

ShipPiston (0)

SawRod (10)

ClearRod (2)

WeldRod (15)

CollectKit (1)

AssembleKit (5)

Deadline=70

MakeTube

Page 27: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Model: Simple example (ILOG OPL Studio)

Page 28: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Constraint Propagation: Interval variables

Time interval variable domain representation: tuple of ranges:

[xmin,xmax][0,1]: current execution status

[smin,smax] ℤ: conditional domain of start time would

the time-interval be executed

[emin,emax] ℤ: conditional domain of end time would

the time-interval be executed

[dmin,dmax] ℤ+: conditional domain of duration would

the time-interval be executed

Page 29: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Constraint Propagation: Logical network

Logical constraints are aggregated in an implication graph: all 2-SAT logical constraints [¬]exec(a) [¬]exec(b) are translated as implications ( ¬[¬]exec(a) [¬]exec(b) )

Incremental transitive closure of the implication graph allows detecting infeasibilities and querying in O(1) whether exec(a) exec(b) for any (a,b)

Page 30: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Constraint Propagation: Temporal network

Precedence constraints are aggregated in a temporal network

Page 31: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Constraint Propagation: Temporal network

Precedence constraints are aggregated in a temporal network

Conditional reasoning:

a b endBeforeStart(a,b)

From logical network

exec(a)exec(b)

Page 32: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Constraint Propagation: Temporal network

Precedence constraints are aggregated in a temporal network

Conditional reasoning:

Propagation on the conditional bounds of a (would a be executed) can assume that b will be executed too, thus:

emax(a) min(emax(a), smax(b))

a b endBeforeStart(a,b)

From logical network

exec(a)exec(b)

Page 33: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Constraint Propagation: Temporal network

Precedence constraints are aggregated in a temporal network

Conditional reasoning:

Propagation on the conditional bounds of a (would a be executed) can assume that b will be executed too, thus:

emax(a) min(emax(a), smax(b))

Bounds are propagated even on time intervals with still undecided execution status !

a b endBeforeStart(a,b)

From logical network

exec(a)exec(b)

Page 34: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Model: Simple example

Inspired from [Barták&Čepek 2007]

CollectMaterial (1)

GetTube

XORSawTube (30)

ClearTube (20)

BuyTube (40)

WeldTube (15)

AssemblePiston (5)

ShipPiston (0)

SawRod (10)

ClearRod (2)

WeldRod (15)

CollectKit (1)

AssembleKit (5)

Deadline=70

MakeTube

Page 35: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Model: Simple example

Inspired from [Barták&Čepek 2007]

CollectMaterial (1)

GetTube

XORSawTube (30)

ClearTube (20)

BuyTube (40)

WeldTube (15)

AssemblePiston (5)

ShipPiston (0)

SawRod (10)

ClearRod (2)

WeldRod (15)

CollectKit (1)

AssembleKit (5)

Deadline=70

MakeTube

BuyTube (40)BuyTube (40)

Page 36: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Extensions & Conclusion

Conditional time-intervals are the foundation of the new version of ILOG CP Optimizer (2.0) for modeling and solving detailed scheduling problems

Model extensions: Resources (sequencing, cumulative, state reasoning)

Calendars (resource efficiency curves, days off, etc.)

Expressions to use interval bounds (start, end, etc.) in classical CSP constraints on integer variables

Page 37: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Extensions & Conclusion

Conditional time-intervals are the foundation of the new version of ILOG CP Optimizer (2.0) for modeling and solving detailed scheduling problems

Search: Extension of SA-LNS [Laborie&Godard 2007] to handle

optional time-interval variables

Page 38: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Example: Multi-Mode RCPSP

Page 39: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Example: Multi-Mode RCPSP

Data

Page 40: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Example: Multi-Mode RCPSP

Model

Page 41: Reasoning with Conditional Time-intervals

FLAIRS 2008 – Coconut Grove, Florida, USA – May 15-17, 2008

Example: Multi-Mode RCPSP

Trial Version:http://ilog.com/products/oplstudio/trial.cfm