Apidays New York 2024 - The value of a flexible API Management solution for O...
Slides.pptx
1. Digital Transformation | Software Development | Systems Integration
Audacia
Problem Solved:
Implementing Google OR Tools 🍕
Owen Lacey, Principal Consultant
2. Digital Transformation | Software Development | Systems Integration
About me
• 👨🎓 Bsc Mathematics - Warwick
• 💼 Audacia Consulting since 2016
• 😍 OR Tools, ML.NET
3. Digital Transformation | Software Development | Systems Integration
Introduction
• 🕵🕵♂️ Optimisation problems & their identification
• 🚀 Google OR Tools
• 🍕 Worked example: Pizza party
• ⁉ Conclusion & questions
4. Digital Transformation | Software Development | Systems Integration
Optimisation problems
• What makes a problem an optimisation problem?
• Many possible solutions
• Each solution scorable
• Feasible vs. Optimal
• Not knowing the ‘how’
• Reducing a problem into constraints
5. Digital Transformation | Software Development | Systems Integration
Optimisation problems
Example – Shift Scheduling:
Create a schedule for a workforce, with the following rules:
• A minimum of 3 employees must be working at any given time
• Each employee can’t work more than 35 hours / week
• Employee A won’t work on Thursdays
• Employee B would prefer not to work nights
6. Digital Transformation | Software Development | Systems Integration
Optimisation problems
Example – Shift Scheduling:
Create a schedule for a workforce, with the following rules:
• A minimum of 3 employees must be working at any given time
• Each employee cannot work more than 35 hours / week
• Employee A cannot work on Thursdays
• Employee B would prefer not to work nights
7. Digital Transformation | Software Development | Systems Integration
Google OR Tools
• Est 2011.
• Free, open source toolkit for solving
optimisation problems.
• Black-boxed using a combination of
commercial solvers (e.g IBM’s CPLEX solver),
open-source solvers (SCIP), and their award-
winning in-house solvers (Google’s CP-SAT).
• Written in C++
• Python, Java, .NET wrappers
8. Digital Transformation | Software Development | Systems Integration
Google OR Tools
• Alternatives: OptaPlanner (Java) and GECODE
(C++) & others.
9. Digital Transformation | Software Development | Systems Integration
Google OR Tools
Use cases:
• Task Assignment
• Scheduling: Workshops / Shifts
• Routing: Travelling Salesman
• Bin packing
• Network Flows: Min/Max cost flow
• Linear/Constraint Optimisation
10. Digital Transformation | Software Development | Systems Integration
Google OR Tools
Linear/Constraint Optimisation with ‘feasible’ output
11. Digital Transformation | Software Development | Systems Integration
Google OR Tools
.NET:
2 NuGet packages:
• OR Tools
• OS Runtime (Windows / Mac / Linux)
12. Digital Transformation | Software Development | Systems Integration
Examples
🍕 Give out pizza (Assignment)
• Each person gets a maximum of one pizza.
• No pizza is shared.
• Pizza is leftover if there are more pizzas than people.
13. Digital Transformation | Software Development | Systems Integration
Examples
🍕 Give out pizza (Assignment)
14. Digital Transformation | Software Development | Systems Integration
Resources
Today’s code:
https://github.com/audaciaconsulting/Audacia.OrToolsPlayground/
OR-Tools repo
https://github.com/google/or-tools
OR Tools homepage
https://developers.google.com/optimization
Audacia Blog:
https://www.audacia.co.uk/technical-blog
Resources
As people, we face many problems / obstacles every day.
But for problems that can be solved in many ways, as rational humans we tend to opt for the solution that gives us the best result, based our pre-conceived ideas of what a ‘good’ outcome is.
EXAMPLE Getting to work – not an optimisation problem, but still requires formalisation
Splitting problems into smaller chunks & rules.
WHAT MAKES A SOLUTION GOOD?