SlideShare une entreprise Scribd logo
1  sur  24
Télécharger pour lire hors ligne
Optimisation

                Dr. Stuart Mitchell
                       LMRC
               University of Auckland
               s.mitchell@auckland.ac.nz
                    Kiwi Pycon 2009
Contents of presentation
What is Mathematical Programing
        When is it useful
 The Wedding Guest Problem
What is Mathematical programing
• A simple mathematically precise way of stating
  optimisation problems.
• Use mathematically rigorous way to find a
  solution
30 teams – 162 games
What is Mathematical programing
• A simple mathematically precise way of stating
  optimisation problems.
• Use mathematically rigorous way to find a
  solution
What is Mathematical programing
• A simple mathematically precise way of stating
  optimisation problems.
• Use mathematically rigorous way to find a
  solution
When is it useful
• There is a decision problem



• There is lots of data



• There is money to be made
The wedding guest problem
• Similar to work at LMRC
• A wedding planner whats to
  work out seating allocations
              http://weddingelegante.com
    * Tables near the head table (or sweetheart table) should be reserved for your
 closest family and friends
    * If you’re using round tables, you should generally assign males and females
 to alternating seats
    * Don’t forget to use your guests’ ages and interests when assigning
    * Grouping your guests into identifiable cliques (grooms college friends, work
 colleagues, friends of your parents, etc.) will make grouping guests together at
 specific tables easier
    * Seat children under 8 years of age at the same table as their parents, but if
 you’re expecting a great deal of 8+ children to attend, you may consider creating
 a “kids-only” table
    * Leave 2-3 tables empty for vendors during their breaks or for unexpected
 guests
    * Have a large diagram of the completed seating chart on hand at the
 reception venue on your wedding day to solve any confusion
The wedding guest problem
• We need to define
  – A solution – what is the result
    we want
The wedding guest problem
• We need to define
  – A solution – what is the result
    we want
  – Variables – parts of the
    solution
The wedding guest problem
• We need to define
  – A solution – what is the result
    we want
  – Variables – parts of the solution
  – Objective function – how to
    compare solutions
The wedding guest problem
• We need to define
  – A solution – what is the result
    we want
  – Variables – parts of the solution
  – Objective function – how to
    compare solutions
  – Constraints – define a solution
     • In terms of the variables
Mathematical expression of the problem
• This is a set partitioning problem.
   – We wish to partition the set of guests into
     subsets of tables.
   – We wish to maximise happiness of the tables.
   – We want everyone to be seated at exactly one
     table.
• This is implemented in the following python code
Wedding Planning Formulation
Let guests be the set of all guests.
Wedding Planning Formulation
Use pulp.allcombinations to generate a list of all
possible table seatings.
Wedding Planning Formulation
  Then we create a binary variable that will be 1 if
the table will be in the solution, or zero
Wedding Planning Formulation
  We create the LpProblem and then make the
objective function.
Wedding Planning Formulation
  We create the LpProblem and then make the
objective function.
Wedding Planning Formulation
 We specify the total number of tables allowed in
the solution.
Wedding Planning Formulation
 Multiple similar constraints (one of each guest)
guarantee that a guest is allocated to exactly one
table.
Wedding Planning Formulation
Solve the problem and print out an answer.




   The choosen tables are out of a total of 3213:
   ('M', 'N')
   ('E', 'F', 'G')
   ('A', 'B', 'C', 'D')
   ('I', 'J', 'K', 'L')
   ('O', 'P', 'Q', 'R')
Why Pulp
• MIT Licence

• Installation (google-code or pypi)

• Syntax

• Interoperabilty

• Documentation
Next time you are talking to a client
• Is there a decision problem?



• Is there lots of data?



• Is there money to be made?

Contenu connexe

Tendances

Introduction to Structural Equation Modeling
Introduction to Structural Equation ModelingIntroduction to Structural Equation Modeling
Introduction to Structural Equation ModelingUniversity of Southampton
 
Multivariate data analysis
Multivariate data analysisMultivariate data analysis
Multivariate data analysisSetia Pramana
 
Some contributions to the clustering of financial time series - Applications ...
Some contributions to the clustering of financial time series - Applications ...Some contributions to the clustering of financial time series - Applications ...
Some contributions to the clustering of financial time series - Applications ...Gautier Marti
 
1. Linear Algebra for Machine Learning: Linear Systems
1. Linear Algebra for Machine Learning: Linear Systems1. Linear Algebra for Machine Learning: Linear Systems
1. Linear Algebra for Machine Learning: Linear SystemsCeni Babaoglu, PhD
 
Logistic regression
Logistic regressionLogistic regression
Logistic regressionVARUN KUMAR
 
Time series analysis 101
Time series analysis 101Time series analysis 101
Time series analysis 101Balvinder Hira
 
PCA (Principal component analysis)
PCA (Principal component analysis)PCA (Principal component analysis)
PCA (Principal component analysis)Learnbay Datascience
 
Applying Statistical Modeling and Machine Learning to Perform Time-Series For...
Applying Statistical Modeling and Machine Learning to Perform Time-Series For...Applying Statistical Modeling and Machine Learning to Perform Time-Series For...
Applying Statistical Modeling and Machine Learning to Perform Time-Series For...PyData
 
Statistic and probability 2
Statistic and probability 2Statistic and probability 2
Statistic and probability 2Irfan Yaqoob
 
Descriptive statistics
Descriptive statisticsDescriptive statistics
Descriptive statisticsMmedsc Hahm
 
Probability distribution in R
Probability distribution in RProbability distribution in R
Probability distribution in RAlichy Sowmya
 
Markov Chain Monte Carlo explained
Markov Chain Monte Carlo explainedMarkov Chain Monte Carlo explained
Markov Chain Monte Carlo explaineddariodigiuni
 

Tendances (20)

Introduction to Structural Equation Modeling
Introduction to Structural Equation ModelingIntroduction to Structural Equation Modeling
Introduction to Structural Equation Modeling
 
Lesson 11: Markov Chains
Lesson 11: Markov ChainsLesson 11: Markov Chains
Lesson 11: Markov Chains
 
Multivariate data analysis
Multivariate data analysisMultivariate data analysis
Multivariate data analysis
 
Some contributions to the clustering of financial time series - Applications ...
Some contributions to the clustering of financial time series - Applications ...Some contributions to the clustering of financial time series - Applications ...
Some contributions to the clustering of financial time series - Applications ...
 
1. Linear Algebra for Machine Learning: Linear Systems
1. Linear Algebra for Machine Learning: Linear Systems1. Linear Algebra for Machine Learning: Linear Systems
1. Linear Algebra for Machine Learning: Linear Systems
 
Logistic regression sage
Logistic regression sageLogistic regression sage
Logistic regression sage
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
 
Statistics Introduction
Statistics IntroductionStatistics Introduction
Statistics Introduction
 
CHI-SQUARE TEST
CHI-SQUARE TESTCHI-SQUARE TEST
CHI-SQUARE TEST
 
Outlier detection handling
Outlier detection handlingOutlier detection handling
Outlier detection handling
 
Time series analysis 101
Time series analysis 101Time series analysis 101
Time series analysis 101
 
PCA (Principal component analysis)
PCA (Principal component analysis)PCA (Principal component analysis)
PCA (Principal component analysis)
 
The normal distribution
The normal distributionThe normal distribution
The normal distribution
 
Applying Statistical Modeling and Machine Learning to Perform Time-Series For...
Applying Statistical Modeling and Machine Learning to Perform Time-Series For...Applying Statistical Modeling and Machine Learning to Perform Time-Series For...
Applying Statistical Modeling and Machine Learning to Perform Time-Series For...
 
Survival Analysis of Web Users
Survival Analysis of Web UsersSurvival Analysis of Web Users
Survival Analysis of Web Users
 
Statistic and probability 2
Statistic and probability 2Statistic and probability 2
Statistic and probability 2
 
Descriptive statistics
Descriptive statisticsDescriptive statistics
Descriptive statistics
 
Probability distribution in R
Probability distribution in RProbability distribution in R
Probability distribution in R
 
Markov Chain Monte Carlo explained
Markov Chain Monte Carlo explainedMarkov Chain Monte Carlo explained
Markov Chain Monte Carlo explained
 
Time series Analysis
Time series AnalysisTime series Analysis
Time series Analysis
 

Similaire à Operations Research and Optimization in Python using PuLP

computational_thinking_gcse.pptx
computational_thinking_gcse.pptxcomputational_thinking_gcse.pptx
computational_thinking_gcse.pptxbirulangit23
 
Creating Presentations That Matter - A 1-day workshop (May 4th) at SVC
Creating Presentations That Matter - A 1-day workshop (May 4th) at SVCCreating Presentations That Matter - A 1-day workshop (May 4th) at SVC
Creating Presentations That Matter - A 1-day workshop (May 4th) at SVCAshley Bright
 
Uxhk 2015art of start workshop share.key
Uxhk 2015art of start workshop share.keyUxhk 2015art of start workshop share.key
Uxhk 2015art of start workshop share.keyTed Kilian
 
Mini-Training: Using root-cause analysis for problem management
Mini-Training: Using root-cause analysis for problem managementMini-Training: Using root-cause analysis for problem management
Mini-Training: Using root-cause analysis for problem managementBetclic Everest Group Tech Team
 
Project Management Solutions Webinar
Project Management Solutions WebinarProject Management Solutions Webinar
Project Management Solutions WebinarERAUWebinars
 
Decision Tree In R | Decision Tree Algorithm | Data Science Tutorial | Machin...
Decision Tree In R | Decision Tree Algorithm | Data Science Tutorial | Machin...Decision Tree In R | Decision Tree Algorithm | Data Science Tutorial | Machin...
Decision Tree In R | Decision Tree Algorithm | Data Science Tutorial | Machin...Simplilearn
 
Predict the Oscars with Data Science
Predict the Oscars with Data SciencePredict the Oscars with Data Science
Predict the Oscars with Data ScienceCarlos Edo
 
[INSIGHT OUT 2011] A21 why why is probably the right answer(tom kyte)
[INSIGHT OUT 2011] A21 why why is probably the right answer(tom kyte)[INSIGHT OUT 2011] A21 why why is probably the right answer(tom kyte)
[INSIGHT OUT 2011] A21 why why is probably the right answer(tom kyte)Insight Technology, Inc.
 
7 steps to master problem solving
7 steps to master problem solving7 steps to master problem solving
7 steps to master problem solvingYuri Kaminski
 
Predict oscars (4:17)
Predict oscars (4:17)Predict oscars (4:17)
Predict oscars (4:17)Thinkful
 
Predict the Oscars with Data Science
Predict the Oscars with Data SciencePredict the Oscars with Data Science
Predict the Oscars with Data ScienceThinkful
 
Introduction to Linear programing.ORpptx
Introduction to Linear programing.ORpptxIntroduction to Linear programing.ORpptx
Introduction to Linear programing.ORpptxaishaashraf31
 
Visual tools and innovation games workshop - spscbus - aug 2014
Visual tools and innovation games   workshop - spscbus - aug 2014Visual tools and innovation games   workshop - spscbus - aug 2014
Visual tools and innovation games workshop - spscbus - aug 2014Ruven Gotz
 
Forecasting for beginners
Forecasting for beginnersForecasting for beginners
Forecasting for beginnersDan Brown
 
lessontwoppt
lessontwopptlessontwoppt
lessontwopptbroo209
 
Level Design Workshop - GDC China 2012
Level Design Workshop - GDC China 2012Level Design Workshop - GDC China 2012
Level Design Workshop - GDC China 2012Joel Burgess
 

Similaire à Operations Research and Optimization in Python using PuLP (20)

computational_thinking_gcse.pptx
computational_thinking_gcse.pptxcomputational_thinking_gcse.pptx
computational_thinking_gcse.pptx
 
Creating Presentations That Matter - A 1-day workshop (May 4th) at SVC
Creating Presentations That Matter - A 1-day workshop (May 4th) at SVCCreating Presentations That Matter - A 1-day workshop (May 4th) at SVC
Creating Presentations That Matter - A 1-day workshop (May 4th) at SVC
 
Uxhk 2015art of start workshop share.key
Uxhk 2015art of start workshop share.keyUxhk 2015art of start workshop share.key
Uxhk 2015art of start workshop share.key
 
Mini-Training: Using root-cause analysis for problem management
Mini-Training: Using root-cause analysis for problem managementMini-Training: Using root-cause analysis for problem management
Mini-Training: Using root-cause analysis for problem management
 
Project Management Solutions Webinar
Project Management Solutions WebinarProject Management Solutions Webinar
Project Management Solutions Webinar
 
Decision Tree In R | Decision Tree Algorithm | Data Science Tutorial | Machin...
Decision Tree In R | Decision Tree Algorithm | Data Science Tutorial | Machin...Decision Tree In R | Decision Tree Algorithm | Data Science Tutorial | Machin...
Decision Tree In R | Decision Tree Algorithm | Data Science Tutorial | Machin...
 
Predict the Oscars with Data Science
Predict the Oscars with Data SciencePredict the Oscars with Data Science
Predict the Oscars with Data Science
 
[INSIGHT OUT 2011] A21 why why is probably the right answer(tom kyte)
[INSIGHT OUT 2011] A21 why why is probably the right answer(tom kyte)[INSIGHT OUT 2011] A21 why why is probably the right answer(tom kyte)
[INSIGHT OUT 2011] A21 why why is probably the right answer(tom kyte)
 
Math day 2
Math day 2Math day 2
Math day 2
 
7 steps to master problem solving
7 steps to master problem solving7 steps to master problem solving
7 steps to master problem solving
 
Predict oscars (4:17)
Predict oscars (4:17)Predict oscars (4:17)
Predict oscars (4:17)
 
$$Chapter 7 BD
$$Chapter 7 BD$$Chapter 7 BD
$$Chapter 7 BD
 
Predict the Oscars with Data Science
Predict the Oscars with Data SciencePredict the Oscars with Data Science
Predict the Oscars with Data Science
 
FDS Unit I_PPT.pptx
FDS Unit I_PPT.pptxFDS Unit I_PPT.pptx
FDS Unit I_PPT.pptx
 
Introduction to Linear programing.ORpptx
Introduction to Linear programing.ORpptxIntroduction to Linear programing.ORpptx
Introduction to Linear programing.ORpptx
 
Visual tools and innovation games workshop - spscbus - aug 2014
Visual tools and innovation games   workshop - spscbus - aug 2014Visual tools and innovation games   workshop - spscbus - aug 2014
Visual tools and innovation games workshop - spscbus - aug 2014
 
Forecasting for beginners
Forecasting for beginnersForecasting for beginners
Forecasting for beginners
 
lessontwoppt
lessontwopptlessontwoppt
lessontwoppt
 
Problem solving
Problem solvingProblem solving
Problem solving
 
Level Design Workshop - GDC China 2012
Level Design Workshop - GDC China 2012Level Design Workshop - GDC China 2012
Level Design Workshop - GDC China 2012
 

Plus de Guy K. Kloss

Kauri ID - A Self-Sovereign, Blockchain-based Identity System
Kauri ID - A Self-Sovereign, Blockchain-based Identity SystemKauri ID - A Self-Sovereign, Blockchain-based Identity System
Kauri ID - A Self-Sovereign, Blockchain-based Identity SystemGuy K. Kloss
 
Qrious about Insights -- Big Data in the Real World
Qrious about Insights -- Big Data in the Real WorldQrious about Insights -- Big Data in the Real World
Qrious about Insights -- Big Data in the Real WorldGuy K. Kloss
 
WTF is Blockchain???
WTF is Blockchain???WTF is Blockchain???
WTF is Blockchain???Guy K. Kloss
 
Building a (Really) Secure Cloud Product
Building a (Really) Secure Cloud ProductBuilding a (Really) Secure Cloud Product
Building a (Really) Secure Cloud ProductGuy K. Kloss
 
Representational State Transfer (REST) and HATEOAS
Representational State Transfer (REST) and HATEOASRepresentational State Transfer (REST) and HATEOAS
Representational State Transfer (REST) and HATEOASGuy K. Kloss
 
Introduction to LaTeX (For Word users)
 Introduction to LaTeX (For Word users) Introduction to LaTeX (For Word users)
Introduction to LaTeX (For Word users)Guy K. Kloss
 
MataNui - Building a Grid Data Infrastructure that "doesn't suck!"
MataNui - Building a Grid Data Infrastructure that "doesn't suck!"MataNui - Building a Grid Data Infrastructure that "doesn't suck!"
MataNui - Building a Grid Data Infrastructure that "doesn't suck!"Guy K. Kloss
 
Python Data Plotting and Visualisation Extravaganza
Python Data Plotting and Visualisation ExtravaganzaPython Data Plotting and Visualisation Extravaganza
Python Data Plotting and Visualisation ExtravaganzaGuy K. Kloss
 
Lecture "Open Source and Open Content"
Lecture "Open Source and Open Content"Lecture "Open Source and Open Content"
Lecture "Open Source and Open Content"Guy K. Kloss
 
Version Control with Subversion
Version Control with SubversionVersion Control with Subversion
Version Control with SubversionGuy K. Kloss
 
Beating the (sh** out of the) GIL - Multithreading vs. Multiprocessing
Beating the (sh** out of the) GIL - Multithreading vs. MultiprocessingBeating the (sh** out of the) GIL - Multithreading vs. Multiprocessing
Beating the (sh** out of the) GIL - Multithreading vs. MultiprocessingGuy K. Kloss
 
Thinking Hybrid - Python/C++ Integration
Thinking Hybrid - Python/C++ IntegrationThinking Hybrid - Python/C++ Integration
Thinking Hybrid - Python/C++ IntegrationGuy K. Kloss
 
Thinking Hybrid - Python/C++ Integration
Thinking Hybrid - Python/C++ IntegrationThinking Hybrid - Python/C++ Integration
Thinking Hybrid - Python/C++ IntegrationGuy K. Kloss
 
Gaining Colour Stability in Live Image Capturing
Gaining Colour Stability in Live Image CapturingGaining Colour Stability in Live Image Capturing
Gaining Colour Stability in Live Image CapturingGuy K. Kloss
 
LaTeX Introduction for Word Users
LaTeX Introduction for Word UsersLaTeX Introduction for Word Users
LaTeX Introduction for Word UsersGuy K. Kloss
 
Thinking Hybrid - Python/C++ Integration
Thinking Hybrid - Python/C++ IntegrationThinking Hybrid - Python/C++ Integration
Thinking Hybrid - Python/C++ IntegrationGuy K. Kloss
 

Plus de Guy K. Kloss (16)

Kauri ID - A Self-Sovereign, Blockchain-based Identity System
Kauri ID - A Self-Sovereign, Blockchain-based Identity SystemKauri ID - A Self-Sovereign, Blockchain-based Identity System
Kauri ID - A Self-Sovereign, Blockchain-based Identity System
 
Qrious about Insights -- Big Data in the Real World
Qrious about Insights -- Big Data in the Real WorldQrious about Insights -- Big Data in the Real World
Qrious about Insights -- Big Data in the Real World
 
WTF is Blockchain???
WTF is Blockchain???WTF is Blockchain???
WTF is Blockchain???
 
Building a (Really) Secure Cloud Product
Building a (Really) Secure Cloud ProductBuilding a (Really) Secure Cloud Product
Building a (Really) Secure Cloud Product
 
Representational State Transfer (REST) and HATEOAS
Representational State Transfer (REST) and HATEOASRepresentational State Transfer (REST) and HATEOAS
Representational State Transfer (REST) and HATEOAS
 
Introduction to LaTeX (For Word users)
 Introduction to LaTeX (For Word users) Introduction to LaTeX (For Word users)
Introduction to LaTeX (For Word users)
 
MataNui - Building a Grid Data Infrastructure that "doesn't suck!"
MataNui - Building a Grid Data Infrastructure that "doesn't suck!"MataNui - Building a Grid Data Infrastructure that "doesn't suck!"
MataNui - Building a Grid Data Infrastructure that "doesn't suck!"
 
Python Data Plotting and Visualisation Extravaganza
Python Data Plotting and Visualisation ExtravaganzaPython Data Plotting and Visualisation Extravaganza
Python Data Plotting and Visualisation Extravaganza
 
Lecture "Open Source and Open Content"
Lecture "Open Source and Open Content"Lecture "Open Source and Open Content"
Lecture "Open Source and Open Content"
 
Version Control with Subversion
Version Control with SubversionVersion Control with Subversion
Version Control with Subversion
 
Beating the (sh** out of the) GIL - Multithreading vs. Multiprocessing
Beating the (sh** out of the) GIL - Multithreading vs. MultiprocessingBeating the (sh** out of the) GIL - Multithreading vs. Multiprocessing
Beating the (sh** out of the) GIL - Multithreading vs. Multiprocessing
 
Thinking Hybrid - Python/C++ Integration
Thinking Hybrid - Python/C++ IntegrationThinking Hybrid - Python/C++ Integration
Thinking Hybrid - Python/C++ Integration
 
Thinking Hybrid - Python/C++ Integration
Thinking Hybrid - Python/C++ IntegrationThinking Hybrid - Python/C++ Integration
Thinking Hybrid - Python/C++ Integration
 
Gaining Colour Stability in Live Image Capturing
Gaining Colour Stability in Live Image CapturingGaining Colour Stability in Live Image Capturing
Gaining Colour Stability in Live Image Capturing
 
LaTeX Introduction for Word Users
LaTeX Introduction for Word UsersLaTeX Introduction for Word Users
LaTeX Introduction for Word Users
 
Thinking Hybrid - Python/C++ Integration
Thinking Hybrid - Python/C++ IntegrationThinking Hybrid - Python/C++ Integration
Thinking Hybrid - Python/C++ Integration
 

Dernier

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 

Dernier (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

Operations Research and Optimization in Python using PuLP

  • 1. Optimisation Dr. Stuart Mitchell LMRC University of Auckland s.mitchell@auckland.ac.nz Kiwi Pycon 2009
  • 2. Contents of presentation What is Mathematical Programing When is it useful The Wedding Guest Problem
  • 3. What is Mathematical programing • A simple mathematically precise way of stating optimisation problems. • Use mathematically rigorous way to find a solution
  • 4. 30 teams – 162 games
  • 5.
  • 6. What is Mathematical programing • A simple mathematically precise way of stating optimisation problems. • Use mathematically rigorous way to find a solution
  • 7. What is Mathematical programing • A simple mathematically precise way of stating optimisation problems. • Use mathematically rigorous way to find a solution
  • 8. When is it useful • There is a decision problem • There is lots of data • There is money to be made
  • 9. The wedding guest problem • Similar to work at LMRC • A wedding planner whats to work out seating allocations http://weddingelegante.com * Tables near the head table (or sweetheart table) should be reserved for your closest family and friends * If you’re using round tables, you should generally assign males and females to alternating seats * Don’t forget to use your guests’ ages and interests when assigning * Grouping your guests into identifiable cliques (grooms college friends, work colleagues, friends of your parents, etc.) will make grouping guests together at specific tables easier * Seat children under 8 years of age at the same table as their parents, but if you’re expecting a great deal of 8+ children to attend, you may consider creating a “kids-only” table * Leave 2-3 tables empty for vendors during their breaks or for unexpected guests * Have a large diagram of the completed seating chart on hand at the reception venue on your wedding day to solve any confusion
  • 10. The wedding guest problem • We need to define – A solution – what is the result we want
  • 11. The wedding guest problem • We need to define – A solution – what is the result we want – Variables – parts of the solution
  • 12. The wedding guest problem • We need to define – A solution – what is the result we want – Variables – parts of the solution – Objective function – how to compare solutions
  • 13. The wedding guest problem • We need to define – A solution – what is the result we want – Variables – parts of the solution – Objective function – how to compare solutions – Constraints – define a solution • In terms of the variables
  • 14. Mathematical expression of the problem • This is a set partitioning problem. – We wish to partition the set of guests into subsets of tables. – We wish to maximise happiness of the tables. – We want everyone to be seated at exactly one table. • This is implemented in the following python code
  • 15. Wedding Planning Formulation Let guests be the set of all guests.
  • 16. Wedding Planning Formulation Use pulp.allcombinations to generate a list of all possible table seatings.
  • 17. Wedding Planning Formulation Then we create a binary variable that will be 1 if the table will be in the solution, or zero
  • 18. Wedding Planning Formulation We create the LpProblem and then make the objective function.
  • 19. Wedding Planning Formulation We create the LpProblem and then make the objective function.
  • 20. Wedding Planning Formulation We specify the total number of tables allowed in the solution.
  • 21. Wedding Planning Formulation Multiple similar constraints (one of each guest) guarantee that a guest is allocated to exactly one table.
  • 22. Wedding Planning Formulation Solve the problem and print out an answer. The choosen tables are out of a total of 3213: ('M', 'N') ('E', 'F', 'G') ('A', 'B', 'C', 'D') ('I', 'J', 'K', 'L') ('O', 'P', 'Q', 'R')
  • 23. Why Pulp • MIT Licence • Installation (google-code or pypi) • Syntax • Interoperabilty • Documentation
  • 24. Next time you are talking to a client • Is there a decision problem? • Is there lots of data? • Is there money to be made?