SlideShare a Scribd company logo
1 of 15
Using OptaPlanner for the
VeRoLog Solver Challenge
Raúl Martín Santamaría (raul.martin@urjc.es)
Index
•Introduction to OptaPlanner
•Advantages – Disadvantages
•Approach
•Results
•Conclusions
2 / 15
Introduction to OptaPlanner
•Planning Engine / Constraint Solver
•Made in Java: Library & Standalone
•Uses heuristics and metaheuristics
under the hood
3 / 15
https://www.optaplanner.org/
Advantages – Disadvantages
4 / 15
Advantages
•Offers many state of
the art algorithms,
ready to use
•Open source, free for
any use case
•Embeddable, easily
integrated with any
JVM language
Disadvantages:
•Correct modeling is
tricky
•Generic Solver:
•Configuration can be hard
to tune
•Performance
What is a Planning Problem?
•“Optimize goals with limited resources
under a set of constraints”
5 / 15
Goal
• Minimize
drivers cost
• Minimize
technicians
cost
• ….
Resources
• Trucks
• Technicians
Constraints
• Delivery
Window
• Technicians
skills
• …
Approach
6 / 15
Model
Problem
Configure
Algorithms
Run!
Repeat steps 2 and 3 until satisfactory results.
Model
7 / 15
• Model Routes using Chains of elements
Model
8 / 15
• Model Routes using Chains of elements
Truck 1 Req 5 Req 4
Truck 2 Req 3
Tech 1 Req 5 Req 3 Req 4
(Truck/Technician always as first element)
Model: Scoring
•Scoring: neutral way to compare two
different solutions.
•Hard / Soft score approach:
•Hard Score: broken constraints
•Soft Score: total cost
9 / 15
Hard Score ≠ 0  Not a valid solution!
Configure Algorithms
10 / 15
Configure Strategy
Hill Climbing Tabu Search
Simulated
Annealing
VND …
Select neighborhoods
Change Swap Chain Move Chain Swap Chain 2-opt...
Choose Constructive
First fit Cheapest insertion Regret insertion ...
Configure Algorithms - Example
11 / 15
Run
12 / 15
Load instance, solve and save result
Results
13 / 15
Example instance, full results and more info available in verolog2019.ortec.com
Conclusions
•Fast prototyping.
•Easily test of different strategies.
•Generate results with low effort.
•Even if the generated solutions are not
good enough, it is always nice to have a
baseline.
14 / 15
Thank you! – Questions?
Using Optaplanner for the Solver Challenge.
Raúl Martín Santamaría (raul.martin@urjc.es)

More Related Content

Similar to Using Optaplanner for the Verolog Solver Challenge

Graal Tutorial at CGO 2015 by Christian Wimmer
Graal Tutorial at CGO 2015 by Christian WimmerGraal Tutorial at CGO 2015 by Christian Wimmer
Graal Tutorial at CGO 2015 by Christian Wimmer
Thomas Wuerthinger
 
Anupam_Chaubey_QA_Resume_1Sep
Anupam_Chaubey_QA_Resume_1SepAnupam_Chaubey_QA_Resume_1Sep
Anupam_Chaubey_QA_Resume_1Sep
anupam chaubey
 
Hybrid Automation Framework Developement
Hybrid Automation Framework DevelopementHybrid Automation Framework Developement
Hybrid Automation Framework Developement
Glasdon Falcao
 
smalltalk numbercrunching
smalltalk numbercrunchingsmalltalk numbercrunching
smalltalk numbercrunching
Daniel Poon
 

Similar to Using Optaplanner for the Verolog Solver Challenge (20)

Optimica Compiler Toolkit - Overview
Optimica Compiler Toolkit - OverviewOptimica Compiler Toolkit - Overview
Optimica Compiler Toolkit - Overview
 
sudhir_2016
sudhir_2016sudhir_2016
sudhir_2016
 
JavaMicroBenchmarkpptm
JavaMicroBenchmarkpptmJavaMicroBenchmarkpptm
JavaMicroBenchmarkpptm
 
Primavera P6 Tips and Tricks
Primavera P6 Tips and TricksPrimavera P6 Tips and Tricks
Primavera P6 Tips and Tricks
 
Tim gray
Tim grayTim gray
Tim gray
 
Graal Tutorial at CGO 2015 by Christian Wimmer
Graal Tutorial at CGO 2015 by Christian WimmerGraal Tutorial at CGO 2015 by Christian Wimmer
Graal Tutorial at CGO 2015 by Christian Wimmer
 
Oracle ADF Architecture TV - Development - Logging
Oracle ADF Architecture TV - Development - LoggingOracle ADF Architecture TV - Development - Logging
Oracle ADF Architecture TV - Development - Logging
 
Webinar: Estrategias para optimizar los costos de testing
Webinar: Estrategias para optimizar los costos de testingWebinar: Estrategias para optimizar los costos de testing
Webinar: Estrategias para optimizar los costos de testing
 
Anupam_Chaubey_QA_Resume_1Sep
Anupam_Chaubey_QA_Resume_1SepAnupam_Chaubey_QA_Resume_1Sep
Anupam_Chaubey_QA_Resume_1Sep
 
Sdlc
SdlcSdlc
Sdlc
 
Scaling machinelearning as a service at uber li Erran li - 2016
Scaling machinelearning as a service at uber li Erran li - 2016Scaling machinelearning as a service at uber li Erran li - 2016
Scaling machinelearning as a service at uber li Erran li - 2016
 
Scaling machine learning as a service at Uber — Li Erran Li at #papis2016
Scaling machine learning as a service at Uber — Li Erran Li at #papis2016Scaling machine learning as a service at Uber — Li Erran Li at #papis2016
Scaling machine learning as a service at Uber — Li Erran Li at #papis2016
 
Hybrid Automation Framework Developement
Hybrid Automation Framework DevelopementHybrid Automation Framework Developement
Hybrid Automation Framework Developement
 
smalltalk numbercrunching
smalltalk numbercrunchingsmalltalk numbercrunching
smalltalk numbercrunching
 
Real-World Load Testing of ADF Fusion Applications Demonstrated - Oracle Ope...
Real-World Load Testing of ADF Fusion Applications Demonstrated  - Oracle Ope...Real-World Load Testing of ADF Fusion Applications Demonstrated  - Oracle Ope...
Real-World Load Testing of ADF Fusion Applications Demonstrated - Oracle Ope...
 
Hotspot & AOT
Hotspot & AOTHotspot & AOT
Hotspot & AOT
 
Past Experiences and Future Challenges using Automatic Performance Modelling ...
Past Experiences and Future Challenges using Automatic Performance Modelling ...Past Experiences and Future Challenges using Automatic Performance Modelling ...
Past Experiences and Future Challenges using Automatic Performance Modelling ...
 
Berlin QA - Performance Testing
Berlin QA - Performance TestingBerlin QA - Performance Testing
Berlin QA - Performance Testing
 
Continuous testing in agile projects 2015
Continuous testing in agile projects 2015Continuous testing in agile projects 2015
Continuous testing in agile projects 2015
 
Load Testing: See a Bigger Picture, ALM Forum, 2014
Load Testing: See a Bigger Picture, ALM Forum, 2014Load Testing: See a Bigger Picture, ALM Forum, 2014
Load Testing: See a Bigger Picture, ALM Forum, 2014
 

Recently uploaded

Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 

Recently uploaded (20)

Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...
WSO2Con2024 - Facilitating Broadband Switching Services for UK Telecoms Provi...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdfAzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
AzureNativeQumulo_HPC_Cloud_Native_Benchmarks.pdf
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
WSO2Con2024 - Navigating the Digital Landscape: Transforming Healthcare with ...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
WSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAMWSO2Con2024 - Organization Management: The Revolution in B2B CIAM
WSO2Con2024 - Organization Management: The Revolution in B2B CIAM
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
 
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public AdministrationWSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
WSO2CON 2024 - How CSI Piemonte Is Apifying the Public Administration
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AI
 
WSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration ToolingWSO2Con2024 - Low-Code Integration Tooling
WSO2Con2024 - Low-Code Integration Tooling
 
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
WSO2CON 2024 - IoT Needs CIAM: The Importance of Centralized IAM in a Growing...
 

Using Optaplanner for the Verolog Solver Challenge

  • 1. Using OptaPlanner for the VeRoLog Solver Challenge Raúl Martín Santamaría (raul.martin@urjc.es)
  • 2. Index •Introduction to OptaPlanner •Advantages – Disadvantages •Approach •Results •Conclusions 2 / 15
  • 3. Introduction to OptaPlanner •Planning Engine / Constraint Solver •Made in Java: Library & Standalone •Uses heuristics and metaheuristics under the hood 3 / 15 https://www.optaplanner.org/
  • 4. Advantages – Disadvantages 4 / 15 Advantages •Offers many state of the art algorithms, ready to use •Open source, free for any use case •Embeddable, easily integrated with any JVM language Disadvantages: •Correct modeling is tricky •Generic Solver: •Configuration can be hard to tune •Performance
  • 5. What is a Planning Problem? •“Optimize goals with limited resources under a set of constraints” 5 / 15 Goal • Minimize drivers cost • Minimize technicians cost • …. Resources • Trucks • Technicians Constraints • Delivery Window • Technicians skills • …
  • 6. Approach 6 / 15 Model Problem Configure Algorithms Run! Repeat steps 2 and 3 until satisfactory results.
  • 7. Model 7 / 15 • Model Routes using Chains of elements
  • 8. Model 8 / 15 • Model Routes using Chains of elements Truck 1 Req 5 Req 4 Truck 2 Req 3 Tech 1 Req 5 Req 3 Req 4 (Truck/Technician always as first element)
  • 9. Model: Scoring •Scoring: neutral way to compare two different solutions. •Hard / Soft score approach: •Hard Score: broken constraints •Soft Score: total cost 9 / 15 Hard Score ≠ 0  Not a valid solution!
  • 10. Configure Algorithms 10 / 15 Configure Strategy Hill Climbing Tabu Search Simulated Annealing VND … Select neighborhoods Change Swap Chain Move Chain Swap Chain 2-opt... Choose Constructive First fit Cheapest insertion Regret insertion ...
  • 11. Configure Algorithms - Example 11 / 15
  • 12. Run 12 / 15 Load instance, solve and save result
  • 13. Results 13 / 15 Example instance, full results and more info available in verolog2019.ortec.com
  • 14. Conclusions •Fast prototyping. •Easily test of different strategies. •Generate results with low effort. •Even if the generated solutions are not good enough, it is always nice to have a baseline. 14 / 15
  • 15. Thank you! – Questions? Using Optaplanner for the Solver Challenge. Raúl Martín Santamaría (raul.martin@urjc.es)

Editor's Notes

  1. Intro myself, name group university I am going to talk about my approach to the Verolog solver challenge
  2. This is the outline of my talk First I am going to introduce the used tool, Optaplanner, with it's advantages and disadvantages. Then how I have used it to model and solve the problem And finally the results and the conclusion.
  3. OptaPlanner is an opensource planning engine or constraint solver, made in Java, that can both work as a library, integrated into any other application, or standalaone, as a solver server. It uses heuristics and metaheuristics under the hood to solve planning problems.
  4. So why did I choose Optaplanner? Offers a wide variety of algorithms ready to use. Open Source: under the Apache Commons license. Free for any use case, including comercial ones Embeddable, which means it can be easily integrated into any existing application However, it has some inconvenients Creating a correct model can be tricky Generic Solver: Config can be hard to prepare for an specific purpouse, getting good performance requires effort.
  5. I said earlier that Optaplanner solves planning problems, but, what is exactly a Planning Problem? Definition source: OptaPlanner docs The formal definition is too long and boring, so I opted to include a simpler one, {…} In our case, the goal, is to minize both the drivers cost and the technicians cost The resources are the trucks, technicians And we have several constraints that we must met {…}
  6. So how do we solve this problem using Optaplanner? We can simplify the whole process in three steps: Modeling the problem, configuring the algorithms, and running the app and getting feedback.
  7. Start with a simple model, add complexity if necessary. We will model the routes using chains of elements, we have 3 classes Truck, Request and Technician Trucks and requests form the transport chain, while technicians and requests form the technician chain. And what do they all have in common? They are all Planning entities, which means they are going to be modified by the solver
  8. This is another way to view the chains, here you can see the chain is started either by a Truck or a Technician, depending on the chain type, and the elements are concatenated one after another.
  9. Hard Score: Number of broken constraints, such us overloaded trucks, invalid technicians assigments Softscore: the sum of all the independent costs DOES NOT MATTER HOW GOOD THE SOFTSCORE IS IF THE HARDSCORE IS NOT 0, the solution is not feasible.
  10. We first select a Constructive strategy from the available ones: First fit, first fit decreasing, regret insertion, cheapest insertion, Then, we select the local search neighborhoods, and configure them if necessary Finally we choose an improvement strategy (Tabu Search)
  11. How is this done from the programmers viewpoint? Simple, with an XML file. This is an example configuration, in fact one of the firsts versions for the challenge (SIMPLIFIED) I will highlight the most important bits {…}
  12. And that’s all, we are ready to launch the application and start solving. With this fragment of code, we load the instance, generate a solution and save it. And that’s all. You may think, this is too simple, you cant get good results with that but…..
  13. In average, the solutions rank in the middle – upper middle of the scoreboard. This is one of the bests results, as you can see it is the fifth of thirteen participants. Note that even if this is not the best solution, the score is not really far from the best.
  14. To sum it up, You dont know how different strategies will work for a given problem, why waste time programming or building an approach that may not be the best? And one last point, {….}. This can be the case if, for example, you are on a paper, and there arent previous works, OptaPlanner can be used to compare the results.
  15. Thank you, and I am ready for your questions. If there arent any (more) questions, I hope you have enjoyed this presentation and thank you for your time.