SlideShare ist ein Scribd-Unternehmen logo
1 von 40
Downloaden Sie, um offline zu lesen
May 25, 2016
© 2016 IBM Corporation
An introduction to CP Optimizer
Philippe Laborie
IBM Analytics, Decision Optimization
© 2016 IBM Corporation2
Outline
1) Overview of CP Optimizer
2) Modeling concepts
3) Automatic search
4) Development tools
© 2016 IBM Corporation3
Overview of CP Optimizer
 A component of IBM ILOG CPLEX Optimization Studio
 A Constraint Programming engine for combinatorial problems
(including scheduling problems)
 Implements a Model & Run paradigm (like CPLEX)
– Model: Concise yet expressive modeling language
– Run: Powerful automatic search procedure
Search algorithm is complete
 Available through the following interfaces:
– OPL
– C++ (native interface)
– Python, Java, .NET (wrapping of the C++ engine)
 Set of tools to support the development of efficient models
© 2016 IBM Corporation4
Overview of CP Optimizer
 First version in 2007/2008
 Search “CP Optimizer” on Google Scholar to get an idea of how
CP Optimizer is being used across academy and industry
2007 2008 2009 2010 2011 2012 2013 2014 2015
0
10
20
30
40
50
60
70
80
90
100
Google Scholar citations (“CP Optimizer”) per year
© 2016 IBM Corporation5
Overview of CP Optimizer
User model
OPL,C++,Python,Java,.NET
Model
Solution Automatic Solve
 Model & Run paradigm
© 2016 IBM Corporation6
Overview of CP Optimizer
© 2016 IBM Corporation7
Overview of CP Optimizer
Interval variables
© 2016 IBM Corporation8
Overview of CP Optimizer
Functions
© 2016 IBM Corporation9
Modeling concepts
 Two main types of decision variables:
– Integer variables
– Interval variables
© 2016 IBM Corporation10
Modeling concepts (integer variables)
Variables Expressions Constraints
Variables are discrete
integer
Domains can be
specified as a range
[1..50] or as a set of
values {1, 3, 5, 7, 9}
dvar int x in 1..50
Expressions can be integer or
floating-point, for example
0.37*y is allowed
Basic arithmetic (+,-,*,/) and
more complex operators
(min, max, log, pow etc.) are
supported
Relational expressions can be
treated as 0-1 expressions.
e.g. x = (y < z)
Special expressions:
x == a[y]
x == count(Y, 3)
y == cond ? y : z
Rich set of constraints:
Standard relational constraints
(==, !=, <, >, <=, >=)
Logical combinators
(&&, ||, !, =>)
Specialized (global) constraints
allDifferent(X)
allowedAssignments(X, tuples)
forbiddenAssignments(X, tuples)
pack(load, container, size)
lexicographic(X,Y)
inverse(X,Y)
© 2016 IBM Corporation11
Modeling concepts (interval variables for scheduling)
 Scheduling (our definition of):
– 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
© 2016 IBM Corporation12
Modeling concepts (interval variables for scheduling)
 Extension of classical CSP with a new type of decision variable:
optional interval variable :
Domain(x) Í {}  { [s,e) | s,e, s≤e }
 Introduction of mathematical notions such as sequences and
functions to capture temporal aspects of scheduling problems
Absent interval Interval of
integers
© 2016 IBM Corporation13
Modeling concepts (interval variables for scheduling)
 In scheduling models, interval variables usually represent an
interval of time whose end-points (start/end) are decision
variables of the problem
 Examples:
– A production order, an operation in a production order
– A sub-project in a project, a task in a sub-project
– A batch of operations
– The setup of a tool on a machine
– The moving of an item by a transportation device
– The utilization interval of a machine
– The filling or emptying of a tank
 Idea of the model (and search) is to avoid the enumeration of
start/end values
© 2016 IBM Corporation14
Modeling concepts (interval variables for scheduling)
 An interval variable can be optional meaning that it is a decision
to have it present or absent in a solution.
 Examples:
– Unperformed tasks and optional sub-projects
– Alternative resources, modes or recipes for processing an order, each
mode specifying a particular combination of operational resources
– Operations that can be processed in different temporal modes (e.g.
series or parallel), left unperformed or externalized
– Activities that can be performed in an alternative set of batches or
shifts
© 2016 IBM Corporation15
Example: Resource Constrained Project Scheduling Problem
 RCPSP: a very classical academical scheduling problem
– Tasks ai
with fixed processing time Pi
– Precedence constraints
– Discrete resources with limited instantaneous capacity Rk
– Tasks require some quantity of discrete resources
– Objective is to minimize the schedule makespan
a1
a3
a2
a6
a5
a4
a7
a8
R1
R2
© 2016 IBM Corporation16
Example: Resource Constrained Project Scheduling Problem
 RCPSP: Standard time-indexed MIP formulation
ai
Pi
xit
 {0,1}
© 2016 IBM Corporation17
Example: Resource Constrained Project Scheduling Problem
 Basic CP Optimizer model for RCPSP:
© 2016 IBM Corporation18
Example: Resource Constrained Project Scheduling Problem
 Comparison of this time-indexed MIP formulation against the CP
Optimizer model on a set of:
– 300 classical small RCPSP instances (30-120 tasks) +
– 40 slightly more realistic larger ones (900 tasks)
– time-limit: 2mn, 4 threads
 Note: industrial scheduling problems are often much larger,
typically several 1.000 tasks (we handled up to 1.000.000 tasks in
an RCPSP-like scheduling application in V12.6)
© 2016 IBM Corporation19
Example: Resource Constrained Project Scheduling Problem
 Comparison of CP Optimizer and MIP performance on RCPSP
© 2016 IBM Corporation20
Example: Job-shop Scheduling Problem
 Example: Job-shop Scheduling Problem
 Minimization of makespan
op11 op12 op13
M1
M2
M3
op21 op22 op23
op31 op32 op33
op41 op42 op43
© 2016 IBM Corporation21
Example: Job-shop Scheduling Problem
 CP Optimizer model for Job-shop:
© 2016 IBM Corporation22
Example: Job-shop Scheduling Problem
 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]
…
© 2016 IBM Corporation23
Example: Job-shop Scheduling Problem
 Comparison of the 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
 See [1] for some comparisons against more sophisticated MIP
models for Job-shop scheduling (but with similar conclusions)
[1] W.Y. Ku and J. C. Beck. Mixed Integer Programming Models for Job Shop
Scheduling: A Computational Analysis. Computers & Operations Research,
2016
© 2016 IBM Corporation24
Example: Job-shop Scheduling Problem
 Comparison of CP Optimizer and MIP performance on Job-Shop
© 2016 IBM Corporation25
Example: Flexible Job-shop Scheduling Problem
 CP Optimizer model
© 2016 IBM Corporation26
CP Optimizer modeling concepts
 CP Optimizer has mathematical concepts that naturally map to
features invariably found in industrial scheduling problems
Optional interval
variables
Intensity functions
Sequence variables
Cumul functions
Optional activities
Over-constrained problems
Resource alloc. / alternatives
Work-breakdown structures
Calendars
Resource efficiency Unary resources
Setup times/costs
Travel times/costs
Cumulative resources
Inventories
Reservoirs
General arithmetical
expressions
Earliness/tardiness costs
Net Present Value
State functions
Parallel batches,
Activity incompatibilities
© 2016 IBM Corporation27
Automatic Search
 Search algorithm is Complete
 Core CP techniques used as a building block:
– Tree search (Depth First)
– Constraint propagation
 But also:
– Deterministic multicore parallelism
– Model presolve
– Algorithms portfolios
– Machine learning
– Restarting techniques
– Large Neighborhood Search
– No-good learning
– Impact-based branching
– Opportunistic probing
– Dominance rules
– LP-assisted heuristics
– Randomization
– Evolutionary algorithms
© 2016 IBM Corporation28
Automatic Search – Constraint propagation
 Dedicated Propagation Algorithms for Scheduling
– Edge-Finding
– Not-First/Not-Last
– Detectable Precedences
– Timetable
– Timetable Edge-Finding
– Max Energy Filtering
– etc.
Edge-Finding: C cannot start before 18.
© 2016 IBM Corporation29
Automatic Search – Large Neighborhood Search (LNS)
 LNS is able to converge very quickly to quality solutions
1) Start with an existing solution
© 2016 IBM Corporation30
Automatic Search – Large Neighborhood Search (LNS)
 LNS is able to converge very quickly to quality solutions
1) Start with an existing solution
2)Take part the solution and relax it, fix structure of the rest (but not
start/end times)
relax keep rigid
© 2016 IBM Corporation31
Automatic Search – Large Neighborhood Search (LNS)
 LNS is able to converge very quickly to quality solutions
1) Start with an existing solution
2)Take part the solution and relax it, fix structure of the rest (but not
start/end times)
relax keep rigid
© 2016 IBM Corporation32
Automatic Search – Large Neighborhood Search (LNS)
 LNS is able to converge very quickly to quality solutions
1) Start with an existing solution
2)Take part the solution and relax it, fix structure of the rest (but not
start/end times)
3) Find (improved) solution
improve kept rigid
© 2016 IBM Corporation33
Automatic Search – LP-assisted heuristics
 Traditionally, early/tardy problems are challenging for CP-based
scheduling tools as they miss a good global view of the cost
 Approach:
– Automatically use CPLEX's LP solver to provide a solution to a relaxed
version of the problem
– Use the LP solution to guide heuristics. Start an operation as close as
possible to the time proposed by CPLEX
 What is linearized?
– Precedences
– Execution / non-execution costs, logical constraints on optional intervals
– “Alternative” and “Span” constraints
– Cost function terms which are functions of start/end times
cost
x
cost
x
cost
x
cost
x
cost
x
© 2016 IBM Corporation34
Automatic Search: some results
© 2016 IBM Corporation35
Automatic Search: some results
– Problem #1: Flow-shop with earliness/tardiness cost
– Problem #2: Oversubscribed Satellite Scheduling problem
– Problem #3: Personal tasks scheduling
© 2016 IBM Corporation36
Automatic Search: some results
© 2016 IBM Corporation37
Automatic Search: some results
 Industrial Modelling Competition at CP 2015
 http://booleconferences.ucc.ie/indmodellingcomp
 CP Optimizer outperformed all the other competitors on all the
instances of the challenge
© 2016 IBM Corporation38
Automatic Search
 Some CP Optimizer industrial applications:
– Port Management: Yantian International Container Terminals, Navis
– Manufacturing: Ajover S.A. (plastics), TAL Group (textiles), Danieli
(metallurgy)
– Aviation: Dassault Aviation, another large jet manufacturer
– Workforce scheduling: A world leading IFS (Integrated Facility
Services) company
© 2016 IBM Corporation39
Warnings
Warm start
Development tools
User model
Internal model
Model analysis Model presolve
Conflict
Model
Solution
CPO file
Search log
Failure explainer
Automatic Solve
Conflict refinerFail expl.
OPL,C++,Python,Java,.NET
© 2016 IBM Corporation40
CPLEX and CP Optimizer are in the same ecosystem
CPLEX CP Optimizer
Interfaces OPL, C++, Java, .NET, C,
Python
OPL, C++, Java, .NET,
Python
Model Decision variables int, float int, interval
Expressions linear, quadratic arithmetic, log, pow, …
relational, a[x], count,...
Constraints range relational, logical,
specialized, scheduling
Search Search parameters
Warm start
Multi-core //
Tools Search log
I/O format .lp, .mps, ... .cpo
Conflict refiner

Weitere ähnliche Inhalte

Was ist angesagt?

Chapitre 2 le recuit simulé
Chapitre 2 le recuit simuléChapitre 2 le recuit simulé
Chapitre 2 le recuit simulé
Achraf Manaa
 
Chapitre 3 la recherche tabou
Chapitre 3 la recherche tabouChapitre 3 la recherche tabou
Chapitre 3 la recherche tabou
Achraf Manaa
 

Was ist angesagt? (20)

Optimisation et planification optimale multi-objectifs
Optimisation et  planification optimale multi-objectifsOptimisation et  planification optimale multi-objectifs
Optimisation et planification optimale multi-objectifs
 
P, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardP, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-Hard
 
Chapitre 4 heuristiques et méta heuristiques
Chapitre 4 heuristiques et méta heuristiquesChapitre 4 heuristiques et méta heuristiques
Chapitre 4 heuristiques et méta heuristiques
 
optimisation cours.pdf
optimisation cours.pdfoptimisation cours.pdf
optimisation cours.pdf
 
Multi Objective Optimization
Multi Objective OptimizationMulti Objective Optimization
Multi Objective Optimization
 
Recheche tabou
Recheche tabouRecheche tabou
Recheche tabou
 
Multiobjective optimization and trade offs using pareto optimality
Multiobjective optimization and trade offs using pareto optimalityMultiobjective optimization and trade offs using pareto optimality
Multiobjective optimization and trade offs using pareto optimality
 
Chapitre 2 le recuit simulé
Chapitre 2 le recuit simuléChapitre 2 le recuit simulé
Chapitre 2 le recuit simulé
 
Aide à la Décision Multicritère
Aide à la Décision MulticritèreAide à la Décision Multicritère
Aide à la Décision Multicritère
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 
Algorithme de colonies de fourmis pres.pptx
Algorithme de colonies de fourmis pres.pptxAlgorithme de colonies de fourmis pres.pptx
Algorithme de colonies de fourmis pres.pptx
 
Optimization problems and algorithms
Optimization problems and  algorithmsOptimization problems and  algorithms
Optimization problems and algorithms
 
Dynamic Programming
Dynamic ProgrammingDynamic Programming
Dynamic Programming
 
Definition of linear programming problem model decision variable, objective ...
Definition of linear programming problem model decision variable, objective ...Definition of linear programming problem model decision variable, objective ...
Definition of linear programming problem model decision variable, objective ...
 
Chapitre 3 la recherche tabou
Chapitre 3 la recherche tabouChapitre 3 la recherche tabou
Chapitre 3 la recherche tabou
 
Apprentissage automatique, Régression Ridge et LASSO
Apprentissage automatique, Régression Ridge et LASSOApprentissage automatique, Régression Ridge et LASSO
Apprentissage automatique, Régression Ridge et LASSO
 
Automata
AutomataAutomata
Automata
 
Swarm intelligence algorithms
Swarm intelligence algorithmsSwarm intelligence algorithms
Swarm intelligence algorithms
 
Knapsack problem using greedy approach
Knapsack problem using greedy approachKnapsack problem using greedy approach
Knapsack problem using greedy approach
 
Np completeness
Np completenessNp completeness
Np completeness
 

Andere mochten auch

Wsd as distributed constraint optimization problem
Wsd as distributed constraint optimization problemWsd as distributed constraint optimization problem
Wsd as distributed constraint optimization problem
lolokikipipi
 

Andere mochten auch (20)

Modeling and Solving Scheduling Problems with CP Optimizer
Modeling and Solving Scheduling Problems with CP OptimizerModeling and Solving Scheduling Problems with CP Optimizer
Modeling and Solving Scheduling Problems with CP Optimizer
 
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
 
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...
 
CP Optimizer Walkthrough
CP Optimizer WalkthroughCP Optimizer Walkthrough
CP Optimizer Walkthrough
 
Cp04invitedslide
Cp04invitedslideCp04invitedslide
Cp04invitedslide
 
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
 
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
 
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
 
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 ...
 
Local coordination in online distributed constraint optimization problems - P...
Local coordination in online distributed constraint optimization problems - P...Local coordination in online distributed constraint optimization problems - P...
Local coordination in online distributed constraint optimization problems - P...
 
Wsd as distributed constraint optimization problem
Wsd as distributed constraint optimization problemWsd as distributed constraint optimization problem
Wsd as distributed constraint optimization problem
 
Opl
OplOpl
Opl
 
Product Mix Optimization Case Study - OPL/ CPLEX Code
Product Mix Optimization Case Study - OPL/ CPLEX Code Product Mix Optimization Case Study - OPL/ CPLEX Code
Product Mix Optimization Case Study - OPL/ CPLEX Code
 
Logica | Intelligent Self learning - a helping hand in financial crime
Logica | Intelligent Self learning - a helping hand in financial crimeLogica | Intelligent Self learning - a helping hand in financial crime
Logica | Intelligent Self learning - a helping hand in financial crime
 
Portfolio Optimization Under Uncertainty
Portfolio Optimization Under UncertaintyPortfolio Optimization Under Uncertainty
Portfolio Optimization Under Uncertainty
 
Achieving Asset Optimization: A Strategic Approach To Aligning Assets With Mi...
Achieving Asset Optimization: A Strategic Approach To Aligning Assets With Mi...Achieving Asset Optimization: A Strategic Approach To Aligning Assets With Mi...
Achieving Asset Optimization: A Strategic Approach To Aligning Assets With Mi...
 
Lessonslearnedeuro
LessonslearnedeuroLessonslearnedeuro
Lessonslearnedeuro
 
Marketing Optimization in Financial Services
Marketing Optimization in Financial ServicesMarketing Optimization in Financial Services
Marketing Optimization in Financial Services
 
Ux trend report 2014 finance
Ux trend report 2014 financeUx trend report 2014 finance
Ux trend report 2014 finance
 

Ähnlich wie An introduction to CP Optimizer

A (Not So Short) Introduction to CP Optimizer for Scheduling
A (Not So Short) Introduction to CP Optimizer for SchedulingA (Not So Short) Introduction to CP Optimizer for Scheduling
A (Not So Short) Introduction to CP Optimizer for Scheduling
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
 
Advanced Modeling of Industrial Optimization Problems
Advanced Modeling of Industrial Optimization ProblemsAdvanced Modeling of Industrial Optimization Problems
Advanced Modeling of Industrial Optimization Problems
Alkis Vazacopoulos
 

Ähnlich wie An introduction to CP Optimizer (20)

Prespective analytics with DOcplex and pandas
Prespective analytics with DOcplex and pandasPrespective analytics with DOcplex and pandas
Prespective analytics with DOcplex and pandas
 
TenYearsCPOptimizer
TenYearsCPOptimizerTenYearsCPOptimizer
TenYearsCPOptimizer
 
A (Not So Short) Introduction to CP Optimizer for Scheduling
A (Not So Short) Introduction to CP Optimizer for SchedulingA (Not So Short) Introduction to CP Optimizer for Scheduling
A (Not So Short) Introduction to CP Optimizer for Scheduling
 
Fdp session rtu session 1
Fdp session rtu session 1Fdp session rtu session 1
Fdp session rtu session 1
 
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
 
Software_effort_estimation for Software engineering.pdf
Software_effort_estimation for Software engineering.pdfSoftware_effort_estimation for Software engineering.pdf
Software_effort_estimation for Software engineering.pdf
 
Towards Holistic Continuous Software Performance Assessment
Towards Holistic Continuous Software Performance AssessmentTowards Holistic Continuous Software Performance Assessment
Towards Holistic Continuous Software Performance Assessment
 
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...
 
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...
 
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
 
Metrics
MetricsMetrics
Metrics
 
Lean Model-Driven Development through Model-Interpretation: the CPAL design ...
Lean Model-Driven Development through  Model-Interpretation: the CPAL design ...Lean Model-Driven Development through  Model-Interpretation: the CPAL design ...
Lean Model-Driven Development through Model-Interpretation: the CPAL design ...
 
Cocomo model
Cocomo modelCocomo model
Cocomo model
 
Supply Chain Management - Optimization technology
Supply Chain Management - Optimization technologySupply Chain Management - Optimization technology
Supply Chain Management - Optimization technology
 
Best Practices with OLAP Modeling with Cognos Transformer (Cognos 8)
Best Practices with OLAP Modeling with Cognos Transformer (Cognos 8)Best Practices with OLAP Modeling with Cognos Transformer (Cognos 8)
Best Practices with OLAP Modeling with Cognos Transformer (Cognos 8)
 
Resource planning for QC labs, R&D, RA, or multi- project environments
Resource planning for QC labs, R&D, RA, or multi- project environmentsResource planning for QC labs, R&D, RA, or multi- project environments
Resource planning for QC labs, R&D, RA, or multi- project environments
 
UNIT-2 Quantitaitive Anlaysis for Mgt Decisions.pptx
UNIT-2 Quantitaitive Anlaysis for Mgt Decisions.pptxUNIT-2 Quantitaitive Anlaysis for Mgt Decisions.pptx
UNIT-2 Quantitaitive Anlaysis for Mgt Decisions.pptx
 
Advanced Modeling of Industrial Optimization Problems
Advanced Modeling of Industrial Optimization ProblemsAdvanced Modeling of Industrial Optimization Problems
Advanced Modeling of Industrial Optimization Problems
 
Production model lifecycle management 2016 09
Production model lifecycle management 2016 09Production model lifecycle management 2016 09
Production model lifecycle management 2016 09
 
Jean-François Puget, Distinguished Engineer, Machine Learning and Optimizatio...
Jean-François Puget, Distinguished Engineer, Machine Learning and Optimizatio...Jean-François Puget, Distinguished Engineer, Machine Learning and Optimizatio...
Jean-François Puget, Distinguished Engineer, Machine Learning and Optimizatio...
 

Kürzlich hochgeladen

AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 

Kürzlich hochgeladen (20)

%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
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
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
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...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
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 ...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 

An introduction to CP Optimizer

  • 1. May 25, 2016 © 2016 IBM Corporation An introduction to CP Optimizer Philippe Laborie IBM Analytics, Decision Optimization
  • 2. © 2016 IBM Corporation2 Outline 1) Overview of CP Optimizer 2) Modeling concepts 3) Automatic search 4) Development tools
  • 3. © 2016 IBM Corporation3 Overview of CP Optimizer  A component of IBM ILOG CPLEX Optimization Studio  A Constraint Programming engine for combinatorial problems (including scheduling problems)  Implements a Model & Run paradigm (like CPLEX) – Model: Concise yet expressive modeling language – Run: Powerful automatic search procedure Search algorithm is complete  Available through the following interfaces: – OPL – C++ (native interface) – Python, Java, .NET (wrapping of the C++ engine)  Set of tools to support the development of efficient models
  • 4. © 2016 IBM Corporation4 Overview of CP Optimizer  First version in 2007/2008  Search “CP Optimizer” on Google Scholar to get an idea of how CP Optimizer is being used across academy and industry 2007 2008 2009 2010 2011 2012 2013 2014 2015 0 10 20 30 40 50 60 70 80 90 100 Google Scholar citations (“CP Optimizer”) per year
  • 5. © 2016 IBM Corporation5 Overview of CP Optimizer User model OPL,C++,Python,Java,.NET Model Solution Automatic Solve  Model & Run paradigm
  • 6. © 2016 IBM Corporation6 Overview of CP Optimizer
  • 7. © 2016 IBM Corporation7 Overview of CP Optimizer Interval variables
  • 8. © 2016 IBM Corporation8 Overview of CP Optimizer Functions
  • 9. © 2016 IBM Corporation9 Modeling concepts  Two main types of decision variables: – Integer variables – Interval variables
  • 10. © 2016 IBM Corporation10 Modeling concepts (integer variables) Variables Expressions Constraints Variables are discrete integer Domains can be specified as a range [1..50] or as a set of values {1, 3, 5, 7, 9} dvar int x in 1..50 Expressions can be integer or floating-point, for example 0.37*y is allowed Basic arithmetic (+,-,*,/) and more complex operators (min, max, log, pow etc.) are supported Relational expressions can be treated as 0-1 expressions. e.g. x = (y < z) Special expressions: x == a[y] x == count(Y, 3) y == cond ? y : z Rich set of constraints: Standard relational constraints (==, !=, <, >, <=, >=) Logical combinators (&&, ||, !, =>) Specialized (global) constraints allDifferent(X) allowedAssignments(X, tuples) forbiddenAssignments(X, tuples) pack(load, container, size) lexicographic(X,Y) inverse(X,Y)
  • 11. © 2016 IBM Corporation11 Modeling concepts (interval variables for scheduling)  Scheduling (our definition of): – 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
  • 12. © 2016 IBM Corporation12 Modeling concepts (interval variables for scheduling)  Extension of classical CSP with a new type of decision variable: optional interval variable : Domain(x) Í {}  { [s,e) | s,e, s≤e }  Introduction of mathematical notions such as sequences and functions to capture temporal aspects of scheduling problems Absent interval Interval of integers
  • 13. © 2016 IBM Corporation13 Modeling concepts (interval variables for scheduling)  In scheduling models, interval variables usually represent an interval of time whose end-points (start/end) are decision variables of the problem  Examples: – A production order, an operation in a production order – A sub-project in a project, a task in a sub-project – A batch of operations – The setup of a tool on a machine – The moving of an item by a transportation device – The utilization interval of a machine – The filling or emptying of a tank  Idea of the model (and search) is to avoid the enumeration of start/end values
  • 14. © 2016 IBM Corporation14 Modeling concepts (interval variables for scheduling)  An interval variable can be optional meaning that it is a decision to have it present or absent in a solution.  Examples: – Unperformed tasks and optional sub-projects – Alternative resources, modes or recipes for processing an order, each mode specifying a particular combination of operational resources – Operations that can be processed in different temporal modes (e.g. series or parallel), left unperformed or externalized – Activities that can be performed in an alternative set of batches or shifts
  • 15. © 2016 IBM Corporation15 Example: Resource Constrained Project Scheduling Problem  RCPSP: a very classical academical scheduling problem – Tasks ai with fixed processing time Pi – Precedence constraints – Discrete resources with limited instantaneous capacity Rk – Tasks require some quantity of discrete resources – Objective is to minimize the schedule makespan a1 a3 a2 a6 a5 a4 a7 a8 R1 R2
  • 16. © 2016 IBM Corporation16 Example: Resource Constrained Project Scheduling Problem  RCPSP: Standard time-indexed MIP formulation ai Pi xit  {0,1}
  • 17. © 2016 IBM Corporation17 Example: Resource Constrained Project Scheduling Problem  Basic CP Optimizer model for RCPSP:
  • 18. © 2016 IBM Corporation18 Example: Resource Constrained Project Scheduling Problem  Comparison of this time-indexed MIP formulation against the CP Optimizer model on a set of: – 300 classical small RCPSP instances (30-120 tasks) + – 40 slightly more realistic larger ones (900 tasks) – time-limit: 2mn, 4 threads  Note: industrial scheduling problems are often much larger, typically several 1.000 tasks (we handled up to 1.000.000 tasks in an RCPSP-like scheduling application in V12.6)
  • 19. © 2016 IBM Corporation19 Example: Resource Constrained Project Scheduling Problem  Comparison of CP Optimizer and MIP performance on RCPSP
  • 20. © 2016 IBM Corporation20 Example: Job-shop Scheduling Problem  Example: Job-shop Scheduling Problem  Minimization of makespan op11 op12 op13 M1 M2 M3 op21 op22 op23 op31 op32 op33 op41 op42 op43
  • 21. © 2016 IBM Corporation21 Example: Job-shop Scheduling Problem  CP Optimizer model for Job-shop:
  • 22. © 2016 IBM Corporation22 Example: Job-shop Scheduling Problem  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] …
  • 23. © 2016 IBM Corporation23 Example: Job-shop Scheduling Problem  Comparison of the 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  See [1] for some comparisons against more sophisticated MIP models for Job-shop scheduling (but with similar conclusions) [1] W.Y. Ku and J. C. Beck. Mixed Integer Programming Models for Job Shop Scheduling: A Computational Analysis. Computers & Operations Research, 2016
  • 24. © 2016 IBM Corporation24 Example: Job-shop Scheduling Problem  Comparison of CP Optimizer and MIP performance on Job-Shop
  • 25. © 2016 IBM Corporation25 Example: Flexible Job-shop Scheduling Problem  CP Optimizer model
  • 26. © 2016 IBM Corporation26 CP Optimizer modeling concepts  CP Optimizer has mathematical concepts that naturally map to features invariably found in industrial scheduling problems Optional interval variables Intensity functions Sequence variables Cumul functions Optional activities Over-constrained problems Resource alloc. / alternatives Work-breakdown structures Calendars Resource efficiency Unary resources Setup times/costs Travel times/costs Cumulative resources Inventories Reservoirs General arithmetical expressions Earliness/tardiness costs Net Present Value State functions Parallel batches, Activity incompatibilities
  • 27. © 2016 IBM Corporation27 Automatic Search  Search algorithm is Complete  Core CP techniques used as a building block: – Tree search (Depth First) – Constraint propagation  But also: – Deterministic multicore parallelism – Model presolve – Algorithms portfolios – Machine learning – Restarting techniques – Large Neighborhood Search – No-good learning – Impact-based branching – Opportunistic probing – Dominance rules – LP-assisted heuristics – Randomization – Evolutionary algorithms
  • 28. © 2016 IBM Corporation28 Automatic Search – Constraint propagation  Dedicated Propagation Algorithms for Scheduling – Edge-Finding – Not-First/Not-Last – Detectable Precedences – Timetable – Timetable Edge-Finding – Max Energy Filtering – etc. Edge-Finding: C cannot start before 18.
  • 29. © 2016 IBM Corporation29 Automatic Search – Large Neighborhood Search (LNS)  LNS is able to converge very quickly to quality solutions 1) Start with an existing solution
  • 30. © 2016 IBM Corporation30 Automatic Search – Large Neighborhood Search (LNS)  LNS is able to converge very quickly to quality solutions 1) Start with an existing solution 2)Take part the solution and relax it, fix structure of the rest (but not start/end times) relax keep rigid
  • 31. © 2016 IBM Corporation31 Automatic Search – Large Neighborhood Search (LNS)  LNS is able to converge very quickly to quality solutions 1) Start with an existing solution 2)Take part the solution and relax it, fix structure of the rest (but not start/end times) relax keep rigid
  • 32. © 2016 IBM Corporation32 Automatic Search – Large Neighborhood Search (LNS)  LNS is able to converge very quickly to quality solutions 1) Start with an existing solution 2)Take part the solution and relax it, fix structure of the rest (but not start/end times) 3) Find (improved) solution improve kept rigid
  • 33. © 2016 IBM Corporation33 Automatic Search – LP-assisted heuristics  Traditionally, early/tardy problems are challenging for CP-based scheduling tools as they miss a good global view of the cost  Approach: – Automatically use CPLEX's LP solver to provide a solution to a relaxed version of the problem – Use the LP solution to guide heuristics. Start an operation as close as possible to the time proposed by CPLEX  What is linearized? – Precedences – Execution / non-execution costs, logical constraints on optional intervals – “Alternative” and “Span” constraints – Cost function terms which are functions of start/end times cost x cost x cost x cost x cost x
  • 34. © 2016 IBM Corporation34 Automatic Search: some results
  • 35. © 2016 IBM Corporation35 Automatic Search: some results – Problem #1: Flow-shop with earliness/tardiness cost – Problem #2: Oversubscribed Satellite Scheduling problem – Problem #3: Personal tasks scheduling
  • 36. © 2016 IBM Corporation36 Automatic Search: some results
  • 37. © 2016 IBM Corporation37 Automatic Search: some results  Industrial Modelling Competition at CP 2015  http://booleconferences.ucc.ie/indmodellingcomp  CP Optimizer outperformed all the other competitors on all the instances of the challenge
  • 38. © 2016 IBM Corporation38 Automatic Search  Some CP Optimizer industrial applications: – Port Management: Yantian International Container Terminals, Navis – Manufacturing: Ajover S.A. (plastics), TAL Group (textiles), Danieli (metallurgy) – Aviation: Dassault Aviation, another large jet manufacturer – Workforce scheduling: A world leading IFS (Integrated Facility Services) company
  • 39. © 2016 IBM Corporation39 Warnings Warm start Development tools User model Internal model Model analysis Model presolve Conflict Model Solution CPO file Search log Failure explainer Automatic Solve Conflict refinerFail expl. OPL,C++,Python,Java,.NET
  • 40. © 2016 IBM Corporation40 CPLEX and CP Optimizer are in the same ecosystem CPLEX CP Optimizer Interfaces OPL, C++, Java, .NET, C, Python OPL, C++, Java, .NET, Python Model Decision variables int, float int, interval Expressions linear, quadratic arithmetic, log, pow, … relational, a[x], count,... Constraints range relational, logical, specialized, scheduling Search Search parameters Warm start Multi-core // Tools Search log I/O format .lp, .mps, ... .cpo Conflict refiner