Chapter 3. Use Cases and Examples

3.1. Examples Overview

Planner has several examples. In this manual we explain mainly using the n queens example and cloud balancing example. So it’s advisable to read at least those sections.

The source code of all these examples is available in the distribution ZIP under examples/sources and also in git under optaplanner/optaplanner-examples.

Table 3.1. Examples Overview

ExampleDomainSizeCompetition?Special features used

N queens

  • 1 entity class
  • 1 variable
  • Entity ⇐ 256
  • Value ⇐ 256
  • Search space ⇐ 10616

None

Cloud balancing

  • 1 entity class
  • 1 variable
  • Entity ⇐ 2400
  • Value ⇐ 800
  • Search space ⇐ 106967
  • No
  • Defined by us

Traveling salesman

  • 1 entity class
  • 1 chained variable
  • Entity ⇐ 980
  • Value ⇐ 980
  • Search space ⇐ 102927

Dinner party

  • 1 entity class
  • 1 variable
  • Entity ⇐ 144
  • Value ⇐ 72
  • Search space ⇐ 10310
  • Unrealistic
  • Decision Table spreadsheet (XLS) for score constraints

Tennis club scheduling

  • 1 entity class
  • 1 variable
  • Entity ⇐ 72
  • Value ⇐ 7
  • Search space ⇐ 1060
  • No
  • Defined by us

Meeting scheduling

  • 1 entity class
  • 2 variables
  • Entity ⇐ 10
  • Value ⇐ 320 and ⇐ 5
  • Search space ⇐ 10320
  • No
  • Defined by us

Course timetabling

  • 1 entity class
  • 2 variables
  • Entity ⇐ 434
  • Value ⇐ 25 and ⇐ 20
  • Search space ⇐ 101171

Machine reassignment

  • 1 entity class
  • 1 variable
  • Entity ⇐ 50000
  • Value ⇐ 5000
  • Search space ⇐ 10184948

Vehicle routing

  • 1 entity class
  • 1 chained variable
  • 1 shadow entity class
  • 1 automatic shadow variable
  • Entity ⇐ 134
  • Value ⇐ 141
  • Search space ⇐ 10285

Vehicle routing with time windows

Extra on Vehicle routing:

  • 1 shadow variable
  • Entity ⇐ 1000
  • Value ⇐ 1250
  • Search space ⇐ 103000

Extra on Vehicle routing:

Project job scheduling

  • 1 entity class
  • 2 variables
  • 1 shadow variable
  • Entity ⇐ 640
  • Value ⇐ ? and ⇐ ?
  • Search space ⇐ ?

Hospital bed planning

  • 1 entity class
  • 1 nullable variable
  • Entity ⇐ 2750
  • Value ⇐ 471
  • Search space ⇐ 106851

Exam timetabling

  • 2 entity classes (same hierarchy)
  • 2 variables
  • Entity ⇐ 1096
  • Value ⇐ 80 and ⇐ 49
  • Search space ⇐ 103374

Employee rostering

  • 1 entity class
  • 1 variable
  • Entity ⇐ 752
  • Value ⇐ 50
  • Search space ⇐ 101277

Traveling tournament

  • 1 entity class
  • 1 variable
  • Entity ⇐ 1560
  • Value ⇐ 78
  • Search space ⇐ 102951
  • Unrealistic
  • TTP

Cheap time scheduling

  • 1 entity class
  • 2 variables
  • Entity ⇐ 500
  • Value ⇐ 100 and ⇐ 288
  • Search space ⇐ 1020078

Investment

  • 1 entity class
  • 1 variable
  • Entity ⇐ 11
  • Value = 1000
  • Search space ⇐ 104
  • No
  • Defined by us

A realistic competition is an official, independent competition:

  • that clearly defines a real-word use case
  • with real-world constraints
  • with multiple, real-world datasets
  • that expects reproducible results within a specific time limit on specific hardware
  • that has had serious participation from the academic and/or enterprise Operations Research community

These realistic competitions provide an objective comparison of Planner with competitive software and academic research.