SlideShare a Scribd company logo
1 of 33
Download to read offline
Florian Wilhelm
Unlocking the Power of
Integer Programming
Data Analytics & Science
Mathematical Modelling
Modern Data Warehousing & Analytics
Personalisation & RecSys
Uncertainty Quantification & Causality
Python Data Stack
OSS Contributor & Creator of PyScaffold
Dr. Florian Wilhelm
• HEAD OF DATA SCIENCE
FlorianWilhelm.info
florian.wilhelm@inovex.de
FlorianWilhelm
@FlorianWilhelm
2
‣ Application Development (Web Platforms, Mobile
Apps, Smart Devices and Robotics, UI/UX design,
Backend Services)
‣ Data Management and Analytics (Business
Intelligence, Big Data, Searches, Data Science
and Deep Learning, Machine Perception and
Artificial Intelligence)
‣ Scalable IT-Infrastructures (IT Engineering, Cloud
Services, DevOps, Replatforming, Security)
‣ Training and Coaching (inovex Academy)
is an innovation and quality-driven
IT project house with a focus on
digital transformation.
Using technology to
inspire our clients.
And ourselves.
Berlin · Karlsruhe · Pforzheim · Stuttgart · München · Köln · Hamburg · Erlangen
www.inovex.de
3
Definition:
The objective of Operations Research (OR) is the
development and use of mathematical methods to support
decision-making processes in domains such as
manufacturing or finance.
Operations Research
Introduction
4
● Assignment/Allocation Problem
How to schedule some talks in an agenda under some
constraints like room sizes to optimize the conference
experience?
● Transportation Problem
Which supplier should deliver to which factories given some
costs to satisfy each factory with minimal costs?
● Shortest Path Problem
Given some graph with a cost on each edge, what is the
shortest path from source to sink?
● Maximum Flow Problem
Given some pipe system with a source and sink, what is the
maximum flow through the system?
Common Problem Classes in Operations Research
Introduction
5
Definition of Linear Programming (LP)
Introduction
6
LPs can be solved with the Simplex algorithm in cubic on average
but exponential number of steps in worst case scenario or interior
point methods in about .
Definition of Mixed Integer Programming (MIP)
Introduction
7
MIPs are NP-hard, i.e. complexity grows exponentially with n
Dropping the integrality constraints, i.e. "linear relaxation", leads to
an LP problem.
If all variables need to be integer, it is a (pure)
integer linear program (ILP, IP).
If all variables need to be 0 or 1 (binary, boolean), it is a
0 - 1 linear program.
Special Cases of Mixed Integer Programming
Introduction
8
Given a set of items, each with a weight and a value,
determine which items to include in the collection so that the
total weight is less than or equal to a given limit and the
total value is as large as possible.
- Wikipedia
Knapsack problem
Introduction
9
10
Solving a MILP
Introduction
Dropping the integrality constraints, i.e. “linear relaxation”, leads to an LP problem.
Two major method classes for solving MILPs:
● Cutting plane methods
● Branch and bound methods
Often combined as Branch and Cut methods
Source: Introduction to Optimization by Laurent Lessard, Spring 2017–18
Cutting Planes
Cutting Planes Methods
Introduction
11
Idea
● solve the LP relaxation problem
● while solution is not integral:
○ add constraint that excludes solution but no integer points
○ solve LP relaxation again
Cutting Planes Methods
Introduction
12
Optimal point
Feasible point
Infeasible point
0
1
2
3
1 2 3
0
Optimal solution is 4 at (2, 2)
Cutting Planes Methods
Introduction
13
0
1
2
3
1 2 3
0
Optimal solution is 4.5 at (2, 2.5)
● Relaxing the problem and solving the LP instead of MIP
● The LP solution is always an upper bound for the MIP
Cutting Planes Methods
Introduction
14
0
1
2
3
1 2 3
0
Optimal solution is 4.16 at (2.16, 2)
● Add a cut to exclude the LP solution but no feasible
point
● Solve the LP again
● … repeat until LP solution is also an MIP solution
Cutting Planes Methods
Introduction
15
0
1
2
3
1 2 3
0
Optimal solution is 4 at (2, 2)
Branch & Bound
Branch & Bound Methods
Introduction
16
Idea
1. solve the relaxed LP and for a fractional split into two
subproblems
○ with constraint
○ and with constraint
2. repeat step 1. and build a tree of subproblems
3. eliminate branches of the tree using
How can we use MILPs for a
Conference Scheduling?
Use-Case
17
Monday Room 1 Room 2 …
Morning
Afternoon
A
B
C
D
A
B
C
D
● each talk must be assigned exactly once,
● each room/timeslot combination can only be occupied by
one talk at most,
● the length of the timeslot must match the length of the talk
● some tutorials have part 1 & 2, thus need to be consecutive
What Constraints do we have?
Use-Case
18
1. the preferences for day and time of some speakers, e.g.
keynotes, need to be considered
2.popularity of a talk should be reflected in the room
capacity,
3.avoid parallel talks that attract the same audience,
4.have in the same session, i.e. consecutive block of talks, the
same main track, e.g. PyData vs. PyCon,
5.or even the same sub track, e.g. PyData: Data Handling,
What is our objective?
Use-Case
19
Precedence: 1 > 2 > 3 > 4 > 5
1. Framework to formulate the problem, e.g.
a.Pyomo (OSS)
b.PuLP (OSS)
c.AMPL (Commercial)
d.…
2.Solver to solve the canonical problem, e.g.
a.HiGHS (OSS)
b.CBC (OSS)
c.Gurobi (Commercial)
d.IBM CPlex (Commercial)
e.…
Solving MILPs in Python
Use-Case
20
Pyomo: Index Sets
Use-Case
21
Pyomo: Parameters
Use-Case
22
Pyomo: Variables
Use-Case
23
Pyomo: Constraints
Use-Case
24
Pyomo: Objective
Use-Case
25
Solving the MILP Problem and Displaying model.vBScheduleSchedule
Use-Case
26
Pyomo / HiGHS notebook:
https://github.com/FlorianWilhelm/pytanis/blob/main/notebooks/pyconde-pydata-berlin-2023/50_scheduling_v1.ipynb
Check out the Full Source Code
Use-Case
27
Pytanis includes a Pretalx client and all
the tooling you need for conferences
using Pretalx, from handling the initial
call for papers to creating the final
program.
Looks easy enough! But is it really?
Remarks
28
m_caps_dict.keys(), ordered=True)
The Absolute Value is not linear!
Modelling the Absolute Value
Remarks
29
0
1
2
3
1 2 3
-1
-2
-3
m_caps_dict.keys(), ordered=True)
To model in the objective, we introduce auxiliary variables:
Modelling the Absolute Value
Remarks
30
1
2
3
1 2 3
1. MILPs are an important tool in the domain of
Operations Research
2.Many optimal decision use-cases can be formulated
mathematically as a MILP, e.g. Knapsack problem
3.Solving a (M)ILP is NP-hard but good heuristics methods
exists like Branch & Cut
4.Tools like Pyomo translate your problem in a standardized
form and solver like HiGHS solve it
5.Modelling a problem as MILP, especially the Linearity
requirement, is the hardest part
Main Take-Aways
Summary
31
● Introduction to Optimization by
Laurent Lessard
● Mixed Integer Programming for
time table scheduling by Francisco
Espiga
● Schedule Optimisation using Linear
Programming in Python by Lewis
Woolfson
● Some icons taken from
Flaticon.com
References
Summary
32
© 2023
Thank you!
Dr. Florian Wilhelm
Head of Data Science
EuroPython 2023
inovex.de
florian.wilhelm@inovex.de
@inovexlife
@inovexgmbh
waldstack.org
33

More Related Content

Similar to Unlocking the Power of Integer Programming

Packing Problems Using Gurobi
Packing Problems Using GurobiPacking Problems Using Gurobi
Packing Problems Using Gurobi
Terrance Smith
 

Similar to Unlocking the Power of Integer Programming (20)

Prespective analytics with DOcplex and pandas
Prespective analytics with DOcplex and pandasPrespective analytics with DOcplex and pandas
Prespective analytics with DOcplex and pandas
 
Packing Problems Using Gurobi
Packing Problems Using GurobiPacking Problems Using Gurobi
Packing Problems Using Gurobi
 
QA CHAPTER II.pptx
QA CHAPTER II.pptxQA CHAPTER II.pptx
QA CHAPTER II.pptx
 
Sci computing using python
Sci computing using pythonSci computing using python
Sci computing using python
 
“Programação paralela híbrida com MPI e OpenMP – uma abordagem prática”. Edua...
“Programação paralela híbrida com MPI e OpenMP – uma abordagem prática”. Edua...“Programação paralela híbrida com MPI e OpenMP – uma abordagem prática”. Edua...
“Programação paralela híbrida com MPI e OpenMP – uma abordagem prática”. Edua...
 
Efficient Deep Learning in Natural Language Processing Production, with Moshe...
Efficient Deep Learning in Natural Language Processing Production, with Moshe...Efficient Deep Learning in Natural Language Processing Production, with Moshe...
Efficient Deep Learning in Natural Language Processing Production, with Moshe...
 
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
 
Portfolio Planning
Portfolio PlanningPortfolio Planning
Portfolio Planning
 
Dynamic programming prasintation eaisy
Dynamic programming prasintation eaisyDynamic programming prasintation eaisy
Dynamic programming prasintation eaisy
 
PF_MAO2010 Souma
PF_MAO2010 SoumaPF_MAO2010 Souma
PF_MAO2010 Souma
 
LP.ppt
LP.pptLP.ppt
LP.ppt
 
chapter-04(Computational Thinking).pptx
chapter-04(Computational Thinking).pptxchapter-04(Computational Thinking).pptx
chapter-04(Computational Thinking).pptx
 
Matopt
MatoptMatopt
Matopt
 
Thomas Wolf "Transfer learning in NLP"
Thomas Wolf "Transfer learning in NLP"Thomas Wolf "Transfer learning in NLP"
Thomas Wolf "Transfer learning in NLP"
 
I/O Challenges in Brain Tissue Simulation
I/O Challenges in Brain Tissue SimulationI/O Challenges in Brain Tissue Simulation
I/O Challenges in Brain Tissue Simulation
 
Solving Industrial Scheduling Problems with Constraint Programming
Solving Industrial Scheduling Problems with Constraint ProgrammingSolving Industrial Scheduling Problems with Constraint Programming
Solving Industrial Scheduling Problems with Constraint Programming
 
Convex optmization in communications
Convex optmization in communicationsConvex optmization in communications
Convex optmization in communications
 
ICAPS-2020 Industry Session
ICAPS-2020 Industry SessionICAPS-2020 Industry Session
ICAPS-2020 Industry Session
 
PyCon2022 - Building Python Extensions
PyCon2022 - Building Python ExtensionsPyCon2022 - Building Python Extensions
PyCon2022 - Building Python Extensions
 
OpenPOWER and AI workshop at Barcelona Supercomputing Center
OpenPOWER and AI workshop at Barcelona Supercomputing CenterOpenPOWER and AI workshop at Barcelona Supercomputing Center
OpenPOWER and AI workshop at Barcelona Supercomputing Center
 

More from Florian Wilhelm

Bridging the Gap: from Data Science to Production
Bridging the Gap: from Data Science to ProductionBridging the Gap: from Data Science to Production
Bridging the Gap: from Data Science to Production
Florian Wilhelm
 

More from Florian Wilhelm (16)

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
WALD: A Modern & Sustainable Analytics Stack
WALD: A Modern & Sustainable Analytics StackWALD: A Modern & Sustainable Analytics Stack
WALD: A Modern & Sustainable Analytics Stack
 
Forget about AI and do Mathematical Modelling instead!
Forget about AI and do Mathematical Modelling instead!Forget about AI and do Mathematical Modelling instead!
Forget about AI and do Mathematical Modelling instead!
 
An Interpretable Model for Collaborative Filtering Using an Extended Latent D...
An Interpretable Model for Collaborative Filtering Using an Extended Latent D...An Interpretable Model for Collaborative Filtering Using an Extended Latent D...
An Interpretable Model for Collaborative Filtering Using an Extended Latent D...
 
Honey I Shrunk the Target Variable! Common pitfalls when transforming the tar...
Honey I Shrunk the Target Variable! Common pitfalls when transforming the tar...Honey I Shrunk the Target Variable! Common pitfalls when transforming the tar...
Honey I Shrunk the Target Variable! Common pitfalls when transforming the tar...
 
Matrix Factorization for Collaborative Filtering Is Just Solving an Adjoint L...
Matrix Factorization for Collaborative Filtering Is Just Solving an Adjoint L...Matrix Factorization for Collaborative Filtering Is Just Solving an Adjoint L...
Matrix Factorization for Collaborative Filtering Is Just Solving an Adjoint L...
 
Uncertainty Quantification in AI
Uncertainty Quantification in AIUncertainty Quantification in AI
Uncertainty Quantification in AI
 
Performance evaluation of GANs in a semisupervised OCR use case
Performance evaluation of GANs in a semisupervised OCR use casePerformance evaluation of GANs in a semisupervised OCR use case
Performance evaluation of GANs in a semisupervised OCR use case
 
Bridging the Gap: from Data Science to Production
Bridging the Gap: from Data Science to ProductionBridging the Gap: from Data Science to Production
Bridging the Gap: from Data Science to Production
 
How mobile.de brings Data Science to Production for a Personalized Web Experi...
How mobile.de brings Data Science to Production for a Personalized Web Experi...How mobile.de brings Data Science to Production for a Personalized Web Experi...
How mobile.de brings Data Science to Production for a Personalized Web Experi...
 
Deep Learning-based Recommendations for Germany's Biggest Vehicle Marketplace
Deep Learning-based Recommendations for Germany's Biggest Vehicle MarketplaceDeep Learning-based Recommendations for Germany's Biggest Vehicle Marketplace
Deep Learning-based Recommendations for Germany's Biggest Vehicle Marketplace
 
Deep Learning-based Recommendations for Germany's Biggest Online Vehicle Mark...
Deep Learning-based Recommendations for Germany's Biggest Online Vehicle Mark...Deep Learning-based Recommendations for Germany's Biggest Online Vehicle Mark...
Deep Learning-based Recommendations for Germany's Biggest Online Vehicle Mark...
 
Declarative Thinking and Programming
Declarative Thinking and ProgrammingDeclarative Thinking and Programming
Declarative Thinking and Programming
 
Which car fits my life? - PyData Berlin 2017
Which car fits my life? - PyData Berlin 2017Which car fits my life? - PyData Berlin 2017
Which car fits my life? - PyData Berlin 2017
 
PyData Meetup Berlin 2017-04-19
PyData Meetup Berlin 2017-04-19PyData Meetup Berlin 2017-04-19
PyData Meetup Berlin 2017-04-19
 
Explaining the idea behind automatic relevance determination and bayesian int...
Explaining the idea behind automatic relevance determination and bayesian int...Explaining the idea behind automatic relevance determination and bayesian int...
Explaining the idea behind automatic relevance determination and bayesian int...
 

Recently uploaded

Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
amitlee9823
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
amitlee9823
 
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
amitlee9823
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
amitlee9823
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
amitlee9823
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
amitlee9823
 

Recently uploaded (20)

Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics Program
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptxCebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
 
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
Mg Road Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Banga...
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men  🔝Bangalore🔝   Esc...
➥🔝 7737669865 🔝▻ Bangalore Call-girls in Women Seeking Men 🔝Bangalore🔝 Esc...
 

Unlocking the Power of Integer Programming

  • 1. Florian Wilhelm Unlocking the Power of Integer Programming Data Analytics & Science
  • 2. Mathematical Modelling Modern Data Warehousing & Analytics Personalisation & RecSys Uncertainty Quantification & Causality Python Data Stack OSS Contributor & Creator of PyScaffold Dr. Florian Wilhelm • HEAD OF DATA SCIENCE FlorianWilhelm.info florian.wilhelm@inovex.de FlorianWilhelm @FlorianWilhelm 2
  • 3. ‣ Application Development (Web Platforms, Mobile Apps, Smart Devices and Robotics, UI/UX design, Backend Services) ‣ Data Management and Analytics (Business Intelligence, Big Data, Searches, Data Science and Deep Learning, Machine Perception and Artificial Intelligence) ‣ Scalable IT-Infrastructures (IT Engineering, Cloud Services, DevOps, Replatforming, Security) ‣ Training and Coaching (inovex Academy) is an innovation and quality-driven IT project house with a focus on digital transformation. Using technology to inspire our clients. And ourselves. Berlin · Karlsruhe · Pforzheim · Stuttgart · München · Köln · Hamburg · Erlangen www.inovex.de 3
  • 4. Definition: The objective of Operations Research (OR) is the development and use of mathematical methods to support decision-making processes in domains such as manufacturing or finance. Operations Research Introduction 4
  • 5. ● Assignment/Allocation Problem How to schedule some talks in an agenda under some constraints like room sizes to optimize the conference experience? ● Transportation Problem Which supplier should deliver to which factories given some costs to satisfy each factory with minimal costs? ● Shortest Path Problem Given some graph with a cost on each edge, what is the shortest path from source to sink? ● Maximum Flow Problem Given some pipe system with a source and sink, what is the maximum flow through the system? Common Problem Classes in Operations Research Introduction 5
  • 6. Definition of Linear Programming (LP) Introduction 6 LPs can be solved with the Simplex algorithm in cubic on average but exponential number of steps in worst case scenario or interior point methods in about .
  • 7. Definition of Mixed Integer Programming (MIP) Introduction 7 MIPs are NP-hard, i.e. complexity grows exponentially with n Dropping the integrality constraints, i.e. "linear relaxation", leads to an LP problem.
  • 8. If all variables need to be integer, it is a (pure) integer linear program (ILP, IP). If all variables need to be 0 or 1 (binary, boolean), it is a 0 - 1 linear program. Special Cases of Mixed Integer Programming Introduction 8
  • 9. Given a set of items, each with a weight and a value, determine which items to include in the collection so that the total weight is less than or equal to a given limit and the total value is as large as possible. - Wikipedia Knapsack problem Introduction 9
  • 10. 10 Solving a MILP Introduction Dropping the integrality constraints, i.e. “linear relaxation”, leads to an LP problem. Two major method classes for solving MILPs: ● Cutting plane methods ● Branch and bound methods Often combined as Branch and Cut methods Source: Introduction to Optimization by Laurent Lessard, Spring 2017–18
  • 11. Cutting Planes Cutting Planes Methods Introduction 11 Idea ● solve the LP relaxation problem ● while solution is not integral: ○ add constraint that excludes solution but no integer points ○ solve LP relaxation again
  • 12. Cutting Planes Methods Introduction 12 Optimal point Feasible point Infeasible point 0 1 2 3 1 2 3 0 Optimal solution is 4 at (2, 2)
  • 13. Cutting Planes Methods Introduction 13 0 1 2 3 1 2 3 0 Optimal solution is 4.5 at (2, 2.5) ● Relaxing the problem and solving the LP instead of MIP ● The LP solution is always an upper bound for the MIP
  • 14. Cutting Planes Methods Introduction 14 0 1 2 3 1 2 3 0 Optimal solution is 4.16 at (2.16, 2) ● Add a cut to exclude the LP solution but no feasible point ● Solve the LP again ● … repeat until LP solution is also an MIP solution
  • 15. Cutting Planes Methods Introduction 15 0 1 2 3 1 2 3 0 Optimal solution is 4 at (2, 2)
  • 16. Branch & Bound Branch & Bound Methods Introduction 16 Idea 1. solve the relaxed LP and for a fractional split into two subproblems ○ with constraint ○ and with constraint 2. repeat step 1. and build a tree of subproblems 3. eliminate branches of the tree using
  • 17. How can we use MILPs for a Conference Scheduling? Use-Case 17 Monday Room 1 Room 2 … Morning Afternoon A B C D A B C D
  • 18. ● each talk must be assigned exactly once, ● each room/timeslot combination can only be occupied by one talk at most, ● the length of the timeslot must match the length of the talk ● some tutorials have part 1 & 2, thus need to be consecutive What Constraints do we have? Use-Case 18
  • 19. 1. the preferences for day and time of some speakers, e.g. keynotes, need to be considered 2.popularity of a talk should be reflected in the room capacity, 3.avoid parallel talks that attract the same audience, 4.have in the same session, i.e. consecutive block of talks, the same main track, e.g. PyData vs. PyCon, 5.or even the same sub track, e.g. PyData: Data Handling, What is our objective? Use-Case 19 Precedence: 1 > 2 > 3 > 4 > 5
  • 20. 1. Framework to formulate the problem, e.g. a.Pyomo (OSS) b.PuLP (OSS) c.AMPL (Commercial) d.… 2.Solver to solve the canonical problem, e.g. a.HiGHS (OSS) b.CBC (OSS) c.Gurobi (Commercial) d.IBM CPlex (Commercial) e.… Solving MILPs in Python Use-Case 20
  • 26. Solving the MILP Problem and Displaying model.vBScheduleSchedule Use-Case 26
  • 27. Pyomo / HiGHS notebook: https://github.com/FlorianWilhelm/pytanis/blob/main/notebooks/pyconde-pydata-berlin-2023/50_scheduling_v1.ipynb Check out the Full Source Code Use-Case 27 Pytanis includes a Pretalx client and all the tooling you need for conferences using Pretalx, from handling the initial call for papers to creating the final program.
  • 28. Looks easy enough! But is it really? Remarks 28
  • 29. m_caps_dict.keys(), ordered=True) The Absolute Value is not linear! Modelling the Absolute Value Remarks 29 0 1 2 3 1 2 3 -1 -2 -3
  • 30. m_caps_dict.keys(), ordered=True) To model in the objective, we introduce auxiliary variables: Modelling the Absolute Value Remarks 30 1 2 3 1 2 3
  • 31. 1. MILPs are an important tool in the domain of Operations Research 2.Many optimal decision use-cases can be formulated mathematically as a MILP, e.g. Knapsack problem 3.Solving a (M)ILP is NP-hard but good heuristics methods exists like Branch & Cut 4.Tools like Pyomo translate your problem in a standardized form and solver like HiGHS solve it 5.Modelling a problem as MILP, especially the Linearity requirement, is the hardest part Main Take-Aways Summary 31
  • 32. ● Introduction to Optimization by Laurent Lessard ● Mixed Integer Programming for time table scheduling by Francisco Espiga ● Schedule Optimisation using Linear Programming in Python by Lewis Woolfson ● Some icons taken from Flaticon.com References Summary 32
  • 33. © 2023 Thank you! Dr. Florian Wilhelm Head of Data Science EuroPython 2023 inovex.de florian.wilhelm@inovex.de @inovexlife @inovexgmbh waldstack.org 33