Optaplanner User Guide

Total Page:16

File Type:pdf, Size:1020Kb

Optaplanner User Guide OptaPlanner User Guide The OptaPlanner team [http://www.optaplanner.org/community/team.html] OptaPlanner User Guide by Version 6.3.0.Beta2 1. OptaPlanner Introduction ............................................................................................ 1 1.1. What is OptaPlanner? ......................................................................................... 1 1.2. Requirements ..................................................................................................... 3 1.3. What is a Planning Problem? .............................................................................. 4 1.3.1. A Planning Problem is NP-complete or NP-hard ......................................... 4 1.3.2. A Planning Problem Has (Hard and Soft) Constraints ................................. 5 1.3.3. A Planning Problem Has a Huge Search Space ......................................... 5 1.4. Download and Run the Examples ........................................................................ 6 1.4.1. Get the Release .zip and Run the Examples .............................................. 6 1.4.2. Run the Examples in an IDE (IntelliJ, Eclipse, NetBeans) ............................ 9 1.4.3. Use OptaPlanner with Maven, Gradle, Ivy, Buildr or ANT .......................... 10 1.4.4. Build OptaPlanner from Source ............................................................... 11 1.5. Governance ...................................................................................................... 12 1.5.1. Status of OptaPlanner ............................................................................ 12 1.5.2. Backwards Compatibility ......................................................................... 12 1.5.3. Community and Support ......................................................................... 13 1.5.4. Relationship with Drools and jBPM .......................................................... 13 2. Quick Start ................................................................................................................. 15 2.1. Cloud Balancing Tutorial ................................................................................... 15 2.1.1. Problem Description ............................................................................... 15 2.1.2. Problem Size ......................................................................................... 16 2.1.3. Domain Model Design ............................................................................ 17 2.1.4. Main Method .......................................................................................... 18 2.1.5. Solver Configuration ............................................................................... 19 2.1.6. Domain Model Implementation ................................................................ 20 2.1.7. Score Configuration ................................................................................ 23 2.1.8. Beyond this Tutorial ............................................................................... 26 3. Use Cases and Examples .......................................................................................... 27 3.1. Examples Overview .......................................................................................... 27 3.2. Basic Examples ................................................................................................ 31 3.2.1. N Queens .............................................................................................. 31 3.2.2. Cloud Balancing ..................................................................................... 34 3.2.3. Traveling Salesman (TSP - Traveling Salesman Problem) ......................... 34 3.2.4. Dinner Party .......................................................................................... 35 3.2.5. Tennis Club Scheduling .......................................................................... 36 3.3. Real Examples ................................................................................................. 37 3.3.1. Course Timetabling (ITC 2007 Track 3 - Curriculum Course Scheduling) .... 37 3.3.2. Machine Reassignment (Google ROADEF 2012) ...................................... 39 3.3.3. Vehicle Routing ...................................................................................... 42 3.3.4. Project Job Scheduling ........................................................................... 52 3.3.5. Hospital Bed Planning (PAS - Patient Admission Scheduling) .................... 55 3.4. Difficult Examples ............................................................................................. 58 3.4.1. Exam Timetabling (ITC 2007 track 1 - Examination) ................................. 58 3.4.2. Employee Rostering (INRC 2010 - Nurse Rostering) ................................. 62 iii OptaPlanner User Guide 3.4.3. Traveling Tournament Problem (TTP) ...................................................... 69 3.4.4. Cheap Time Scheduling ......................................................................... 72 4. Planner Configuration ................................................................................................ 77 4.1. Overview .......................................................................................................... 77 4.2. Solver Configuration .......................................................................................... 78 4.2.1. Solver Configuration by XML .................................................................. 78 4.2.2. Solver Configuration by Java API ............................................................ 79 4.3. Model a Planning Problem ................................................................................ 79 4.3.1. Is This Class a Problem Fact or Planning Entity? ..................................... 79 4.3.2. Annotation alternatives ........................................................................... 81 4.3.3. Problem Fact ......................................................................................... 82 4.3.4. Planning Entity ....................................................................................... 83 4.3.5. Planning Variable ................................................................................... 86 4.3.6. Planning Value and Planning Value Range .............................................. 88 4.3.7. Shadow Variable .................................................................................... 96 4.3.8. Planning Problem and Planning Solution ................................................ 102 4.4. Use the Solver .............................................................................................. 109 4.4.1. The Solver Interface ............................................................................ 109 4.4.2. Solving a Problem ................................................................................ 110 4.4.3. Environment Mode: Are There Bugs in my Code? .................................. 111 4.4.4. Logging Level: What is the Solver Doing? ............................................. 113 4.4.5. Random Number Generator .................................................................. 116 5. Score Calculation ..................................................................................................... 117 5.1. Score Terminology .......................................................................................... 117 5.1.1. What is a Score? ................................................................................. 117 5.1.2. Score Constraint Signum (Positive or Negative) ...................................... 118 5.1.3. Score Constraint Weight ....................................................................... 119 5.1.4. Score Level .......................................................................................... 120 5.1.5. Pareto Scoring (AKA Multi-objective Optimization Scoring) ...................... 123 5.1.6. Combining Score Techniques ................................................................ 125 5.1.7. Score interface ..................................................................................... 125 5.1.8. Avoid Floating Point Numbers in Score Calculation ................................. 126 5.2. Choose a Score Definition ............................................................................... 128 5.2.1. SimpleScore ......................................................................................... 128 5.2.2. HardSoftScore (Recommended) ............................................................ 128 5.2.3. HardMediumSoftScore .......................................................................... 129 5.2.4. BendableScore ..................................................................................... 129 5.2.5. Implementing a Custom Score .............................................................. 129 5.3. Calculate the Score ........................................................................................ 130 5.3.1. Score Calculation Types ....................................................................... 130 5.3.2. Easy Java Score Calculation ................................................................. 130 5.3.3. Incremental Java Score Calculation ....................................................... 132 5.3.4. Drools Score Calculation ....................................................................... 135 5.3.5. InitializingScoreTrend ...........................................................................
Recommended publications
  • Case Management Task Assignment Using Optaplanner
    Masaryk University Faculty of Informatics Case Management Task Assignment Using OptaPlanner Master’s Thesis Bc. Marián Macik Brno, Fall 2016 Replace this page with a copy of the official signed thesis assignment anda copy of the Statement of an Author. Declaration Hereby I declare that this paper is my original authorial work, which I have worked out on my own. All sources, references, and literature used or excerpted during elaboration of this work are properly cited and listed in complete reference to the due source. Bc. Marián Macik Advisor: Mgr. Marek Grác, Ph.D. i Acknowledgement Here I would like to thank my family, friends and colleagues for their support during the work on this thesis. Moreover, I thank my consul- tant, Mgr. Ivo Bek, for guiding me during my work and for helping me overcome issues experienced when writing this thesis. I would also like to thank my advisor, Mgr. Marek Grác, Ph.D., for his help regarding the text of the thesis and for his advice in initial stages of the work. Finally, I would especially like to thank Maciej Swiderski for his help with the configuration of jBPM engine and Geoffrey De Smet for his help with OptaPlanner. ii Abstract The aim of the thesis is to analyse, design and implement a module for automated task assignment by integrating jBPM engine and Op- taPlanner. The thesis describes case management, its difference from business process management and their notations. After that, jBPM engine together with OptaPlanner are explained. In the second half of the thesis, the actual implementation and prototype application are presented, including the performance tests in different OptaPlanner configurations and scenarios.
    [Show full text]
  • Vrpsolver: a Generic Exact Solver for Vehicle Routing and Related Problems
    VRPSolver: a Generic Exact Solver for Vehicle Routing and Related Problems Eduardo Uchoa Departamento de Engenharia de Produ¸c~ao Universidade Federal Fluminense Niter´oi- RJ, Brasil SPOC20 { School on Advanced BCP Tools { Paris A Generic Exact Solver for VRP Vehicle Routing Problem (VRP) One of the most widely studied in Combinatorial Optimization: +7,500 works published only in 2018 (Google Scholar), mostly heuristics Direct application in the real systems that distribute goods and provide services. Optimized routes can: save a lot of money reduce the environmental impacts of transportation SPOC20 { School on Advanced BCP Tools { Paris A Generic Exact Solver for VRP Example: In 2017, Amazon spent USD 21.7B in shipping, 14.2% of its net sales. As customers demand quicker service, this percentage is growing! SPOC20 { School on Advanced BCP Tools { Paris A Generic Exact Solver for VRP Vehicle Routing Problem (VRP) Reflecting the variety of real transportation systems, VRP literature is spread into hundreds of variants. For example, there are variants that consider: Vehicle capacities, Time windows, Heterogeneous fleets, Multiple depots, Split delivery, pickup and delivery, backhauling, Arc routing (Ex: garbage collection), etc, etc. Articles describing new variants appear every week SPOC20 { School on Advanced BCP Tools { Paris A Generic Exact Solver for VRP Outline of the presentation Part I - Advances on Exact CVRP algorithms Review of the advances in the last 15 years Part II - From CVRP to other classic VRP variants Part III - A Generic
    [Show full text]
  • A New Approach for Solving the Disruption in Vehicle Routing Problem During the Delivery a Comparative Analysis of VRP Meta-Heuristics
    Master of Science in Computer Science May 2020 A New Approach for Solving the Disruption in Vehicle Routing Problem During the Delivery A Comparative Analysis of VRP Meta-Heuristics Sai Chandana Kaja Faculty of Computing, Blekinge Institute of Technology, 371 79 Karlskrona, Sweden This thesis is submitted to the Faculty of Computing at Blekinge Institute of Technology in partial fulfillment of the requirements for the degree of Master of Science in Computer Science. The thesis is equivalent to 20 weeks of full-time studies. I declare that I am the sole author of this thesis and have not used any sources other than those listed in the bibliography and identified as references. I further declare that I have not submitted this thesis at any other institution to obtain a degree. Contact Information: Author(s): Sai Chandana Kaja E-mail: [email protected] University advisor: Dr. Julia Sidorova Department of Computer Science Blekinge Institute of Technology, Karlskrona, Sweden Faculty of Computing Internet : www.bth.se Blekinge Institute of Technology Phone : +46 455 38 50 00 SE–371 79 Karlskrona, Sweden Fax : +46 455 38 50 57 Abstract Context. The purpose of this research paper is to describe a new approach for solving the disruption in the vehicle routing problem (DVRP) which deals with the disturbance that will occur unexpectedly within the distribution area when executing the original VRP plan. The paper then focuses further on the foremost common and usual problem in real-time scenarios i.e., vehicle-breakdown part. Therefore, the research needs to be accomplished to deal with these major dis- ruption in routing problems in transportation.
    [Show full text]
  • School of Science and Engineering Capstone Report
    School of Science and Engineering Capstone Report Applications of the Vehicle Routing Problem to Logistics Optimization Submitted in: Fall 2017 Written By: RIDA ELBOUSTANI Supervised by: Dr. Abderrazak Elboukili & Dr. Ilham Kissani Table of Contents List of Acronyms and Abbreviations .......................................................................................... 5 List of figures ................................................................................................................................. 6 Acknowledgements ....................................................................................................................... 7 Abstract .......................................................................................................................................... 8 Introduction ................................................................................................................................... 9 Scope of the Project: .................................................................................................................. 9 STEEPLE Analysis: ................................................................................................................ 10 SWOT Analysis: ...................................................................................................................... 11 Literature Review ....................................................................................................................... 12 Overview of the Vehicle Routing Problem ...........................................................................
    [Show full text]
  • Technical Program
    TECHNICAL PROGRAM Wednesday, 9:00-10:30 Wednesday, 11:00-12:40 WA-01 WB-01 Wednesday, 9:00-10:30 - 1a. Europe a Wednesday, 11:00-12:40 - 1a. Europe a Opening session - Plenary I. Ljubic Planning and Operating Metropolitan Passenger Transport Networks Stream: Plenaries and Semi-Plenaries Invited session Stream: Traffic, Mobility and Passenger Transportation Chair: Bernard Fortz Invited session Chair: Oded Cats 1 - From Game Theory to Graph Theory: A Bilevel Jour- ney 1 - Frequency and Vehicle Capacity Determination using Ivana Ljubic a Dynamic Transit Assignment Model In bilevel optimization there are two decision makers, commonly de- Oded Cats noted as the leader and the follower, and decisions are made in a hier- The determination of frequencies and vehicle capacities is a crucial archical manner: the leader makes the first move, and then the follower tactical decision when planning public transport services. All meth- reacts optimally to the leader’s action. It is assumed that the leader can ods developed so far use static assignment approaches which assume anticipate the decisions of the follower, hence the leader optimization average and perfectly reliable supply conditions. The objective of this task is a nested optimization problem that takes into consideration the study is to determine frequency and vehicle capacity at the network- follower’s response. level while accounting for the impact of service variations on users In this talk we focus on new branch-and-cut (B&C) algorithms for and operator costs. To this end, we propose a simulation-based op- dealing with mixed-integer bilevel linear programs (MIBLPs).
    [Show full text]
  • Handbook of Good Practice
    www.interreg-danube.eu/Smart-Factory-Hub DOCUMENT TITLE: HANDBOOK OF GOOD PRACTICE Project: Improving RD and business policy conditions for transnational cooperation in the manufacturing industry Acronym: Smart Factory Hub Work package WP4: Improving Knowledge Base Activity A 4.2: Good practice handbook tool Deliverable D 4.2.3: Handbook tool report Date of issue 29.12.2017 Document issued by UTCN Contributors PTP, HAMAG, USTUTT, PRO, UWB, SCCI, PBN, BICT, CCIS Version xx.x Number of Pages 243 Dissemination level PU Public PP Restricted to other Programme participants RE Restricted to a group specified by the consortium CO Confidential, only for members of the consortium X Project co-funded by European Union funds (ERDF, IPA) www.interreg-danube.eu/Smart-Factory-Hub TARGET GROUP ASSESSMENT Has this deliverable addressed any of the target group indicated in the application form? Yes / No If yes, please describe the involvement of each individual target group in the table below. Number Target group reached by the Description of target group involvement deliverable SME 5x SME which provide data for good practice Regional public authority National public authority Higher education and research Business support organisation Project co-funded by European Union funds (ERDF, IPA) Page: 2/243 www.interreg-danube.eu/Smart-Factory-Hub CONTENT 1 Introduction ......................................................................................................................... 6 2 About SFH Project .............................................................................................................
    [Show full text]
  • Systems in Der Verkehrszentrale Einer Fluggesellschaft
    Entwicklung und Einsatz eines Entscheidungsunterstützungs- systems in der Verkehrszentrale einer Fluggesellschaft Vom Fachbereich Rechts- und Wirtschaftswissenschaften der Technischen Universität Darmstadt zur Erlangung des akademischen Grades Doctor rerum politicarum (Dr. rer. pol.) genehmigte Dissertation von Sebastian Heger Erstgutachter: Prof. Dr. Dr. h.c. mult. Hans-Christian Pfohl Zweitgutachterin: Jun.–Prof. Dr. Anne Lange Darmstadt — 2018 Fachbereich Rechts- und Wirtschaftswissenschaften Supply Chain- und Netzwerkmanagement Heger, Sebastian: Entwicklung und Einsatz eines Entscheidungsunterstützungssystems in der Verkehrszentrale einer Fluggesellschaft Darmstadt, Technische Universität Darmstadt Tag der mündlichen Prüfung: 05.07.2018 Jahr der Veröffentlichung: 2018 (TUprints) Bitte zitieren Sie dieses Dokument als: URN: urn:nbn:de:tuda-tuprints-76367 URL: http://tuprints.ulb.tu-darmstadt.de/id/eprint/7636 Dieses Dokument wird bereitgestellt von tuprints, E-Publishing-Service der TU Darmstadt http://tuprints.ulb.tu-darmstadt.de [email protected] Die Veröffentlichung steht unter folgender Creative Commons Lizenz: Namensnennung — Nicht-kommerziell — Keine Bearbeitung 4.0 International https://creativecommons.org/licenses/by-nc-nd/4.0/ Zusammenfassung Faktoren wie Globalisierung, Liberalisierung und verbesserte Produktionsfaktoren fungieren in den letzten Jahrzehnten als Treiber für ein kontinuierliches Wachstum im kommerziellen Luft- verkehr. Dementsprechend ist auch die Steuerung des operativen Betriebes der einzelnen Flugge-
    [Show full text]
  • Prescriptive Analytics for Business Leaders
    PRESCRIPTIVE ANALYTICS FOR BUSINESS LEADERS PETER BULL CARLOS CENTURION SHANNON KEARNS ERIC KELSO NARI VISWANATHAN PRESCRIPTIVE ANALYTICS: FOR BUSINESS LEADERS 1 PRESCRIPTIVE ANALYTICS FOR BUSINESS LEADERS BY PETER BULL, CARLOS CENTURION, SHANNON KEARNS, ERIC KELSO AND NARI VISWANATHAN EXPLORE: • THE DIFFERENT APPROACHES TO PRESCRIPTIVE ANALYTICS • THE TRANSFORMATIONAL VALUE IT BRINGS TO BUSINESS LEADERS • HOW TO DETERMINE IF YOUR COMPANY IS READY FOR PRESCRIPTIVE • A STEP-WISE APPROACH TO FINDING YOUR FIRST USE CASE AND GETTING STARTED • SOME REAL-WORLD, CROSS-INDUSTRY APPLICATIONS 2 FOREWORD FOREWORD BY ANDRE BOISVERT With over 35 years in the technology industry, leadership roles at IBM, Oracle and SAS Institute, Inc., and a co-founder of the world’s most popular commercial open source business intelligence platforms (Pentaho Corporation), Andre Boisvert is a thought-leader in the business analytics space. He serves on multiple boards, including servings as River Logic’s Board Vice Chairman and Senior Advisor. More and more, business leaders are becoming responsible for understanding how to appropriately leverage business analytics to drive value, both within their business unit as well as companywide. Simply being familiar with the types of business analytics is no longer enough, however; leaders must familiarize themselves with the kinds of problems for which each type of analytics is best suited. Prescriptive analytics is no exception to this. A recent report by Gartner stated the following: “Prescriptive analytics is moving beyond its core community of operations research and management science professionals and becoming increasingly embedded in business applications.” (Hare, J., Swinehart, H., Woodward, A., Forecast Snapshot: Prescriptive Analytics, Worldwide, 2017, Gartner Inc., May 3 2017.) Deemed the most transformational form of advanced analytics, it’s crucial that business leaders understand the value that can be drawn from prescriptive analytics and take responsibility for driving initiatives.
    [Show full text]
  • Specifying Local Search Neighborhoods from a Constraint Satisfaction Problem Structure
    Specifying Local Search Neighborhoods from a Constraint Satisfaction Problem Structure Mateusz Sla_zy´nski´ 1, Salvador Abreu2, and Grzegorz J. Nalepa1 1 AGH University of Science and Technology, Krakow, Poland fmslaz, [email protected] 2 University of Evora´ and LISP, Evora,´ Portugal [email protected] Abstract Neighborhood operators play a crucial role in defining effec- tive Local Search solvers, allowing one to limit the explored search space and prune the fitness landscape. Still, there is no accepted formal repre- sentation of such operators: they are usually modeled as algorithms in a procedural language, lacking in compositionality and readability. In this paper we propose a new formalization capable of representing several neighborhood operators, thereby eschewing the need to code these in a full Turing complete language. The expressiveness of our proposal stems from a rich problem representation, as used in Constraint Programming models. We compare our system to competing approaches and show a clear increment in expressiveness. 1 Introduction Local Search is a family of heuristic algorithms, typically used to find approxi- mate solutions for hard optimization problems. The common core of those meth- ods consists in finding an initial sub-optimal solution (called configuration in the rest of the paper) and iteratively replacing it with similar configurations, called neighbors. There is a vast body of research on the exploration methods, called metaheuristics, focused mostly on escaping local optima and finding novel configurations. While metaheuristics vary in their performance, they are generic enough to be applicable to many different problems. Various algorithmic configu- ration methods can be used to tune their parameters without human interaction.
    [Show full text]
  • Data Science and Analytics Diploma
    DATA SCIENCE AND ANALYTICS DIPLOMA The Data and Predictive Analytics Center, RIT New York “The world’s most valuable resource is no longer oil, but data” The Economist PROGRAM OVERVIEW & OBJECTIVES PROGRAM METHODOLOGY With data now one of the world's most valuable resources, analysis of large quantities of data is Modules are designed to use the most practical approach to deliver a highly sought after skill-set. RIT Dubai's Professional Diploma in Data Science is a the material, using the most eective learning techniques. multidisciplinary program intended for professionals in diverse elds, including nance, retail, Participants can expect the following during the course of the science, engineering or manufacturing, who need to analyze Big Data; data which is so large in program: volume and variety that it is not amenable to processing or analysis using traditional database and software techniques. Lecture modules delivered by subject matter experts. Use of cutting edge tools on various topics covered in the program. Students studying the professional diploma will: Access to a research repository on the subject. Study how to explore and manage large datasets being generated and used in the modern Discussion of case studies. world. Class room activities. Project work. Be introduced to practical techniques used in exploratory data analysis and mining including data preparation, visualization, statistics for understanding data, and grouping and prediction techniques. PROGRAM MODULES & TIMINGS Present approaches used to store, retrieve, and manage data in the real world including Four modules - Three days each traditional database systems, query languages, and data integrity and quality. Duration: October, 2017 - January, 2018 Study how to use big data analytics to reach data-driven decision making.
    [Show full text]
  • Windowed Planning)
    OptaPlanner User Guide Version 6.0.0.Beta1 by The OptaPlanner team [http://www.optaplanner.org/community/team.html] ........................................................................................................................................ ix 1. Planner introduction .................................................................................................... 1 1.1. What is OptaPlanner? ......................................................................................... 1 1.2. What is a planning problem? ............................................................................... 3 1.2.1. A planning problem is NP-complete .......................................................... 3 1.2.2. A planning problem has (hard and soft) constraints .................................... 3 1.2.3. A planning problem has a huge search space ............................................ 4 1.3. Download and run the examples ......................................................................... 4 1.3.1. Get the release zip and run the examples ................................................. 4 1.3.2. Run the examples in an IDE (IntelliJ, Eclipse, NetBeans) ............................ 6 1.3.3. Use OptaPlanner with Maven, Gradle, Ivy, Buildr or ANT ............................ 6 1.3.4. Build OptaPlanner from source ................................................................. 7 1.4. Status of OptaPlanner ......................................................................................... 7 1.5. Compatibility ......................................................................................................
    [Show full text]
  • Book of Abstracts
    Workshop of the EURO Working Group on Vehicle Routing and Logistics optimization (VeRoLog) 2-5 Jun 2019 Seville Spain Table of contents Handling Vehicle Relocation Through Layered graphs, Alain Quilliot [et al.]... 13 Predictive dynamic relocations in carsharing systems implementing complete jour- ney reservations, Martin Repoux [et al.]....................... 14 Comparing centralized and decentralized repositioning strategies for ride-sharing applications, Martin Pouls [et al.]........................... 15 The pickup and delivery problem with online transfers, for the next generation of public transport, Paul Bouman [et al.]........................ 16 Optimized real-time management for on-demand ride sharing services., Zahra Ghandeharioun [et al.]................................. 17 The effect of spatial and temporal flexibility on the profitability of one-way electric carsharing systems, Burak Boyaci [et al.]....................... 18 Dynamic Multimodal Freight Routing using a Co-Simulation Optimization Ap- proach, Maged Dessouky [et al.]............................ 19 A Large Multiple-Neighborhood Search for Order Management in Attended Home Deliveries, Jarmo Haferkamp [et al.]......................... 20 Booking of loading/unloading areas, Andrea Mor [et al.].............. 21 An Enhanced Branch and Price Algorithm for the Time-Dependent Vehicle Rout- ing Problem with Time Windows, Gonzalo Lera Romero [et al.].......... 22 A Branch-and-Price Solution Approach for Electric Vehicle Routing Problems with Time Windows, Ece Naz Duman [et al.].................... 23 Optimizing Omni-Channel Fulfillment with Store Transfers, Joydeep Paul [et al.] 24 Approximate dynamic programming for multi-period taxi dispatching, Felix Goet- zinger [et al.]...................................... 25 1 The electric fleet transition problem, Samuel Pelletier [et al.]........... 26 Heuristic approach to solve a tandem truck-dron logistic delivery problem, Pedro L. Gonzalez-R [et al.].................................
    [Show full text]