SlideShare a Scribd company logo
© 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.

More Related Content

What's hot

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
Philippe Laborie
 
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
Philippe Laborie
 
Constraint Programming - An Alternative Approach to Heuristics in Scheduling
Constraint Programming - An Alternative Approach to Heuristics in SchedulingConstraint Programming - An Alternative Approach to Heuristics in Scheduling
Constraint Programming - An Alternative Approach to Heuristics in Scheduling
Eray Cakici
 
Tsp branch and-bound
Tsp branch and-boundTsp branch and-bound
Tsp branch and-bound
Saravanan Natarajan
 
Gomory's cutting plane method
Gomory's cutting plane methodGomory's cutting plane method
Gomory's cutting plane method
Rajesh Piryani
 
Approximation algorithms
Approximation algorithmsApproximation algorithms
Approximation algorithms
Ganesh Solanke
 
Traveling salesman problem
Traveling salesman problemTraveling salesman problem
Traveling salesman problem
Jayesh Chauhan
 
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
Mrinmoy Majumder
 
Scheduling jobs on identical parallel machines
Scheduling jobs on identical parallel machinesScheduling jobs on identical parallel machines
Scheduling jobs on identical parallel machines
sadasidha08
 
LINEAR PROGRAMMING
LINEAR PROGRAMMINGLINEAR PROGRAMMING
LINEAR PROGRAMMING
rashi9
 
Time-table Scheduling
Time-table SchedulingTime-table Scheduling
Time-table Scheduling
Evren E
 
Approximation Algorithms
Approximation AlgorithmsApproximation Algorithms
Approximation Algorithms
Nicolas Bettenburg
 
Integer Linear Programming
Integer Linear ProgrammingInteger Linear Programming
Integer Linear Programming
SukhpalRamanand
 
Linear Programming 1
Linear Programming 1Linear Programming 1
Linear Programming 1
irsa javed
 
Lecture27 linear programming
Lecture27 linear programmingLecture27 linear programming
Lecture27 linear programming
Dr Sandeep Kumar Poonia
 
Network flow problems
Network flow problemsNetwork flow problems
Network flow problems
Dr Sandeep Kumar Poonia
 
Direct and indirect methods
Direct and indirect methodsDirect and indirect methods
Direct and indirect methods
Ejaz hussain
 
lecture 26
lecture 26lecture 26
lecture 26
sajinsc
 
Knapsack problem and Memory Function
Knapsack problem and Memory FunctionKnapsack problem and Memory Function
Knapsack problem and Memory Function
Barani Tharan
 
Mining the CPLEX Node Log for Faster MIP Performance
Mining the CPLEX Node Log for Faster MIP PerformanceMining the CPLEX Node Log for Faster MIP Performance
Mining the CPLEX Node Log for Faster MIP Performance
IBM Decision Optimization
 

What's hot (20)

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
 
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
 
Constraint Programming - An Alternative Approach to Heuristics in Scheduling
Constraint Programming - An Alternative Approach to Heuristics in SchedulingConstraint Programming - An Alternative Approach to Heuristics in Scheduling
Constraint Programming - An Alternative Approach to Heuristics in Scheduling
 
Tsp branch and-bound
Tsp branch and-boundTsp branch and-bound
Tsp branch and-bound
 
Gomory's cutting plane method
Gomory's cutting plane methodGomory's cutting plane method
Gomory's cutting plane method
 
Approximation algorithms
Approximation algorithmsApproximation algorithms
Approximation algorithms
 
Traveling salesman problem
Traveling salesman problemTraveling salesman problem
Traveling salesman problem
 
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
 
Scheduling jobs on identical parallel machines
Scheduling jobs on identical parallel machinesScheduling jobs on identical parallel machines
Scheduling jobs on identical parallel machines
 
LINEAR PROGRAMMING
LINEAR PROGRAMMINGLINEAR PROGRAMMING
LINEAR PROGRAMMING
 
Time-table Scheduling
Time-table SchedulingTime-table Scheduling
Time-table Scheduling
 
Approximation Algorithms
Approximation AlgorithmsApproximation Algorithms
Approximation Algorithms
 
Integer Linear Programming
Integer Linear ProgrammingInteger Linear Programming
Integer Linear Programming
 
Linear Programming 1
Linear Programming 1Linear Programming 1
Linear Programming 1
 
Lecture27 linear programming
Lecture27 linear programmingLecture27 linear programming
Lecture27 linear programming
 
Network flow problems
Network flow problemsNetwork flow problems
Network flow problems
 
Direct and indirect methods
Direct and indirect methodsDirect and indirect methods
Direct and indirect methods
 
lecture 26
lecture 26lecture 26
lecture 26
 
Knapsack problem and Memory Function
Knapsack problem and Memory FunctionKnapsack problem and Memory Function
Knapsack problem and Memory Function
 
Mining the CPLEX Node Log for Faster MIP Performance
Mining the CPLEX Node Log for Faster MIP PerformanceMining the CPLEX Node Log for Faster MIP Performance
Mining the CPLEX Node Log for Faster MIP Performance
 

Similar to Modeling and Solving Scheduling Problems with CP Optimizer

CP Optimizer Walkthrough
CP Optimizer WalkthroughCP Optimizer Walkthrough
CP Optimizer Walkthrough
PaulShawIBM
 
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
Philippe Laborie
 
Chapter 2.Linear Programming.pdf
Chapter 2.Linear Programming.pdfChapter 2.Linear Programming.pdf
Chapter 2.Linear Programming.pdf
Tsegay Berhe
 
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 applications
Philippe 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 Variability
IBM Decision Optimization
 
Supply Chain Management - Optimization technology
Supply Chain Management - Optimization technologySupply Chain Management - Optimization technology
Supply Chain Management - Optimization technology
Nurhazman Abdul Aziz
 
TenYearsCPOptimizer
TenYearsCPOptimizerTenYearsCPOptimizer
TenYearsCPOptimizer
PaulShawIBM
 
Objective Landscapes for Constraint Programming
Objective Landscapes for Constraint ProgrammingObjective Landscapes for Constraint Programming
Objective Landscapes for Constraint Programming
Philippe 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 capabilities
IBM Decision Optimization
 
COCOMO MODEL
COCOMO MODELCOCOMO MODEL
COCOMO MODEL
movie_2009
 
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 pandas
PyDataParis
 
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
Holger 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 Estimation
Lawrence Bernstein
 
What's New in the Timeseries Toolkit for IBM InfoSphere Streams V4.0
What's New in the Timeseries Toolkit for IBM InfoSphere Streams V4.0What's New in the Timeseries Toolkit for IBM InfoSphere Streams V4.0
What's New in the Timeseries Toolkit for IBM InfoSphere Streams V4.0
lisanl
 
Workflow Allocations and Scheduling on IaaS Platforms, from Theory to Practice
Workflow Allocations and Scheduling on IaaS Platforms, from Theory to PracticeWorkflow Allocations and Scheduling on IaaS Platforms, from Theory to Practice
Workflow Allocations and Scheduling on IaaS Platforms, from Theory to Practice
Frederic Desprez
 
Apache SystemML Optimizer and Runtime techniques by Arvind Surve and Matthias...
Apache SystemML Optimizer and Runtime techniques by Arvind Surve and Matthias...Apache SystemML Optimizer and Runtime techniques by Arvind Surve and Matthias...
Apache SystemML Optimizer and Runtime techniques by Arvind Surve and Matthias...
Arvind Surve
 
Apache SystemML Optimizer and Runtime techniques by Arvind Surve and Matthias...
Apache SystemML Optimizer and Runtime techniques by Arvind Surve and Matthias...Apache SystemML Optimizer and Runtime techniques by Arvind Surve and Matthias...
Apache SystemML Optimizer and Runtime techniques by Arvind Surve and Matthias...
Arvind Surve
 

Similar to Modeling and Solving Scheduling Problems with CP Optimizer (20)

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
 
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
 
What's New in the Timeseries Toolkit for IBM InfoSphere Streams V4.0
What's New in the Timeseries Toolkit for IBM InfoSphere Streams V4.0What's New in the Timeseries Toolkit for IBM InfoSphere Streams V4.0
What's New in the Timeseries Toolkit for IBM InfoSphere Streams V4.0
 
Workflow Allocations and Scheduling on IaaS Platforms, from Theory to Practice
Workflow Allocations and Scheduling on IaaS Platforms, from Theory to PracticeWorkflow Allocations and Scheduling on IaaS Platforms, from Theory to Practice
Workflow Allocations and Scheduling on IaaS Platforms, from Theory to Practice
 
Apache SystemML Optimizer and Runtime techniques by Arvind Surve and Matthias...
Apache SystemML Optimizer and Runtime techniques by Arvind Surve and Matthias...Apache SystemML Optimizer and Runtime techniques by Arvind Surve and Matthias...
Apache SystemML Optimizer and Runtime techniques by Arvind Surve and Matthias...
 
Apache SystemML Optimizer and Runtime techniques by Arvind Surve and Matthias...
Apache SystemML Optimizer and Runtime techniques by Arvind Surve and Matthias...Apache SystemML Optimizer and Runtime techniques by Arvind Surve and Matthias...
Apache SystemML Optimizer and Runtime techniques by Arvind Surve and Matthias...
 

More from Philippe Laborie

ICAPS-2020 Industry Session
ICAPS-2020 Industry SessionICAPS-2020 Industry Session
ICAPS-2020 Industry Session
Philippe 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'ordonnancement
Philippe 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 Problem
Philippe 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 Optimizer
Philippe Laborie
 
Reasoning with Conditional Time-intervals
Reasoning with Conditional Time-intervalsReasoning with Conditional Time-intervals
Reasoning with Conditional Time-intervals
Philippe 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
 

More from Philippe Laborie (8)

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 ...
 

Recently uploaded

fiscal year variant fiscal year variant.
fiscal year variant fiscal year variant.fiscal year variant fiscal year variant.
fiscal year variant fiscal year variant.
AnkitaPandya11
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
ShulagnaSarkar2
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
GohKiangHock
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
Massimo Artizzu
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
mz5nrf0n
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
TaghreedAltamimi
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
YousufSait3
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
gapen1
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 

Recently uploaded (20)

fiscal year variant fiscal year variant.
fiscal year variant fiscal year variant.fiscal year variant fiscal year variant.
fiscal year variant fiscal year variant.
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 

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.