<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://training-course-material.com/index.php?action=history&amp;feed=atom&amp;title=OptaPlanner</id>
	<title>OptaPlanner - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://training-course-material.com/index.php?action=history&amp;feed=atom&amp;title=OptaPlanner"/>
	<link rel="alternate" type="text/html" href="https://training-course-material.com/index.php?title=OptaPlanner&amp;action=history"/>
	<updated>2026-05-13T22:05:23Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://training-course-material.com/index.php?title=OptaPlanner&amp;diff=23999&amp;oldid=prev</id>
		<title>Cesar Chew at 19:02, 24 November 2014</title>
		<link rel="alternate" type="text/html" href="https://training-course-material.com/index.php?title=OptaPlanner&amp;diff=23999&amp;oldid=prev"/>
		<updated>2014-11-24T19:02:41Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Cat|Drools}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;slideshow style=&amp;quot;nobleprog&amp;quot; headingmark=&amp;quot;⌘&amp;quot; incmark=&amp;quot;…&amp;quot; scaled=&amp;quot;true&amp;quot; font=&amp;quot;Trebuchet MS&amp;quot; &amp;gt;&lt;br /&gt;
;title: OptaPlanner&lt;br /&gt;
;author: Bernard Szlachta (NobleProg Ltd)&lt;br /&gt;
&amp;lt;/slideshow&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What is OptaPlanner ⌘ ==&lt;br /&gt;
* &amp;quot;OptaPlanner is a lightweight, embeddable planning engine that optimizes planning problems&amp;quot;&lt;br /&gt;
* Apache Software License 2.0 &lt;br /&gt;
* 100% pure Java&amp;lt;sup&amp;gt;TM&amp;lt;/sup&amp;gt; &lt;br /&gt;
* Combines optimization heuristics and metaheuristics with very efficient score calculation (Drools Expert i.e. Rete or backward chaining)&lt;br /&gt;
&lt;br /&gt;
==  Use cases ⌘ ==&lt;br /&gt;
* Shift rostering (timetabling)&lt;br /&gt;
* Trainer, plane timetabling&lt;br /&gt;
* Agenda scheduling (meetings, appointments, maintenance jobs)&lt;br /&gt;
* Educational timetabling (scheduling lessons, courses, exams, conference presentations)&lt;br /&gt;
* Vehicle routing (planning vehicles with freight and/or people&lt;br /&gt;
* Bin packing (filling containers, trucks, ships and storage warehouses, but also cloud computers nodes)&lt;br /&gt;
* Job shop scheduling (planning assembly lines, machine queue planning, workforce task planning)&lt;br /&gt;
* Cutting stock (minimizing waste while cutting materials, e.g. paper, steel, etc..) &lt;br /&gt;
* Financial optimization (investment portfolio optimization, risk spreading)&lt;br /&gt;
&lt;br /&gt;
* Planning problems - provide products and services with a limited set of constrained resources (employees, assets, time and money)&lt;br /&gt;
&lt;br /&gt;
== Planning Problem ⌘ ==&lt;br /&gt;
&lt;br /&gt;
; Use Cases are NP-complete:&lt;br /&gt;
* It&amp;#039;s easy to verify a given solution to a problem in reasonable time&lt;br /&gt;
* There is no silver bullet to find the optimal solution of a problem in reasonable time&lt;br /&gt;
&lt;br /&gt;
; Implication of the above:&lt;br /&gt;
* brute force will usually take too long&lt;br /&gt;
* simple algorithm (largest first) will not satisfactory (from business perspective) solution&lt;br /&gt;
&lt;br /&gt;
; OptaPlanner and NP-complete problems&lt;br /&gt;
* Planner does find:&lt;br /&gt;
** a good solution&lt;br /&gt;
** in reasonable time&lt;br /&gt;
&lt;br /&gt;
== Constraints ⌘ ==&lt;br /&gt;
; Hard negative&lt;br /&gt;
* cannot be broken&lt;br /&gt;
* e.g. &amp;#039;&amp;#039;trainer cannot provide two courses at the same time&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
; Soft negative&lt;br /&gt;
* can be broken, but better solution do not break it&lt;br /&gt;
* e.g. &amp;#039;&amp;#039;trainer should have always at least one day off between courses&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
; Soft positive (usually can be transformed to soft negative)&lt;br /&gt;
* e.g. trainers likes Drools courses&lt;br /&gt;
&lt;br /&gt;
; Levels of constrains&lt;br /&gt;
* can be only hard&lt;br /&gt;
* can have many levels (hard, medium, soft) &lt;br /&gt;
&lt;br /&gt;
== Score ⌘ ==&lt;br /&gt;
* Constraints define the score calculation (AKA &amp;#039;&amp;#039;&amp;#039;fitness function&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
* Each solution of a planning problem can be graded with a score&lt;br /&gt;
* Score constraints are written in Drools rules (mvel, DSL) or Java rules&lt;br /&gt;
* If constraints are written in rules language, they benefit the optimization (Rete, etc...)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Categories of solutions ⌘ ==&lt;br /&gt;
; Possible solution &lt;br /&gt;
* is any solution (event if it breaks constraints)&lt;br /&gt;
&lt;br /&gt;
; Feasible solution &lt;br /&gt;
* does not break any (negative) hard constraints&lt;br /&gt;
* relative to the number of possible solutions&lt;br /&gt;
* there may be no feasible solutions&lt;br /&gt;
&lt;br /&gt;
; Optimal solution &lt;br /&gt;
* solution with the highest score&lt;br /&gt;
* usually there are 1 or a few optimal solutions&lt;br /&gt;
* There is always at least 1 optimal solution, even in the case that there are no feasible solutions and the optimal solution isn&amp;#039;t feasible.&lt;br /&gt;
&lt;br /&gt;
; The best solution found &lt;br /&gt;
* solution with the highest score found by an implementation in a given amount of time&lt;br /&gt;
* likely to be feasible and, given enough time, it&amp;#039;s an optimal solution&lt;br /&gt;
&lt;br /&gt;
== Possible solutions ⌘ ==&lt;br /&gt;
* the number of possible solutions is usually huge (if calculated correctly), even with a small dataset&lt;br /&gt;
* most cases have &amp;#039;&amp;#039;&amp;#039;a lot more&amp;#039;&amp;#039;&amp;#039; possible solutions than the minimal number of atoms in the known universe (10&amp;lt;sup&amp;gt;80&amp;lt;/sup&amp;gt;)&lt;br /&gt;
* Because there is no silver bullet to find the optimal solution, any implementation is forced to evaluate at least a subset of all those possible solutions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* OptaPlanner supports several optimization algorithms to reduce the number of solutions&lt;br /&gt;
* it&amp;#039;s impossible to tell in advance which algorithm is better&lt;br /&gt;
* you can benchmark and switch optimization algorithm (in a config file)&lt;br /&gt;
&lt;br /&gt;
== Presentation ==&lt;br /&gt;
* Go with the Cloud and Nqueen examples&lt;br /&gt;
&lt;br /&gt;
== Exercises ==&lt;br /&gt;
# [http://docs.jboss.org/drools/release/latestFinal/optaplanner-docs/html_single/#examplesOverview Extend existing constraints]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--http://docs.jboss.org/drools/release/5.5.0.Final/drools-planner-docs/html_single/index.html#d0e871--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cesar Chew</name></author>
	</entry>
</feed>