SlideShare une entreprise Scribd logo
1  sur  62
Télécharger pour lire hors ligne
© 2014 IBM Corporation
May 28, 2014
IBM Decision Optimization Virtual User Group Meeting
Modeling and Solving Scheduling Problems
with CP Optimizer
Philippe Laborie
CPLEX Optimization Studio Team
© 2014 IBM Corporation2
Agenda
 IBM ILOG CP Optimizer for Scheduling
 Scheduling concepts in CP Optimizer
 Tips and Tools
 Q&A
© 2014 IBM Corporation3
IBM ILOG CP Optimizer for Scheduling
 Scheduling consist of assigning starting and completion times
to a set of activities while satisfying different types of constraints
(resource availability, precedence relationships, … ) and
optimizing some criteria (minimizing tardiness, …)
 Time is considered as a continuous dimension: domain of possible
start/completion times for an activity is potentially very large
 Beside start and completion times of activities, other types of
decision variables are often involved in real industrial scheduling
problems (resource allocation, optional activities …)
start end
Timeactivity
© 2014 IBM Corporation4
IBM ILOG CP Optimizer for Scheduling
 Modeling and solving scheduling problems
Model & run
paradigm
User-implemented
resolution
dispatching rules,
heuristics,
meta-heuristics
MIP
(CPLEX)
© 2014 IBM Corporation5
IBM ILOG CP Optimizer for Scheduling
 Modeling and solving scheduling problems
– Dedicated modeling concepts for scheduling
• Consistent with Optimization paradigm:
new decision variables, expressions and constraints
• Available in OPL and APIs (C++, Java, .NET)
– Automatic search
• Complete
• Combines tree search, large neighborhood search, meta-
heuristics, relaxations, learning, ...
Model & run
paradigm
User-implemented
resolution
dispatching rules,
heuristics,
meta-heuristics
MIP
(CPLEX)
CP Optimizer
for Scheduling
© 2014 IBM Corporation6
Agenda
 IBM ILOG CP Optimizer for Scheduling
 Scheduling concepts in CP Optimizer
 Tips and Tools
 Q&A
© 2014 IBM Corporation7
Concept: interval variable
 What for?
–modeling an interval of time during which a particular property
holds (an activity executes, a resource is idle, a tank must be
non-empty, …)
 Example:
dvar interval x in 0..1000 size in 10..20
0 1000
Time
[10,20]
Interval variable
© 2014 IBM Corporation8
Concept: interval variable
dvar interval x in 0..1000 size in 10..20
 Properties:
–The value of an interval variable is an integer interval
[start,end)
–Domain of possible values: [0,10), [1,11), [2,12),...
[990,1000), [0,11),[1,12),...
–Domain of interval variables is represented compactly in CP
Optimizer (a few bounds: smin, smax, emin, emax, szmin,
szmax)
0 1000
Time
[10,20]
Interval variable
© 2014 IBM Corporation9
Concepts: optional interval variable
 Interval variables can be defined as being optional that is, it is
part of the decisions of the problem to decide whether the
interval will be present or absent in the solution
 What for?
–Modeling optional activities, alternative execution modes for
activities, and … most of the discrete decisions in a schedule
 Example:
dvar interval x optional in 0..1000
size in 10..20
 Properties:
–An optional interval variable has an additional possible value in
its domain (absence value)
–Optionality is a powerful property that you must learn to
leverage in your models (more on this later ...)
© 2014 IBM Corporation10
Concept: precedence constraint
 What for ?
–Modeling temporal constraints between interval variables
–
 Example:
a b endBeforeStart(a,b)
startBeforeStart(a,b)
startBeforeEnd(a,b)
endBeforeEnd(a,b)
endAtStart(a,b)
startAtStart(a,b)
startAtEnd(a,b)
endAtEnd(a,b)
© 2014 IBM Corporation11
Concept: precedence constraint
 What for ?
–Modeling temporal constraints between interval variables
–Modeling constant or variable minimal delays
 Example:
a b endBeforeStart(a,b,z)
startBeforeStart(a,b,z)
startBeforeEnd(a,b,z)
endBeforeEnd(a,b,z)
endAtStart(a,b,z)
startAtStart(a,b,z)
startAtEnd(a,b,z)
endAtEnd(a,b,z)
z
© 2014 IBM Corporation12
Concept: precedence constraint
 Properties
–Semantic of the constraints handles optionality (as for all
constraints in CP Optimizer). Example of endBeforeStart:
present(a) AND present(b)  end(a)+z  start(b)
–All precedence constraints are aggregated in a temporal
network and handled by dedicated graph algorithms (fast
global propagation, negative cycle detection, ...)
© 2014 IBM Corporation13
Concept: presence constraint
 What for:
–Expressing dependency constraints between execution of
optional activities or between allocated resources …
 Examples:
a b presenceOf(a) => presenceOf(b)
presenceOf(a) == presenceOf(b)
presenceOf(a) => !presenceOf(b)
!presenceOf(a) => presenceOf(b)
© 2014 IBM Corporation14
Concept: presence constraint
 Properties:
–All binary constraints between presence status are aggregated in
an implication graph
–CP Optimizer maintains hypothetical bounds on interval variables
(e.g. start min would the interval be present)
–CP Optimizer exploits the implication graph to perform
conditional reasoning between related interval variables
© 2014 IBM Corporation15
Concept: expressions on interval variables
 What for?
– Evaluating a characteristic of an interval variable (start, end,
size) for use in the objective function or in a constraint
 Example:
– endOf(a, ABSVAL) takes value ABSVAL if interval a is absent
otherwise it takes value e if a is present and a=[s,e)
–Typical makespan expression: max(i in 1..n) endOf(a[i])
© 2014 IBM Corporation16
Concept: expressions on interval variables
 What for?
–Evaluating a piecewise linear function at a particular end-point
of an interval variable (earliness-tardiness cost, temporal
preference)
 Example:
– endEval(f,a, ABSVAL) takes value ABSVAL if a is absent
otherwise it takes value f(e) if a is present and a=[s,e)
 Property:
–f can be any piecewise linear function (non-continuous, non-
convex, ...)
f
a
© 2014 IBM Corporation17
Concept: cumul function
 What for?
–Modeling and constraining cumulative quantities over time
(cumulative use of a discrete resource, level of an inventory with
producing and consuming tasks)
–Restricting the number of intervals that overlap a given date t
–Forcing a minimal number of intervals to overlap a given date t
–Complex synchronization constraints between interval variables:
e.g. between activities producing/consuming in a tank and the
set of time-intervals during which the tank is non-empty
© 2014 IBM Corporation18
Concept: cumul function
 Cumul functions are built from atomic functions




 A cumul function is the sum of atomic functions or their opposite
a
pulse(a,h)
h
a
stepAtStart(a,h)
h
a
stepAtEnd(a,h)
h
© 2014 IBM Corporation19
Concept: cumul function
 Examples:
–cumulFunction f = pulse(a,2)+pulse(b,1)+pulse(c,3)
–
–
–
–
–
–
–
–Constraint f<=C (global capacity limit)
–Constraint alwaysIn(f,t0,t1,Cmin,Cmax) (capacity profile)
–Constraint alwaysIn(f,x,Cmin,Cmax) (condition holds over an
interval variable x)
a
b c
f
© 2014 IBM Corporation20
Concept: cumul function
 Properties:
–Complexity of cumul functions is independent of the time
scale
–CP Optimizer is able to reason globally over cumul functions
© 2014 IBM Corporation21
Concept: cumul function
 Properties:
–Compare:
• Time-indexed MIP model:
• s[i][t]{0,1}: s[i][t]=1 iff a[i] starts at date t
•
•
•
•
•
•
• CP Optimizer model:
a[i]
t
t
sum(i in …) pulse(a[i],Q[i])  C
t, sum(i in …, t' in …) Q[i]*s[i][t'] C
...
© 2014 IBM Corporation22
Concept: cumul function
 Example: Resource-Constrained Project Scheduling Problem
(RCPSP)
 Minimization of project makespan
a1
a3
a2
a6
a5
a4
a7
a8
R1
R2
© 2014 IBM Corporation23
Concept: cumul function
 CP Optimizer model for RCPSP:
 Comparison of this CP Optimizer model vs a time-indexed MIP
model on a set of 300 classical small RCPSP instances (30-120
tasks) + 40 larger ones (900 tasks), time-limit: 2mn, 4 threads
© 2014 IBM Corporation24
Concept: cumul function
 Comparison of CP Optimizer and MIP performance on RCPSP
© 2014 IBM Corporation25
Concept: sequence variable
 What for?
–modeling sequences of events
–constraining the transitions between consecutive events (setup
times/costs,...)
 Example:
dvar sequence s in all(i in Tasks) a[i]
noOverlap(s)
 Properties:
– A value for the sequence variable is a total order on the present
interval variables. E.g. a4 a1 a3 a2→ → →
–A constraint noOverlap states that intervals of the sequence do
not overlap and follows the total order of the sequence
a4 a1 a3 a2 Time
© 2014 IBM Corporation26
Concept: sequence variable
 Properties:
–Complexity is independent of the time scale
–CP Optimizer is able to reason globally over a sequence variable
–Avoid quadratic models over each pair (i,j) of intervals in the
sequence
 Compare:
– Quadratic disjunctive MIP formulation with big-Ms:
b[i][j]{0,1}: b[i][j]=1 iff a[i] before a[j]
end[i] <= start[j] + M*(1-b[i][j])
end[j] <= start[i] + M*b[i][j]
– CP Optimizer model:
a[i]
Time
noOverlap(all(i in …) a[i])
a[j]
…
© 2014 IBM Corporation27
Concept: sequence variable
 Example: Job-shop Scheduling Problem
 Minimization of makespan
op11 op12 op13
M1
M2
M3
op21 op22 op23
op31 op32 op33
op41 op42 op43
© 2014 IBM Corporation28
Concept: sequence variable
 CP Optimizer model for Job-shop:
 Comparison of this CP Optimizer model vs a disjunctive MIP
formulation on a set of 140 classical Job-shop instances (50-2000
tasks), time-limit: 2mn, 4 threads
© 2014 IBM Corporation29
Concept: sequence variable
 Comparison of CP Optimizer and MIP performance on Job-Shop
© 2014 IBM Corporation30
Concept: state function
 What for?
–Modeling evolution of a state variable over time
–Modeling incompatibility relations between activities
overlapping a given date t
–Synchronizing start/end value of compatible tasks (batching)
 Example
 Properties
–Complexity is independent of the time scale
–CP Optimizer is able to reason globally over a state function
–Avoid quadratic models over each pair (i,j) of incompatible
intervals on the state function
Time400˚F 500˚F 500˚F 600˚F
© 2014 IBM Corporation31
Concept: span constraint
 What for?
–Modeling task sub-task decomposition→
–Modeling immobilization time of a resource
 Example
span(a,[b1,...,bn])
 Properties
–The constraint of course handles optional interval variables
a
b3
b4
b1
b2
© 2014 IBM Corporation32
Concept: alternative constraint
 What for?
–Modeling alternative resource/modes/recipes
–In general modeling a discrete selection in the schedule
 Example
alternative(a,[b1,...,bn])
 Properties
–Conditional reasoning allows a strong pruning on the
alternative master interval variable a
–Master interval variable a can of course be optional
a
b3
b1
b2
Absent interval variables
Selected interval variableALT
© 2014 IBM Corporation33
Concept: span/alternative constraint
 What for?
–Modeling Work Breakdown Structure
 Example
Task
Recipe 2Recipe 1 Recipe 3
ALT
op1 op2
op3
ALT
© 2014 IBM Corporation34
Agenda
 IBM ILOG CP Optimizer for Scheduling
 Scheduling concepts in CP Optimizer
 Tips and Tools
 Q&A
© 2014 IBM Corporation35
Tips and Tools
 A measure of complexity of a model:
–Number of variables
–Number of groups of variables with different semantics
–Number of variable types (integer variables / interval variables)
 Take advantage of the expressiveness of the CP Optimizer
modeling language to compact the model by decreasing the
above indicators
 In particular if in a scheduling model, you are creating 1 decision
variable for each time point t you are usually in bad shape
➔
Exploit the scheduling concepts to reason on time-lines (sequence
variables, cumul functions, state functions) and avoid an explicit
representation of time
© 2014 IBM Corporation36
Tips and Tools
 A measure of complexity of a model is the number of
constraints
 If the number of constraints grows more than linearly with the
number of variables or the size of variables domains, the model
will probably not scale well
 Furthermore, if a set of many small constraints can be
reformulated more compactly, this often leads to stronger
inference in the engine
 Example: when you need to model activities (and more generally
intervals of time) that -under some conditions- cannot overlap,
think of using sequence variables, noOverlap constraints and/or
state functions
© 2014 IBM Corporation37
Tips and Tools
 Be careful when using composite constraints
 In scheduling models, exploit optionality of interval variables
 Examples :
– presenceOf(a)*endOf(a)+(1-presenceOf(a))*K USE: endOf(a,K)
– presenceOf(a) => (10<=startOf(a)) USE: 10<=startOf(a,10)
 Remarks:
–Exception: Binary logical constraints on presence status (like
presenceOf(a) => presenceOf(b)) are handled in a special
(and efficient) way in the engine
–Except for constraint “presenceOf”, all constraints on
scheduling constructs (interval and sequence variables, cumul
and state functions) cannot be used in composite constraints
© 2014 IBM Corporation38
Tips and Tools
 Surrogate constraints may help to reduce the search space
 A surrogate constraint is a constraint that does not change the
set of solutions (but may be useful for the search by allowing a
better pruning of the search space)
 Some examples :
–Redundant cumul function for alternative resources
© 2014 IBM Corporation39
Tips and Tools
 Surrogate constraints may help to reduce the search space
 A surrogate constraint is a constraint that does not change the
set of solutions (but may be useful for the search by allowing a
better pruning of the search space)
 Some examples :
–Redundant cumul function for alternative resources
–Redundant precedence constraints
a
a2
a1
ALT
b
b2
b1
ALT
z11
z22
z12 z21
min(z11,z12,z21,z22)
© 2014 IBM Corporation40
Tips and Tools
 Some classical patterns in scheduling models
–Chain of optional interval variables
–Optional intervals in paths of precedence constraints
–Multilevel alternatives
–Temporal alternatives
 See bonus material at the end of the slide deck
© 2014 IBM Corporation41
Tips and Tools
 Questions:
–Why is my model infeasible ?
–Search does not find any feasible solution, what should I do ?
–Search does not converge fast enough, what should I do ?
–Does my model improvement really help?
© 2014 IBM Corporation42
Tips and Tools
 Why is my model infeasible ?
–Conflict refiner Fix/relax model→
© 2014 IBM Corporation43
Tips and Tools
 The engine log is an essential tool for understanding how the
engine behaves on a given model
! -----------------------------------------------------------------------
! Minimization problem - 110 variables, 100 constraints
! LogPeriod = 100,000
! Workers = 2
! Initial process time : 0.00s (0.00s extraction + 0.00s propagation)
! . Log search space : 664.4 (before), 664.4 (after)
! . Memory usage : 1.1 MB (before), 1.2 MB (after)
! Using parallel search with 2 workers.
! -----------------------------------------------------------------------
! Best Branches Non-fixed W Branch decision
* 1,062 739 0.01s 1 -
...
* 936 136k 3.69s 1 -
936 300k 85 2 F on op#0#9
! Time = 4.05s, Explored branches = 450,928, Memory usage = 7.7 MB
! Best Branches Non-fixed W Branch decision
* 930 166k 4.55s 1 -
930 200k 110 1 F on op#5#1
! -----------------------------------------------------------------------
! Search terminated normally, 17 solutions found.
! Best objective : 930 (optimal - effective tol. is 0)
! Number of branches : 641,352
! Number of fails : 266,640
! Total memory usage : 6.9 MB (6.4 MB CP Optimizer + 0.5 MB Concert)
! Time spent in solve : 5.99s (5.99s engine + 0.00s extraction)
! Search speed (br. / s) : 107,070.5
! -----------------------------------------------------------------------
Problem
characteristics
© 2014 IBM Corporation44
Tips and Tools
 The engine log is an essential tool for understanding how the
engine behaves on a given model
! -----------------------------------------------------------------------
! Minimization problem - 110 variables, 100 constraints
! LogPeriod = 100,000
! Workers = 2
! Initial process time : 0.00s (0.00s extraction + 0.00s propagation)
! . Log search space : 664.4 (before), 664.4 (after)
! . Memory usage : 1.1 MB (before), 1.2 MB (after)
! Using parallel search with 2 workers.
! -----------------------------------------------------------------------
! Best Branches Non-fixed W Branch decision
* 1,062 739 0.01s 1 -
...
* 936 136k 3.69s 1 -
936 300k 85 2 F on op#0#9
! Time = 4.05s, Explored branches = 450,928, Memory usage = 7.7 MB
! Best Branches Non-fixed W Branch decision
* 930 166k 4.55s 1 -
930 200k 110 1 F on op#5#1
! -----------------------------------------------------------------------
! Search terminated normally, 17 solutions found.
! Best objective : 930 (optimal - effective tol. is 0)
! Number of branches : 641,352
! Number of fails : 266,640
! Total memory usage : 6.9 MB (6.4 MB CP Optimizer + 0.5 MB Concert)
! Time spent in solve : 5.99s (5.99s engine + 0.00s extraction)
! Search speed (br. / s) : 107,070.5
! -----------------------------------------------------------------------
Modified
parameter values
© 2014 IBM Corporation45
Tips and Tools
 The engine log is an essential tool for understanding how the
engine behaves on a given model
! -----------------------------------------------------------------------
! Minimization problem - 110 variables, 100 constraints
! LogPeriod = 100,000
! Workers = 2
! Initial process time : 0.00s (0.00s extraction + 0.00s propagation)
! . Log search space : 664.4 (before), 664.4 (after)
! . Memory usage : 1.1 MB (before), 1.2 MB (after)
! Using parallel search with 2 workers.
! -----------------------------------------------------------------------
! Best Branches Non-fixed W Branch decision
* 1,062 739 0.01s 1 -
...
* 936 136k 3.69s 1 -
936 300k 85 2 F on op#0#9
! Time = 4.05s, Explored branches = 450,928, Memory usage = 7.7 MB
! Best Branches Non-fixed W Branch decision
* 930 166k 4.55s 1 -
930 200k 110 1 F on op#5#1
! -----------------------------------------------------------------------
! Search terminated normally, 17 solutions found.
! Best objective : 930 (optimal - effective tol. is 0)
! Number of branches : 641,352
! Number of fails : 266,640
! Total memory usage : 6.9 MB (6.4 MB CP Optimizer + 0.5 MB Concert)
! Time spent in solve : 5.99s (5.99s engine + 0.00s extraction)
! Search speed (br. / s) : 107,070.5
! -----------------------------------------------------------------------
Root node
information
© 2014 IBM Corporation46
Tips and Tools
 The engine log is an essential tool for understanding how the
engine behaves on a given model
! -----------------------------------------------------------------------
! Minimization problem - 110 variables, 100 constraints
! LogPeriod = 100,000
! Workers = 2
! Initial process time : 0.00s (0.00s extraction + 0.00s propagation)
! . Log search space : 664.4 (before), 664.4 (after)
! . Memory usage : 1.1 MB (before), 1.2 MB (after)
! Using parallel search with 2 workers.
! -----------------------------------------------------------------------
! Best Branches Non-fixed W Branch decision
* 1,062 739 0.01s 1 -
...
* 936 136k 3.69s 1 -
936 300k 85 2 F on op#0#9
! Time = 4.05s, Explored branches = 450,928, Memory usage = 7.7 MB
! Best Branches Non-fixed W Branch decision
* 930 166k 4.55s 1 -
930 200k 110 1 F on op#5#1
! -----------------------------------------------------------------------
! Search terminated normally, 17 solutions found.
! Best objective : 930 (optimal - effective tol. is 0)
! Number of branches : 641,352
! Number of fails : 266,640
! Total memory usage : 6.9 MB (6.4 MB CP Optimizer + 0.5 MB Concert)
! Time spent in solve : 5.99s (5.99s engine + 0.00s extraction)
! Search speed (br. / s) : 107,070.5
! -----------------------------------------------------------------------
New incumbent
solutions (time, worker)
© 2014 IBM Corporation47
Tips and Tools
 The engine log is an essential tool for understanding how the
engine behaves on a given model
! -----------------------------------------------------------------------
! Minimization problem - 110 variables, 100 constraints
! LogPeriod = 100,000
! Workers = 2
! Initial process time : 0.00s (0.00s extraction + 0.00s propagation)
! . Log search space : 664.4 (before), 664.4 (after)
! . Memory usage : 1.1 MB (before), 1.2 MB (after)
! Using parallel search with 2 workers.
! -----------------------------------------------------------------------
! Best Branches Non-fixed W Branch decision
* 1,062 739 0.01s 1 -
...
* 936 136k 3.69s 1 -
936 300k 85 2 F on op#0#9
! Time = 4.05s, Explored branches = 450,928, Memory usage = 7.7 MB
! Best Branches Non-fixed W Branch decision
* 930 166k 4.55s 1 -
930 200k 110 1 F on op#5#1
! -----------------------------------------------------------------------
! Search terminated normally, 17 solutions found.
! Best objective : 930 (optimal - effective tol. is 0)
! Number of branches : 641,352
! Number of fails : 266,640
! Total memory usage : 6.9 MB (6.4 MB CP Optimizer + 0.5 MB Concert)
! Time spent in solve : 5.99s (5.99s engine + 0.00s extraction)
! Search speed (br. / s) : 107,070.5
! -----------------------------------------------------------------------
Periodical log
with fail information,
number of unfixed
variables, current decision
© 2014 IBM Corporation48
Tips and Tools
 The engine log is an essential tool for understanding how the
engine behaves on a given model
! -----------------------------------------------------------------------
! Minimization problem - 110 variables, 100 constraints
! LogPeriod = 100,000
! Workers = 2
! Initial process time : 0.00s (0.00s extraction + 0.00s propagation)
! . Log search space : 664.4 (before), 664.4 (after)
! . Memory usage : 1.1 MB (before), 1.2 MB (after)
! Using parallel search with 2 workers.
! -----------------------------------------------------------------------
! Best Branches Non-fixed W Branch decision
* 1,062 739 0.01s 1 -
...
* 936 136k 3.69s 1 -
936 300k 85 2 F on op#0#9
! Time = 4.05s, Explored branches = 450,928, Memory usage = 7.7 MB
! Best Branches Non-fixed W Branch decision
* 930 166k 4.55s 1 -
930 200k 110 1 F on op#5#1
! -----------------------------------------------------------------------
! Search terminated normally, 17 solutions found.
! Best objective : 930 (optimal - effective tol. is 0)
! Number of branches : 641,352
! Number of fails : 266,640
! Total memory usage : 6.9 MB (6.4 MB CP Optimizer + 0.5 MB Concert)
! Time spent in solve : 5.99s (5.99s engine + 0.00s extraction)
! Search speed (br. / s) : 107,070.5
! -----------------------------------------------------------------------
Final information
with solution status
and search statistics
© 2014 IBM Corporation49
Tips and Tools
 Search does not find any feasible solution, what should I do ?
–Identify which part of the model is hard:
• Simplify problem by removing “easy” constraints
• Search log helps (set LogPeriod=1, look where first fails occur)
–Strengthen the model:
• Be careful with composite constraints
• Add surrogate constraints
• Break symmetries
–Increase inference levels in the engine
© 2014 IBM Corporation50
Tips and Tools
 Search does not find any feasible solution, what should I do ?
–Try using search phases to first focus on the difficult decision
variables
–Solve the problem as two sub-problems:
1.Finding an initial feasible solution (some difficult constraints
can be relaxed and put in the objective function*
), then
2.Optimize starting from this solution. Consider using starting
points.
–Isolate the different sources of complexity in the model by
decomposition and sequential resolutions. Consider using
starting points
–(*) CP Optimizer's concepts makes it easy to relax part of the model.
E.g. make some interval variables optional and maximize number of
present intervals, relax deadlines as tardiness costs
© 2014 IBM Corporation51
Tips and Tools
 Search does not converge fast enough, what should I do ?
–Identify and try to isolate the different sources of
complexity in your model, first focusing on
bottleneck/important parts in a “simplified” model
–Exploit results of previous solve as (1) additional constraints
and/or (2) starting point and/or (3) heuristic (search phases)
–Do not hesitate to use MIP models in some steps, exploit
strengths of each technology (MIP/CP)
• For instance CP is good at deciding activities start/end times
under resource constraints when required resource quantities and
activity durations are fixed or mostly depend on activity start/end
dates
• For problems with very variable resource quantities or activity
durations, it makes sense to consider an initial MIP model that
works on these variables (example: lot sizing)
© 2014 IBM Corporation52
Tips and Tools
 Does my model improvement really help?
–CP Optimizer's search relies on a stochastic algorithm initialized
by a random seed (parameter IloCP::RandomSeed)
–For a given model, the solution depends on the random seed
–Best solution cost at a given time limit:
–
–
–
–
–
–
–
–
–Is model B better than model A ? Yes
Model A Model B
cost cost
seed=1
seed=1
© 2014 IBM Corporation53
Tips and Tools
 Does my model improvement really help?
–CP Optimizer's search relies on a stochastic algorithm initialized
by a random seed (parameter IloCP::RandomSeed)
–For a given model, the solution depends on the random seed
–Best solution cost at a given time limit:
–
–
–
–
–
–
–
–
–Is model B better than model A ? Yes
Model A Model B
cost cost
seed=1
seed=1
No!
Never evaluate a
model change on
a single instance/seed !
© 2014 IBM Corporation54
Conclusion
 For scheduling problems, CP Optimizer extends the Model&run
paradigm with some (few) general concepts (interval & sequence
variables, cumul & state functions, …)
 These concepts can be used to model scheduling problems in a
compact way that avoids enumeration of time. Typically, the
size of a scheduling model in CP Optimizer grows linearly with the
size of the data
 When combined together these concepts provide an expressive
language capable of handling complex and large industrial
scheduling problems
 The automatic search is complete, it exploits these concepts
using an efficient and robust combination of techniques from
scheduling theory, meta-heuristics, CP, MP
© 2014 IBM Corporation55
Agenda
 IBM ILOG CP Optimizer for Scheduling
 Scheduling concepts in CP Optimizer
 Tips and Tools
 Q&A
© 2014 IBM Corporation56
Bonus material
 List of most useful parameters for search analysis:
–Workers (=1)
–LogPeriod (=1)
–SearchType (=DepthFirst)
–FailLimit, SolutionLimit (=1)
 List of most useful parameters for performance tuning:
–TimeLimit
–TemporalRelaxation (=Off)
–Workers
–SearchType (=Restart|MultiPoint)
–Some inference levels:
• NoOverlapInferenceLevel
• CumulFunctionInferenceLevel
© 2014 IBM Corporation57
Bonus material: classical patterns in scheduling models
 Chain of optional interval variables
–Use cases: any phenomenon that is associated with a set of
consecutive time intervals whose number is not known a-priori
–Examples: partially preemptive activities, intervals during which
a resource is in use, …
 Model is a chain of precedence and implication constraints
between optional interval variables
endBeforeStart(a[i],a[i+1]);
presenceOf(a[i+1]) => presenceOf(a[i]);
 This ensures that only the first k intervals will be present where k
is an implicit decision of the problem
a1 a2 ai ai+1 an... ...
© 2014 IBM Corporation58
Bonus material: classical patterns in scheduling models
 Optional intervals in paths of precedence constraints
–Use case: a precedence graph with optional activities such that
path of precedence constraints going through absent activities
should still be considered
–Example: a → b c, precedence a c should be considered→ →
even if b is absent
–Direct model using endBeforeStart(a,b), endBeforeStart(b,c)
does not work as both constraints are inactive if b is absent
 Idea 1: Add endBeforeStart(x,y) constraints of the transitive
closure. Issue: may add a quadratic number of constraints
 Idea 2: Use additional non-optional interval variables A, B, C of
free length synchronized with a, b, c (startAtStart, endAtEnd)
a b c
A B C
© 2014 IBM Corporation59
Bonus material: classical patterns in scheduling models
 Multi-level alternatives
–Use case: an activity needs to select an element in a Cartesian
product
–Example: an activity A needs 1 worker Wi among n to be
executed at 1 given position Pj among m. Duration depends
both on the worker Wi and the position Pj. Specific constraints
need to be posted on all activities executing at a position Pj
(e.g. space limitation) while other constraints need to be
posted on all activities executed by a given worker Wi (e.g.
noOverlap)
 Idea: create one optional interval variable AW[i] for activity A
executing on worker Wi and one optional interval variable AP[j]
for activity A executing a position Pj
© 2014 IBM Corporation60
Bonus material: classical patterns in scheduling models
 Multi-level alternatives
 Idea: create one optional interval variable AW[i] for activity A
executing on worker Wi and one optional interval variable AP[j]
for activity A executing at position Pj
AW[i]
AW[n]
AW[1]
APW[n][1] APW[n][j] APW[n][m]
APW[i][1] APW[i][j] APW[i][m]
APW[1][1] APW[1][j] APW[1][m]
A AP[1] AP[j] AP[m]
© 2014 IBM Corporation61
Bonus material: classical patterns in scheduling models
 Temporal alternatives
–Alternative constraints are not restricted to model disjunctions
of resources/modes/recipes, they can also be used to
represent temporal disjunction
–Use-case: an activity must execute during a disjunctive set of
possible time-windows
 Alternative models that directly work on interval variable a are
possible (use cumulFunction or forbidExtent). They will be lighter
(less variables) but will propagate less.
a1 a2 a3
a
ALT
© 2014 IBM Corporation62
Bonus material
 Technical papers related with scheduling in CP Optimizer
– P. Vilím, P. Laborie and P. Shaw. “Failure-directed Search for Constraint-based Scheduling”. CP-AI-
OR 2015.
– P. Laborie. “An Optimal Iterative Algorithm for Extracting MUCs in a Black-box Constraint
Network”. ECAI 2014.
– P. Laborie and J. Rogerie. “Temporal linear relaxation in IBM ILOG CP Optimizer”. Journal of
Scheduling, Nov. 2014.
– P. Vilím. “Timetable Edge Finding Filtering Algorithm for Discrete Cumulative Resources”. CP-AI-OR
2011.
– P. Laborie, J. Rogerie, P. Shaw and P. Vilim. "Reasoning with Conditional Time-intervals - Part II:
an Algebraical Model for Resources". FLAIRS 2009.
– P. Laborie. "IBM ILOG CP Optimizer for Detailed Scheduling Illustrated on Three Problems". CP-AI-
OR 2009.
– P. Vilím. "Max Energy Filtering Algorithm for Discrete Cumulative Resources". CP-AI-OR 2009.
– P. Vilím. "Edge finding filtering algorithm for discrete cumulative resources in O(knlog(n))". CP
2009.
– P. Laborie and J. Rogerie. "Reasoning with Conditional Time-intervals". FLAIRS 2008.
– P. Laborie and D. Godard. "Self-Adapting Large Neighborhood Search: Application to single-mode
scheduling problems". MISTA 2007.
– P. Vilím. "Global Constraints in Scheduling". PhD thesis. Charles University, Prague. 2007.
– P. Laborie, D. Godard and W. Nuijten. “Randomized Large Neighborhood Search for Cumulative
Scheduling”. ICAPS 2005.

Contenu connexe

Tendances

Shared Memory Centric Computing with CXL & OMI
Shared Memory Centric Computing with CXL & OMIShared Memory Centric Computing with CXL & OMI
Shared Memory Centric Computing with CXL & OMIAllan Cantle
 
MemVerge: Past Present and Future of CXL
MemVerge: Past Present and Future of CXLMemVerge: Past Present and Future of CXL
MemVerge: Past Present and Future of CXLMemory Fabric Forum
 
If AMD Adopted OMI in their EPYC Architecture
If AMD Adopted OMI in their EPYC ArchitectureIf AMD Adopted OMI in their EPYC Architecture
If AMD Adopted OMI in their EPYC ArchitectureAllan Cantle
 
DesignCon 2019 112-Gbps Electrical Interfaces: An OIF Update on CEI-112G
DesignCon 2019 112-Gbps Electrical Interfaces: An OIF Update on CEI-112GDesignCon 2019 112-Gbps Electrical Interfaces: An OIF Update on CEI-112G
DesignCon 2019 112-Gbps Electrical Interfaces: An OIF Update on CEI-112GLeah Wilkinson
 
Lightelligence: Optical CXL Interconnect for Large Scale Memory Pooling
Lightelligence: Optical CXL Interconnect for Large Scale Memory PoolingLightelligence: Optical CXL Interconnect for Large Scale Memory Pooling
Lightelligence: Optical CXL Interconnect for Large Scale Memory PoolingMemory Fabric Forum
 
Micron: Memory Expansion with CXL Modules: Benefits, Use Cases and Enriching ...
Micron: Memory Expansion with CXL Modules: Benefits, Use Cases and Enriching ...Micron: Memory Expansion with CXL Modules: Benefits, Use Cases and Enriching ...
Micron: Memory Expansion with CXL Modules: Benefits, Use Cases and Enriching ...Memory Fabric Forum
 
Combinatorial optimization CO-1
Combinatorial optimization CO-1Combinatorial optimization CO-1
Combinatorial optimization CO-1man003
 
Quadratic Programming : KKT conditions with inequality constraints
Quadratic Programming : KKT conditions with inequality constraintsQuadratic Programming : KKT conditions with inequality constraints
Quadratic Programming : KKT conditions with inequality constraintsMrinmoy Majumder
 
Decoupling Compute from Memory, Storage and IO with OMI
Decoupling Compute from Memory, Storage and IO with OMIDecoupling Compute from Memory, Storage and IO with OMI
Decoupling Compute from Memory, Storage and IO with OMIAllan Cantle
 
CS8078-Green Computing Question Bank
CS8078-Green Computing Question BankCS8078-Green Computing Question Bank
CS8078-Green Computing Question BankGobinath Subramaniam
 
Particle Swarm Optimization.pptx
Particle Swarm Optimization.pptxParticle Swarm Optimization.pptx
Particle Swarm Optimization.pptxNatiTilahun1
 
CXL Consortium Update: Advancing Coherent Connectivity
CXL Consortium Update: Advancing Coherent ConnectivityCXL Consortium Update: Advancing Coherent Connectivity
CXL Consortium Update: Advancing Coherent ConnectivityMemory Fabric Forum
 
High Performance Computing using MPI
High Performance Computing using MPIHigh Performance Computing using MPI
High Performance Computing using MPIAnkit Mahato
 
Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...
Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...
Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...Ahmed Gad
 
Multicore Computers
Multicore ComputersMulticore Computers
Multicore ComputersA B Shinde
 
High performance computing - building blocks, production & perspective
High performance computing - building blocks, production & perspectiveHigh performance computing - building blocks, production & perspective
High performance computing - building blocks, production & perspectiveJason Shih
 

Tendances (20)

Shared Memory Centric Computing with CXL & OMI
Shared Memory Centric Computing with CXL & OMIShared Memory Centric Computing with CXL & OMI
Shared Memory Centric Computing with CXL & OMI
 
MemVerge: Past Present and Future of CXL
MemVerge: Past Present and Future of CXLMemVerge: Past Present and Future of CXL
MemVerge: Past Present and Future of CXL
 
Combinatorial Optimization
Combinatorial OptimizationCombinatorial Optimization
Combinatorial Optimization
 
If AMD Adopted OMI in their EPYC Architecture
If AMD Adopted OMI in their EPYC ArchitectureIf AMD Adopted OMI in their EPYC Architecture
If AMD Adopted OMI in their EPYC Architecture
 
Zynq architecture
Zynq architectureZynq architecture
Zynq architecture
 
DesignCon 2019 112-Gbps Electrical Interfaces: An OIF Update on CEI-112G
DesignCon 2019 112-Gbps Electrical Interfaces: An OIF Update on CEI-112GDesignCon 2019 112-Gbps Electrical Interfaces: An OIF Update on CEI-112G
DesignCon 2019 112-Gbps Electrical Interfaces: An OIF Update on CEI-112G
 
Kernighan lin
Kernighan linKernighan lin
Kernighan lin
 
Lightelligence: Optical CXL Interconnect for Large Scale Memory Pooling
Lightelligence: Optical CXL Interconnect for Large Scale Memory PoolingLightelligence: Optical CXL Interconnect for Large Scale Memory Pooling
Lightelligence: Optical CXL Interconnect for Large Scale Memory Pooling
 
Micron: Memory Expansion with CXL Modules: Benefits, Use Cases and Enriching ...
Micron: Memory Expansion with CXL Modules: Benefits, Use Cases and Enriching ...Micron: Memory Expansion with CXL Modules: Benefits, Use Cases and Enriching ...
Micron: Memory Expansion with CXL Modules: Benefits, Use Cases and Enriching ...
 
Combinatorial optimization CO-1
Combinatorial optimization CO-1Combinatorial optimization CO-1
Combinatorial optimization CO-1
 
Quadratic Programming : KKT conditions with inequality constraints
Quadratic Programming : KKT conditions with inequality constraintsQuadratic Programming : KKT conditions with inequality constraints
Quadratic Programming : KKT conditions with inequality constraints
 
Decoupling Compute from Memory, Storage and IO with OMI
Decoupling Compute from Memory, Storage and IO with OMIDecoupling Compute from Memory, Storage and IO with OMI
Decoupling Compute from Memory, Storage and IO with OMI
 
CS8078-Green Computing Question Bank
CS8078-Green Computing Question BankCS8078-Green Computing Question Bank
CS8078-Green Computing Question Bank
 
Particle Swarm Optimization.pptx
Particle Swarm Optimization.pptxParticle Swarm Optimization.pptx
Particle Swarm Optimization.pptx
 
CXL Consortium Update: Advancing Coherent Connectivity
CXL Consortium Update: Advancing Coherent ConnectivityCXL Consortium Update: Advancing Coherent Connectivity
CXL Consortium Update: Advancing Coherent Connectivity
 
High Performance Computing using MPI
High Performance Computing using MPIHigh Performance Computing using MPI
High Performance Computing using MPI
 
Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...
Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...
Multi-Objective Optimization using Non-Dominated Sorting Genetic Algorithm wi...
 
Multicore Computers
Multicore ComputersMulticore Computers
Multicore Computers
 
High performance computing - building blocks, production & perspective
High performance computing - building blocks, production & perspectiveHigh performance computing - building blocks, production & perspective
High performance computing - building blocks, production & perspective
 
CXL Fabric Management Standards
CXL Fabric Management StandardsCXL Fabric Management Standards
CXL Fabric Management Standards
 

Similaire à Modeling and Solving Scheduling Problems with CP Optimizer

Conditional interval variables: A powerful concept for modeling and solving c...
Conditional interval variables: A powerful concept for modeling and solving c...Conditional interval variables: A powerful concept for modeling and solving c...
Conditional interval variables: A powerful concept for modeling and solving c...Philippe Laborie
 
Accelerating the Development of Efficient CP Optimizer Models
Accelerating the Development of Efficient CP Optimizer ModelsAccelerating the Development of Efficient CP Optimizer Models
Accelerating the Development of Efficient CP Optimizer ModelsPhilippe Laborie
 
Planning/Scheduling with CP Optimizer
Planning/Scheduling with CP OptimizerPlanning/Scheduling with CP Optimizer
Planning/Scheduling with CP OptimizerPhilippe Laborie
 
CP Optimizer Walkthrough
CP Optimizer WalkthroughCP Optimizer Walkthrough
CP Optimizer WalkthroughPaulShawIBM
 
Recent advances on large scheduling problems in CP Optimizer
Recent advances on large scheduling problems in CP OptimizerRecent advances on large scheduling problems in CP Optimizer
Recent advances on large scheduling problems in CP OptimizerPhilippe Laborie
 
Chapter 2.Linear Programming.pdf
Chapter 2.Linear Programming.pdfChapter 2.Linear Programming.pdf
Chapter 2.Linear Programming.pdfTsegay Berhe
 
Industrial project and machine scheduling with Constraint Programming
Industrial project and machine scheduling with Constraint ProgrammingIndustrial project and machine scheduling with Constraint Programming
Industrial project and machine scheduling with Constraint ProgrammingPhilippe Laborie
 
Model-Based User Interface Optimization: Part I INTRODUCTION - At SICSA Summe...
Model-Based User Interface Optimization: Part I INTRODUCTION - At SICSA Summe...Model-Based User Interface Optimization: Part I INTRODUCTION - At SICSA Summe...
Model-Based User Interface Optimization: Part I INTRODUCTION - At SICSA Summe...Aalto University
 
Optimization: from mathematical tools to real applications
Optimization: from mathematical tools to real applicationsOptimization: from mathematical tools to real applications
Optimization: from mathematical tools to real applicationsPhilippe Laborie
 
Concurrent Root Cut Loops to Exploit Random Performance Variability
Concurrent Root Cut Loops to Exploit Random Performance VariabilityConcurrent Root Cut Loops to Exploit Random Performance Variability
Concurrent Root Cut Loops to Exploit Random Performance VariabilityIBM Decision Optimization
 
Supply Chain Management - Optimization technology
Supply Chain Management - Optimization technologySupply Chain Management - Optimization technology
Supply Chain Management - Optimization technologyNurhazman Abdul Aziz
 
TenYearsCPOptimizer
TenYearsCPOptimizerTenYearsCPOptimizer
TenYearsCPOptimizerPaulShawIBM
 
Objective Landscapes for Constraint Programming
Objective Landscapes for Constraint ProgrammingObjective Landscapes for Constraint Programming
Objective Landscapes for Constraint ProgrammingPhilippe Laborie
 
Innovations in CPLEX performance and solver capabilities
Innovations in CPLEX performance and solver capabilitiesInnovations in CPLEX performance and solver capabilities
Innovations in CPLEX performance and solver capabilitiesIBM Decision Optimization
 
Transfer Learning for Improving Model Predictions in Highly Configurable Soft...
Transfer Learning for Improving Model Predictions in Highly Configurable Soft...Transfer Learning for Improving Model Predictions in Highly Configurable Soft...
Transfer Learning for Improving Model Predictions in Highly Configurable Soft...Pooyan Jamshidi
 
Generalized Capital Investment Planning w/ Sequence-Dependent Setups Industri...
Generalized Capital Investment Planning w/ Sequence-Dependent Setups Industri...Generalized Capital Investment Planning w/ Sequence-Dependent Setups Industri...
Generalized Capital Investment Planning w/ Sequence-Dependent Setups Industri...Alkis Vazacopoulos
 
Prespective analytics with DOcplex and pandas
Prespective analytics with DOcplex and pandasPrespective analytics with DOcplex and pandas
Prespective analytics with DOcplex and pandasPyDataParis
 
Digital twin for ports and terminals schuett slideshare
Digital twin for ports and terminals schuett slideshareDigital twin for ports and terminals schuett slideshare
Digital twin for ports and terminals schuett slideshareHolger Schuett
 
Cs 568 Spring 10 Lecture 5 Estimation
Cs 568 Spring 10  Lecture 5 EstimationCs 568 Spring 10  Lecture 5 Estimation
Cs 568 Spring 10 Lecture 5 EstimationLawrence Bernstein
 

Similaire à Modeling and Solving Scheduling Problems with CP Optimizer (20)

Conditional interval variables: A powerful concept for modeling and solving c...
Conditional interval variables: A powerful concept for modeling and solving c...Conditional interval variables: A powerful concept for modeling and solving c...
Conditional interval variables: A powerful concept for modeling and solving c...
 
Accelerating the Development of Efficient CP Optimizer Models
Accelerating the Development of Efficient CP Optimizer ModelsAccelerating the Development of Efficient CP Optimizer Models
Accelerating the Development of Efficient CP Optimizer Models
 
Planning/Scheduling with CP Optimizer
Planning/Scheduling with CP OptimizerPlanning/Scheduling with CP Optimizer
Planning/Scheduling with CP Optimizer
 
CP Optimizer Walkthrough
CP Optimizer WalkthroughCP Optimizer Walkthrough
CP Optimizer Walkthrough
 
Recent advances on large scheduling problems in CP Optimizer
Recent advances on large scheduling problems in CP OptimizerRecent advances on large scheduling problems in CP Optimizer
Recent advances on large scheduling problems in CP Optimizer
 
Chapter 2.Linear Programming.pdf
Chapter 2.Linear Programming.pdfChapter 2.Linear Programming.pdf
Chapter 2.Linear Programming.pdf
 
Industrial project and machine scheduling with Constraint Programming
Industrial project and machine scheduling with Constraint ProgrammingIndustrial project and machine scheduling with Constraint Programming
Industrial project and machine scheduling with Constraint Programming
 
Model-Based User Interface Optimization: Part I INTRODUCTION - At SICSA Summe...
Model-Based User Interface Optimization: Part I INTRODUCTION - At SICSA Summe...Model-Based User Interface Optimization: Part I INTRODUCTION - At SICSA Summe...
Model-Based User Interface Optimization: Part I INTRODUCTION - At SICSA Summe...
 
Optimization: from mathematical tools to real applications
Optimization: from mathematical tools to real applicationsOptimization: from mathematical tools to real applications
Optimization: from mathematical tools to real applications
 
Concurrent Root Cut Loops to Exploit Random Performance Variability
Concurrent Root Cut Loops to Exploit Random Performance VariabilityConcurrent Root Cut Loops to Exploit Random Performance Variability
Concurrent Root Cut Loops to Exploit Random Performance Variability
 
Supply Chain Management - Optimization technology
Supply Chain Management - Optimization technologySupply Chain Management - Optimization technology
Supply Chain Management - Optimization technology
 
TenYearsCPOptimizer
TenYearsCPOptimizerTenYearsCPOptimizer
TenYearsCPOptimizer
 
Objective Landscapes for Constraint Programming
Objective Landscapes for Constraint ProgrammingObjective Landscapes for Constraint Programming
Objective Landscapes for Constraint Programming
 
Innovations in CPLEX performance and solver capabilities
Innovations in CPLEX performance and solver capabilitiesInnovations in CPLEX performance and solver capabilities
Innovations in CPLEX performance and solver capabilities
 
COCOMO MODEL
COCOMO MODELCOCOMO MODEL
COCOMO MODEL
 
Transfer Learning for Improving Model Predictions in Highly Configurable Soft...
Transfer Learning for Improving Model Predictions in Highly Configurable Soft...Transfer Learning for Improving Model Predictions in Highly Configurable Soft...
Transfer Learning for Improving Model Predictions in Highly Configurable Soft...
 
Generalized Capital Investment Planning w/ Sequence-Dependent Setups Industri...
Generalized Capital Investment Planning w/ Sequence-Dependent Setups Industri...Generalized Capital Investment Planning w/ Sequence-Dependent Setups Industri...
Generalized Capital Investment Planning w/ Sequence-Dependent Setups Industri...
 
Prespective analytics with DOcplex and pandas
Prespective analytics with DOcplex and pandasPrespective analytics with DOcplex and pandas
Prespective analytics with DOcplex and pandas
 
Digital twin for ports and terminals schuett slideshare
Digital twin for ports and terminals schuett slideshareDigital twin for ports and terminals schuett slideshare
Digital twin for ports and terminals schuett slideshare
 
Cs 568 Spring 10 Lecture 5 Estimation
Cs 568 Spring 10  Lecture 5 EstimationCs 568 Spring 10  Lecture 5 Estimation
Cs 568 Spring 10 Lecture 5 Estimation
 

Plus de Philippe Laborie

ICAPS-2020 Industry Session
ICAPS-2020 Industry SessionICAPS-2020 Industry Session
ICAPS-2020 Industry SessionPhilippe Laborie
 
CP Optimizer pour la planification et l'ordonnancement
CP Optimizer pour la planification et l'ordonnancementCP Optimizer pour la planification et l'ordonnancement
CP Optimizer pour la planification et l'ordonnancementPhilippe Laborie
 
An Update on the Comparison of MIP, CP and Hybrid Approaches for Mixed Resour...
An Update on the Comparison of MIP, CP and Hybrid Approaches for Mixed Resour...An Update on the Comparison of MIP, CP and Hybrid Approaches for Mixed Resour...
An Update on the Comparison of MIP, CP and Hybrid Approaches for Mixed Resour...Philippe Laborie
 
CP Optimizer: a generic optimization engine at the crossroad of AI and OR fo...
CP Optimizer: a generic optimization engine at the crossroad of AI and OR  fo...CP Optimizer: a generic optimization engine at the crossroad of AI and OR  fo...
CP Optimizer: a generic optimization engine at the crossroad of AI and OR fo...Philippe Laborie
 
New Results for the GEO-CAPE Observation Scheduling Problem
New Results for the GEO-CAPE Observation Scheduling ProblemNew Results for the GEO-CAPE Observation Scheduling Problem
New Results for the GEO-CAPE Observation Scheduling ProblemPhilippe Laborie
 
Model Presolve, Warmstart and Conflict Refining in CP Optimizer
Model Presolve, Warmstart and Conflict Refining in CP OptimizerModel Presolve, Warmstart and Conflict Refining in CP Optimizer
Model Presolve, Warmstart and Conflict Refining in CP OptimizerPhilippe Laborie
 
Reasoning with Conditional Time-intervals
Reasoning with Conditional Time-intervalsReasoning with Conditional Time-intervals
Reasoning with Conditional Time-intervalsPhilippe Laborie
 
An Optimal Iterative Algorithm for Extracting MUCs in a Black-box Constraint ...
An Optimal Iterative Algorithm for Extracting MUCs in a Black-box Constraint ...An Optimal Iterative Algorithm for Extracting MUCs in a Black-box Constraint ...
An Optimal Iterative Algorithm for Extracting MUCs in a Black-box Constraint ...Philippe Laborie
 
IBM ILOG CP Optimizer for Detailed Scheduling Illustrated on Three Problems
IBM ILOG CP Optimizer for Detailed Scheduling Illustrated on Three ProblemsIBM ILOG CP Optimizer for Detailed Scheduling Illustrated on Three Problems
IBM ILOG CP Optimizer for Detailed Scheduling Illustrated on Three ProblemsPhilippe Laborie
 

Plus de Philippe Laborie (9)

ICAPS-2020 Industry Session
ICAPS-2020 Industry SessionICAPS-2020 Industry Session
ICAPS-2020 Industry Session
 
CP Optimizer pour la planification et l'ordonnancement
CP Optimizer pour la planification et l'ordonnancementCP Optimizer pour la planification et l'ordonnancement
CP Optimizer pour la planification et l'ordonnancement
 
An Update on the Comparison of MIP, CP and Hybrid Approaches for Mixed Resour...
An Update on the Comparison of MIP, CP and Hybrid Approaches for Mixed Resour...An Update on the Comparison of MIP, CP and Hybrid Approaches for Mixed Resour...
An Update on the Comparison of MIP, CP and Hybrid Approaches for Mixed Resour...
 
CP Optimizer: a generic optimization engine at the crossroad of AI and OR fo...
CP Optimizer: a generic optimization engine at the crossroad of AI and OR  fo...CP Optimizer: a generic optimization engine at the crossroad of AI and OR  fo...
CP Optimizer: a generic optimization engine at the crossroad of AI and OR fo...
 
New Results for the GEO-CAPE Observation Scheduling Problem
New Results for the GEO-CAPE Observation Scheduling ProblemNew Results for the GEO-CAPE Observation Scheduling Problem
New Results for the GEO-CAPE Observation Scheduling Problem
 
Model Presolve, Warmstart and Conflict Refining in CP Optimizer
Model Presolve, Warmstart and Conflict Refining in CP OptimizerModel Presolve, Warmstart and Conflict Refining in CP Optimizer
Model Presolve, Warmstart and Conflict Refining in CP Optimizer
 
Reasoning with Conditional Time-intervals
Reasoning with Conditional Time-intervalsReasoning with Conditional Time-intervals
Reasoning with Conditional Time-intervals
 
An Optimal Iterative Algorithm for Extracting MUCs in a Black-box Constraint ...
An Optimal Iterative Algorithm for Extracting MUCs in a Black-box Constraint ...An Optimal Iterative Algorithm for Extracting MUCs in a Black-box Constraint ...
An Optimal Iterative Algorithm for Extracting MUCs in a Black-box Constraint ...
 
IBM ILOG CP Optimizer for Detailed Scheduling Illustrated on Three Problems
IBM ILOG CP Optimizer for Detailed Scheduling Illustrated on Three ProblemsIBM ILOG CP Optimizer for Detailed Scheduling Illustrated on Three Problems
IBM ILOG CP Optimizer for Detailed Scheduling Illustrated on Three Problems
 

Dernier

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 

Dernier (20)

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 

Modeling and Solving Scheduling Problems with CP Optimizer

  • 1. © 2014 IBM Corporation May 28, 2014 IBM Decision Optimization Virtual User Group Meeting Modeling and Solving Scheduling Problems with CP Optimizer Philippe Laborie CPLEX Optimization Studio Team
  • 2. © 2014 IBM Corporation2 Agenda  IBM ILOG CP Optimizer for Scheduling  Scheduling concepts in CP Optimizer  Tips and Tools  Q&A
  • 3. © 2014 IBM Corporation3 IBM ILOG CP Optimizer for Scheduling  Scheduling consist of assigning starting and completion times to a set of activities while satisfying different types of constraints (resource availability, precedence relationships, … ) and optimizing some criteria (minimizing tardiness, …)  Time is considered as a continuous dimension: domain of possible start/completion times for an activity is potentially very large  Beside start and completion times of activities, other types of decision variables are often involved in real industrial scheduling problems (resource allocation, optional activities …) start end Timeactivity
  • 4. © 2014 IBM Corporation4 IBM ILOG CP Optimizer for Scheduling  Modeling and solving scheduling problems Model & run paradigm User-implemented resolution dispatching rules, heuristics, meta-heuristics MIP (CPLEX)
  • 5. © 2014 IBM Corporation5 IBM ILOG CP Optimizer for Scheduling  Modeling and solving scheduling problems – Dedicated modeling concepts for scheduling • Consistent with Optimization paradigm: new decision variables, expressions and constraints • Available in OPL and APIs (C++, Java, .NET) – Automatic search • Complete • Combines tree search, large neighborhood search, meta- heuristics, relaxations, learning, ... Model & run paradigm User-implemented resolution dispatching rules, heuristics, meta-heuristics MIP (CPLEX) CP Optimizer for Scheduling
  • 6. © 2014 IBM Corporation6 Agenda  IBM ILOG CP Optimizer for Scheduling  Scheduling concepts in CP Optimizer  Tips and Tools  Q&A
  • 7. © 2014 IBM Corporation7 Concept: interval variable  What for? –modeling an interval of time during which a particular property holds (an activity executes, a resource is idle, a tank must be non-empty, …)  Example: dvar interval x in 0..1000 size in 10..20 0 1000 Time [10,20] Interval variable
  • 8. © 2014 IBM Corporation8 Concept: interval variable dvar interval x in 0..1000 size in 10..20  Properties: –The value of an interval variable is an integer interval [start,end) –Domain of possible values: [0,10), [1,11), [2,12),... [990,1000), [0,11),[1,12),... –Domain of interval variables is represented compactly in CP Optimizer (a few bounds: smin, smax, emin, emax, szmin, szmax) 0 1000 Time [10,20] Interval variable
  • 9. © 2014 IBM Corporation9 Concepts: optional interval variable  Interval variables can be defined as being optional that is, it is part of the decisions of the problem to decide whether the interval will be present or absent in the solution  What for? –Modeling optional activities, alternative execution modes for activities, and … most of the discrete decisions in a schedule  Example: dvar interval x optional in 0..1000 size in 10..20  Properties: –An optional interval variable has an additional possible value in its domain (absence value) –Optionality is a powerful property that you must learn to leverage in your models (more on this later ...)
  • 10. © 2014 IBM Corporation10 Concept: precedence constraint  What for ? –Modeling temporal constraints between interval variables –  Example: a b endBeforeStart(a,b) startBeforeStart(a,b) startBeforeEnd(a,b) endBeforeEnd(a,b) endAtStart(a,b) startAtStart(a,b) startAtEnd(a,b) endAtEnd(a,b)
  • 11. © 2014 IBM Corporation11 Concept: precedence constraint  What for ? –Modeling temporal constraints between interval variables –Modeling constant or variable minimal delays  Example: a b endBeforeStart(a,b,z) startBeforeStart(a,b,z) startBeforeEnd(a,b,z) endBeforeEnd(a,b,z) endAtStart(a,b,z) startAtStart(a,b,z) startAtEnd(a,b,z) endAtEnd(a,b,z) z
  • 12. © 2014 IBM Corporation12 Concept: precedence constraint  Properties –Semantic of the constraints handles optionality (as for all constraints in CP Optimizer). Example of endBeforeStart: present(a) AND present(b)  end(a)+z  start(b) –All precedence constraints are aggregated in a temporal network and handled by dedicated graph algorithms (fast global propagation, negative cycle detection, ...)
  • 13. © 2014 IBM Corporation13 Concept: presence constraint  What for: –Expressing dependency constraints between execution of optional activities or between allocated resources …  Examples: a b presenceOf(a) => presenceOf(b) presenceOf(a) == presenceOf(b) presenceOf(a) => !presenceOf(b) !presenceOf(a) => presenceOf(b)
  • 14. © 2014 IBM Corporation14 Concept: presence constraint  Properties: –All binary constraints between presence status are aggregated in an implication graph –CP Optimizer maintains hypothetical bounds on interval variables (e.g. start min would the interval be present) –CP Optimizer exploits the implication graph to perform conditional reasoning between related interval variables
  • 15. © 2014 IBM Corporation15 Concept: expressions on interval variables  What for? – Evaluating a characteristic of an interval variable (start, end, size) for use in the objective function or in a constraint  Example: – endOf(a, ABSVAL) takes value ABSVAL if interval a is absent otherwise it takes value e if a is present and a=[s,e) –Typical makespan expression: max(i in 1..n) endOf(a[i])
  • 16. © 2014 IBM Corporation16 Concept: expressions on interval variables  What for? –Evaluating a piecewise linear function at a particular end-point of an interval variable (earliness-tardiness cost, temporal preference)  Example: – endEval(f,a, ABSVAL) takes value ABSVAL if a is absent otherwise it takes value f(e) if a is present and a=[s,e)  Property: –f can be any piecewise linear function (non-continuous, non- convex, ...) f a
  • 17. © 2014 IBM Corporation17 Concept: cumul function  What for? –Modeling and constraining cumulative quantities over time (cumulative use of a discrete resource, level of an inventory with producing and consuming tasks) –Restricting the number of intervals that overlap a given date t –Forcing a minimal number of intervals to overlap a given date t –Complex synchronization constraints between interval variables: e.g. between activities producing/consuming in a tank and the set of time-intervals during which the tank is non-empty
  • 18. © 2014 IBM Corporation18 Concept: cumul function  Cumul functions are built from atomic functions      A cumul function is the sum of atomic functions or their opposite a pulse(a,h) h a stepAtStart(a,h) h a stepAtEnd(a,h) h
  • 19. © 2014 IBM Corporation19 Concept: cumul function  Examples: –cumulFunction f = pulse(a,2)+pulse(b,1)+pulse(c,3) – – – – – – – –Constraint f<=C (global capacity limit) –Constraint alwaysIn(f,t0,t1,Cmin,Cmax) (capacity profile) –Constraint alwaysIn(f,x,Cmin,Cmax) (condition holds over an interval variable x) a b c f
  • 20. © 2014 IBM Corporation20 Concept: cumul function  Properties: –Complexity of cumul functions is independent of the time scale –CP Optimizer is able to reason globally over cumul functions
  • 21. © 2014 IBM Corporation21 Concept: cumul function  Properties: –Compare: • Time-indexed MIP model: • s[i][t]{0,1}: s[i][t]=1 iff a[i] starts at date t • • • • • • • CP Optimizer model: a[i] t t sum(i in …) pulse(a[i],Q[i])  C t, sum(i in …, t' in …) Q[i]*s[i][t'] C ...
  • 22. © 2014 IBM Corporation22 Concept: cumul function  Example: Resource-Constrained Project Scheduling Problem (RCPSP)  Minimization of project makespan a1 a3 a2 a6 a5 a4 a7 a8 R1 R2
  • 23. © 2014 IBM Corporation23 Concept: cumul function  CP Optimizer model for RCPSP:  Comparison of this CP Optimizer model vs a time-indexed MIP model on a set of 300 classical small RCPSP instances (30-120 tasks) + 40 larger ones (900 tasks), time-limit: 2mn, 4 threads
  • 24. © 2014 IBM Corporation24 Concept: cumul function  Comparison of CP Optimizer and MIP performance on RCPSP
  • 25. © 2014 IBM Corporation25 Concept: sequence variable  What for? –modeling sequences of events –constraining the transitions between consecutive events (setup times/costs,...)  Example: dvar sequence s in all(i in Tasks) a[i] noOverlap(s)  Properties: – A value for the sequence variable is a total order on the present interval variables. E.g. a4 a1 a3 a2→ → → –A constraint noOverlap states that intervals of the sequence do not overlap and follows the total order of the sequence a4 a1 a3 a2 Time
  • 26. © 2014 IBM Corporation26 Concept: sequence variable  Properties: –Complexity is independent of the time scale –CP Optimizer is able to reason globally over a sequence variable –Avoid quadratic models over each pair (i,j) of intervals in the sequence  Compare: – Quadratic disjunctive MIP formulation with big-Ms: b[i][j]{0,1}: b[i][j]=1 iff a[i] before a[j] end[i] <= start[j] + M*(1-b[i][j]) end[j] <= start[i] + M*b[i][j] – CP Optimizer model: a[i] Time noOverlap(all(i in …) a[i]) a[j] …
  • 27. © 2014 IBM Corporation27 Concept: sequence variable  Example: Job-shop Scheduling Problem  Minimization of makespan op11 op12 op13 M1 M2 M3 op21 op22 op23 op31 op32 op33 op41 op42 op43
  • 28. © 2014 IBM Corporation28 Concept: sequence variable  CP Optimizer model for Job-shop:  Comparison of this CP Optimizer model vs a disjunctive MIP formulation on a set of 140 classical Job-shop instances (50-2000 tasks), time-limit: 2mn, 4 threads
  • 29. © 2014 IBM Corporation29 Concept: sequence variable  Comparison of CP Optimizer and MIP performance on Job-Shop
  • 30. © 2014 IBM Corporation30 Concept: state function  What for? –Modeling evolution of a state variable over time –Modeling incompatibility relations between activities overlapping a given date t –Synchronizing start/end value of compatible tasks (batching)  Example  Properties –Complexity is independent of the time scale –CP Optimizer is able to reason globally over a state function –Avoid quadratic models over each pair (i,j) of incompatible intervals on the state function Time400˚F 500˚F 500˚F 600˚F
  • 31. © 2014 IBM Corporation31 Concept: span constraint  What for? –Modeling task sub-task decomposition→ –Modeling immobilization time of a resource  Example span(a,[b1,...,bn])  Properties –The constraint of course handles optional interval variables a b3 b4 b1 b2
  • 32. © 2014 IBM Corporation32 Concept: alternative constraint  What for? –Modeling alternative resource/modes/recipes –In general modeling a discrete selection in the schedule  Example alternative(a,[b1,...,bn])  Properties –Conditional reasoning allows a strong pruning on the alternative master interval variable a –Master interval variable a can of course be optional a b3 b1 b2 Absent interval variables Selected interval variableALT
  • 33. © 2014 IBM Corporation33 Concept: span/alternative constraint  What for? –Modeling Work Breakdown Structure  Example Task Recipe 2Recipe 1 Recipe 3 ALT op1 op2 op3 ALT
  • 34. © 2014 IBM Corporation34 Agenda  IBM ILOG CP Optimizer for Scheduling  Scheduling concepts in CP Optimizer  Tips and Tools  Q&A
  • 35. © 2014 IBM Corporation35 Tips and Tools  A measure of complexity of a model: –Number of variables –Number of groups of variables with different semantics –Number of variable types (integer variables / interval variables)  Take advantage of the expressiveness of the CP Optimizer modeling language to compact the model by decreasing the above indicators  In particular if in a scheduling model, you are creating 1 decision variable for each time point t you are usually in bad shape ➔ Exploit the scheduling concepts to reason on time-lines (sequence variables, cumul functions, state functions) and avoid an explicit representation of time
  • 36. © 2014 IBM Corporation36 Tips and Tools  A measure of complexity of a model is the number of constraints  If the number of constraints grows more than linearly with the number of variables or the size of variables domains, the model will probably not scale well  Furthermore, if a set of many small constraints can be reformulated more compactly, this often leads to stronger inference in the engine  Example: when you need to model activities (and more generally intervals of time) that -under some conditions- cannot overlap, think of using sequence variables, noOverlap constraints and/or state functions
  • 37. © 2014 IBM Corporation37 Tips and Tools  Be careful when using composite constraints  In scheduling models, exploit optionality of interval variables  Examples : – presenceOf(a)*endOf(a)+(1-presenceOf(a))*K USE: endOf(a,K) – presenceOf(a) => (10<=startOf(a)) USE: 10<=startOf(a,10)  Remarks: –Exception: Binary logical constraints on presence status (like presenceOf(a) => presenceOf(b)) are handled in a special (and efficient) way in the engine –Except for constraint “presenceOf”, all constraints on scheduling constructs (interval and sequence variables, cumul and state functions) cannot be used in composite constraints
  • 38. © 2014 IBM Corporation38 Tips and Tools  Surrogate constraints may help to reduce the search space  A surrogate constraint is a constraint that does not change the set of solutions (but may be useful for the search by allowing a better pruning of the search space)  Some examples : –Redundant cumul function for alternative resources
  • 39. © 2014 IBM Corporation39 Tips and Tools  Surrogate constraints may help to reduce the search space  A surrogate constraint is a constraint that does not change the set of solutions (but may be useful for the search by allowing a better pruning of the search space)  Some examples : –Redundant cumul function for alternative resources –Redundant precedence constraints a a2 a1 ALT b b2 b1 ALT z11 z22 z12 z21 min(z11,z12,z21,z22)
  • 40. © 2014 IBM Corporation40 Tips and Tools  Some classical patterns in scheduling models –Chain of optional interval variables –Optional intervals in paths of precedence constraints –Multilevel alternatives –Temporal alternatives  See bonus material at the end of the slide deck
  • 41. © 2014 IBM Corporation41 Tips and Tools  Questions: –Why is my model infeasible ? –Search does not find any feasible solution, what should I do ? –Search does not converge fast enough, what should I do ? –Does my model improvement really help?
  • 42. © 2014 IBM Corporation42 Tips and Tools  Why is my model infeasible ? –Conflict refiner Fix/relax model→
  • 43. © 2014 IBM Corporation43 Tips and Tools  The engine log is an essential tool for understanding how the engine behaves on a given model ! ----------------------------------------------------------------------- ! Minimization problem - 110 variables, 100 constraints ! LogPeriod = 100,000 ! Workers = 2 ! Initial process time : 0.00s (0.00s extraction + 0.00s propagation) ! . Log search space : 664.4 (before), 664.4 (after) ! . Memory usage : 1.1 MB (before), 1.2 MB (after) ! Using parallel search with 2 workers. ! ----------------------------------------------------------------------- ! Best Branches Non-fixed W Branch decision * 1,062 739 0.01s 1 - ... * 936 136k 3.69s 1 - 936 300k 85 2 F on op#0#9 ! Time = 4.05s, Explored branches = 450,928, Memory usage = 7.7 MB ! Best Branches Non-fixed W Branch decision * 930 166k 4.55s 1 - 930 200k 110 1 F on op#5#1 ! ----------------------------------------------------------------------- ! Search terminated normally, 17 solutions found. ! Best objective : 930 (optimal - effective tol. is 0) ! Number of branches : 641,352 ! Number of fails : 266,640 ! Total memory usage : 6.9 MB (6.4 MB CP Optimizer + 0.5 MB Concert) ! Time spent in solve : 5.99s (5.99s engine + 0.00s extraction) ! Search speed (br. / s) : 107,070.5 ! ----------------------------------------------------------------------- Problem characteristics
  • 44. © 2014 IBM Corporation44 Tips and Tools  The engine log is an essential tool for understanding how the engine behaves on a given model ! ----------------------------------------------------------------------- ! Minimization problem - 110 variables, 100 constraints ! LogPeriod = 100,000 ! Workers = 2 ! Initial process time : 0.00s (0.00s extraction + 0.00s propagation) ! . Log search space : 664.4 (before), 664.4 (after) ! . Memory usage : 1.1 MB (before), 1.2 MB (after) ! Using parallel search with 2 workers. ! ----------------------------------------------------------------------- ! Best Branches Non-fixed W Branch decision * 1,062 739 0.01s 1 - ... * 936 136k 3.69s 1 - 936 300k 85 2 F on op#0#9 ! Time = 4.05s, Explored branches = 450,928, Memory usage = 7.7 MB ! Best Branches Non-fixed W Branch decision * 930 166k 4.55s 1 - 930 200k 110 1 F on op#5#1 ! ----------------------------------------------------------------------- ! Search terminated normally, 17 solutions found. ! Best objective : 930 (optimal - effective tol. is 0) ! Number of branches : 641,352 ! Number of fails : 266,640 ! Total memory usage : 6.9 MB (6.4 MB CP Optimizer + 0.5 MB Concert) ! Time spent in solve : 5.99s (5.99s engine + 0.00s extraction) ! Search speed (br. / s) : 107,070.5 ! ----------------------------------------------------------------------- Modified parameter values
  • 45. © 2014 IBM Corporation45 Tips and Tools  The engine log is an essential tool for understanding how the engine behaves on a given model ! ----------------------------------------------------------------------- ! Minimization problem - 110 variables, 100 constraints ! LogPeriod = 100,000 ! Workers = 2 ! Initial process time : 0.00s (0.00s extraction + 0.00s propagation) ! . Log search space : 664.4 (before), 664.4 (after) ! . Memory usage : 1.1 MB (before), 1.2 MB (after) ! Using parallel search with 2 workers. ! ----------------------------------------------------------------------- ! Best Branches Non-fixed W Branch decision * 1,062 739 0.01s 1 - ... * 936 136k 3.69s 1 - 936 300k 85 2 F on op#0#9 ! Time = 4.05s, Explored branches = 450,928, Memory usage = 7.7 MB ! Best Branches Non-fixed W Branch decision * 930 166k 4.55s 1 - 930 200k 110 1 F on op#5#1 ! ----------------------------------------------------------------------- ! Search terminated normally, 17 solutions found. ! Best objective : 930 (optimal - effective tol. is 0) ! Number of branches : 641,352 ! Number of fails : 266,640 ! Total memory usage : 6.9 MB (6.4 MB CP Optimizer + 0.5 MB Concert) ! Time spent in solve : 5.99s (5.99s engine + 0.00s extraction) ! Search speed (br. / s) : 107,070.5 ! ----------------------------------------------------------------------- Root node information
  • 46. © 2014 IBM Corporation46 Tips and Tools  The engine log is an essential tool for understanding how the engine behaves on a given model ! ----------------------------------------------------------------------- ! Minimization problem - 110 variables, 100 constraints ! LogPeriod = 100,000 ! Workers = 2 ! Initial process time : 0.00s (0.00s extraction + 0.00s propagation) ! . Log search space : 664.4 (before), 664.4 (after) ! . Memory usage : 1.1 MB (before), 1.2 MB (after) ! Using parallel search with 2 workers. ! ----------------------------------------------------------------------- ! Best Branches Non-fixed W Branch decision * 1,062 739 0.01s 1 - ... * 936 136k 3.69s 1 - 936 300k 85 2 F on op#0#9 ! Time = 4.05s, Explored branches = 450,928, Memory usage = 7.7 MB ! Best Branches Non-fixed W Branch decision * 930 166k 4.55s 1 - 930 200k 110 1 F on op#5#1 ! ----------------------------------------------------------------------- ! Search terminated normally, 17 solutions found. ! Best objective : 930 (optimal - effective tol. is 0) ! Number of branches : 641,352 ! Number of fails : 266,640 ! Total memory usage : 6.9 MB (6.4 MB CP Optimizer + 0.5 MB Concert) ! Time spent in solve : 5.99s (5.99s engine + 0.00s extraction) ! Search speed (br. / s) : 107,070.5 ! ----------------------------------------------------------------------- New incumbent solutions (time, worker)
  • 47. © 2014 IBM Corporation47 Tips and Tools  The engine log is an essential tool for understanding how the engine behaves on a given model ! ----------------------------------------------------------------------- ! Minimization problem - 110 variables, 100 constraints ! LogPeriod = 100,000 ! Workers = 2 ! Initial process time : 0.00s (0.00s extraction + 0.00s propagation) ! . Log search space : 664.4 (before), 664.4 (after) ! . Memory usage : 1.1 MB (before), 1.2 MB (after) ! Using parallel search with 2 workers. ! ----------------------------------------------------------------------- ! Best Branches Non-fixed W Branch decision * 1,062 739 0.01s 1 - ... * 936 136k 3.69s 1 - 936 300k 85 2 F on op#0#9 ! Time = 4.05s, Explored branches = 450,928, Memory usage = 7.7 MB ! Best Branches Non-fixed W Branch decision * 930 166k 4.55s 1 - 930 200k 110 1 F on op#5#1 ! ----------------------------------------------------------------------- ! Search terminated normally, 17 solutions found. ! Best objective : 930 (optimal - effective tol. is 0) ! Number of branches : 641,352 ! Number of fails : 266,640 ! Total memory usage : 6.9 MB (6.4 MB CP Optimizer + 0.5 MB Concert) ! Time spent in solve : 5.99s (5.99s engine + 0.00s extraction) ! Search speed (br. / s) : 107,070.5 ! ----------------------------------------------------------------------- Periodical log with fail information, number of unfixed variables, current decision
  • 48. © 2014 IBM Corporation48 Tips and Tools  The engine log is an essential tool for understanding how the engine behaves on a given model ! ----------------------------------------------------------------------- ! Minimization problem - 110 variables, 100 constraints ! LogPeriod = 100,000 ! Workers = 2 ! Initial process time : 0.00s (0.00s extraction + 0.00s propagation) ! . Log search space : 664.4 (before), 664.4 (after) ! . Memory usage : 1.1 MB (before), 1.2 MB (after) ! Using parallel search with 2 workers. ! ----------------------------------------------------------------------- ! Best Branches Non-fixed W Branch decision * 1,062 739 0.01s 1 - ... * 936 136k 3.69s 1 - 936 300k 85 2 F on op#0#9 ! Time = 4.05s, Explored branches = 450,928, Memory usage = 7.7 MB ! Best Branches Non-fixed W Branch decision * 930 166k 4.55s 1 - 930 200k 110 1 F on op#5#1 ! ----------------------------------------------------------------------- ! Search terminated normally, 17 solutions found. ! Best objective : 930 (optimal - effective tol. is 0) ! Number of branches : 641,352 ! Number of fails : 266,640 ! Total memory usage : 6.9 MB (6.4 MB CP Optimizer + 0.5 MB Concert) ! Time spent in solve : 5.99s (5.99s engine + 0.00s extraction) ! Search speed (br. / s) : 107,070.5 ! ----------------------------------------------------------------------- Final information with solution status and search statistics
  • 49. © 2014 IBM Corporation49 Tips and Tools  Search does not find any feasible solution, what should I do ? –Identify which part of the model is hard: • Simplify problem by removing “easy” constraints • Search log helps (set LogPeriod=1, look where first fails occur) –Strengthen the model: • Be careful with composite constraints • Add surrogate constraints • Break symmetries –Increase inference levels in the engine
  • 50. © 2014 IBM Corporation50 Tips and Tools  Search does not find any feasible solution, what should I do ? –Try using search phases to first focus on the difficult decision variables –Solve the problem as two sub-problems: 1.Finding an initial feasible solution (some difficult constraints can be relaxed and put in the objective function* ), then 2.Optimize starting from this solution. Consider using starting points. –Isolate the different sources of complexity in the model by decomposition and sequential resolutions. Consider using starting points –(*) CP Optimizer's concepts makes it easy to relax part of the model. E.g. make some interval variables optional and maximize number of present intervals, relax deadlines as tardiness costs
  • 51. © 2014 IBM Corporation51 Tips and Tools  Search does not converge fast enough, what should I do ? –Identify and try to isolate the different sources of complexity in your model, first focusing on bottleneck/important parts in a “simplified” model –Exploit results of previous solve as (1) additional constraints and/or (2) starting point and/or (3) heuristic (search phases) –Do not hesitate to use MIP models in some steps, exploit strengths of each technology (MIP/CP) • For instance CP is good at deciding activities start/end times under resource constraints when required resource quantities and activity durations are fixed or mostly depend on activity start/end dates • For problems with very variable resource quantities or activity durations, it makes sense to consider an initial MIP model that works on these variables (example: lot sizing)
  • 52. © 2014 IBM Corporation52 Tips and Tools  Does my model improvement really help? –CP Optimizer's search relies on a stochastic algorithm initialized by a random seed (parameter IloCP::RandomSeed) –For a given model, the solution depends on the random seed –Best solution cost at a given time limit: – – – – – – – – –Is model B better than model A ? Yes Model A Model B cost cost seed=1 seed=1
  • 53. © 2014 IBM Corporation53 Tips and Tools  Does my model improvement really help? –CP Optimizer's search relies on a stochastic algorithm initialized by a random seed (parameter IloCP::RandomSeed) –For a given model, the solution depends on the random seed –Best solution cost at a given time limit: – – – – – – – – –Is model B better than model A ? Yes Model A Model B cost cost seed=1 seed=1 No! Never evaluate a model change on a single instance/seed !
  • 54. © 2014 IBM Corporation54 Conclusion  For scheduling problems, CP Optimizer extends the Model&run paradigm with some (few) general concepts (interval & sequence variables, cumul & state functions, …)  These concepts can be used to model scheduling problems in a compact way that avoids enumeration of time. Typically, the size of a scheduling model in CP Optimizer grows linearly with the size of the data  When combined together these concepts provide an expressive language capable of handling complex and large industrial scheduling problems  The automatic search is complete, it exploits these concepts using an efficient and robust combination of techniques from scheduling theory, meta-heuristics, CP, MP
  • 55. © 2014 IBM Corporation55 Agenda  IBM ILOG CP Optimizer for Scheduling  Scheduling concepts in CP Optimizer  Tips and Tools  Q&A
  • 56. © 2014 IBM Corporation56 Bonus material  List of most useful parameters for search analysis: –Workers (=1) –LogPeriod (=1) –SearchType (=DepthFirst) –FailLimit, SolutionLimit (=1)  List of most useful parameters for performance tuning: –TimeLimit –TemporalRelaxation (=Off) –Workers –SearchType (=Restart|MultiPoint) –Some inference levels: • NoOverlapInferenceLevel • CumulFunctionInferenceLevel
  • 57. © 2014 IBM Corporation57 Bonus material: classical patterns in scheduling models  Chain of optional interval variables –Use cases: any phenomenon that is associated with a set of consecutive time intervals whose number is not known a-priori –Examples: partially preemptive activities, intervals during which a resource is in use, …  Model is a chain of precedence and implication constraints between optional interval variables endBeforeStart(a[i],a[i+1]); presenceOf(a[i+1]) => presenceOf(a[i]);  This ensures that only the first k intervals will be present where k is an implicit decision of the problem a1 a2 ai ai+1 an... ...
  • 58. © 2014 IBM Corporation58 Bonus material: classical patterns in scheduling models  Optional intervals in paths of precedence constraints –Use case: a precedence graph with optional activities such that path of precedence constraints going through absent activities should still be considered –Example: a → b c, precedence a c should be considered→ → even if b is absent –Direct model using endBeforeStart(a,b), endBeforeStart(b,c) does not work as both constraints are inactive if b is absent  Idea 1: Add endBeforeStart(x,y) constraints of the transitive closure. Issue: may add a quadratic number of constraints  Idea 2: Use additional non-optional interval variables A, B, C of free length synchronized with a, b, c (startAtStart, endAtEnd) a b c A B C
  • 59. © 2014 IBM Corporation59 Bonus material: classical patterns in scheduling models  Multi-level alternatives –Use case: an activity needs to select an element in a Cartesian product –Example: an activity A needs 1 worker Wi among n to be executed at 1 given position Pj among m. Duration depends both on the worker Wi and the position Pj. Specific constraints need to be posted on all activities executing at a position Pj (e.g. space limitation) while other constraints need to be posted on all activities executed by a given worker Wi (e.g. noOverlap)  Idea: create one optional interval variable AW[i] for activity A executing on worker Wi and one optional interval variable AP[j] for activity A executing a position Pj
  • 60. © 2014 IBM Corporation60 Bonus material: classical patterns in scheduling models  Multi-level alternatives  Idea: create one optional interval variable AW[i] for activity A executing on worker Wi and one optional interval variable AP[j] for activity A executing at position Pj AW[i] AW[n] AW[1] APW[n][1] APW[n][j] APW[n][m] APW[i][1] APW[i][j] APW[i][m] APW[1][1] APW[1][j] APW[1][m] A AP[1] AP[j] AP[m]
  • 61. © 2014 IBM Corporation61 Bonus material: classical patterns in scheduling models  Temporal alternatives –Alternative constraints are not restricted to model disjunctions of resources/modes/recipes, they can also be used to represent temporal disjunction –Use-case: an activity must execute during a disjunctive set of possible time-windows  Alternative models that directly work on interval variable a are possible (use cumulFunction or forbidExtent). They will be lighter (less variables) but will propagate less. a1 a2 a3 a ALT
  • 62. © 2014 IBM Corporation62 Bonus material  Technical papers related with scheduling in CP Optimizer – P. Vilím, P. Laborie and P. Shaw. “Failure-directed Search for Constraint-based Scheduling”. CP-AI- OR 2015. – P. Laborie. “An Optimal Iterative Algorithm for Extracting MUCs in a Black-box Constraint Network”. ECAI 2014. – P. Laborie and J. Rogerie. “Temporal linear relaxation in IBM ILOG CP Optimizer”. Journal of Scheduling, Nov. 2014. – P. Vilím. “Timetable Edge Finding Filtering Algorithm for Discrete Cumulative Resources”. CP-AI-OR 2011. – P. Laborie, J. Rogerie, P. Shaw and P. Vilim. "Reasoning with Conditional Time-intervals - Part II: an Algebraical Model for Resources". FLAIRS 2009. – P. Laborie. "IBM ILOG CP Optimizer for Detailed Scheduling Illustrated on Three Problems". CP-AI- OR 2009. – P. Vilím. "Max Energy Filtering Algorithm for Discrete Cumulative Resources". CP-AI-OR 2009. – P. Vilím. "Edge finding filtering algorithm for discrete cumulative resources in O(knlog(n))". CP 2009. – P. Laborie and J. Rogerie. "Reasoning with Conditional Time-intervals". FLAIRS 2008. – P. Laborie and D. Godard. "Self-Adapting Large Neighborhood Search: Application to single-mode scheduling problems". MISTA 2007. – P. Vilím. "Global Constraints in Scheduling". PhD thesis. Charles University, Prague. 2007. – P. Laborie, D. Godard and W. Nuijten. “Randomized Large Neighborhood Search for Cumulative Scheduling”. ICAPS 2005.