Over a million developers have joined DZone.

OptaPlanner 6.1.0.Final released: open source constraint optimization engine in Java

We are happy to announce the 6.1 release of OptaPlanner.

OptaPlanner is a lightweight, embeddable planning engine written in Java™ to solve constraint satisfaction problems efficiently.
Together with the Drools rule engine and the jBPM workflow engine, it is a strong and flexible foundation for knowledge management.

Demo videos

Each of these videos demonstrates an example and a feature:


OptaPlanner is:

  • Stable: Heavily tested with unit, integration and stress tests.

  • Reliable: Used across the world. See case studies.

  • Scalable: One of the examples handles 50 000 entities with 5 000 variables each, multiple constraint types and billions of possible constraint matches.

  • Documented: See the detailed reference manual or one of the many examples.

  • Open source: Released under the Apache Software License.

New and noteworthy

Public API

There is now a public API:

  • Public API: All classes in the package namespace org.optaplanner.core.api are 100% backwards compatible in future releases.

  • Impl classes: All classes in the package namespace org.optaplanner.core.impl are not backwards compatible: they might change in future releases. The recipe called UpgradeFromPreviousVersionRecipe.txt describes every such change and on how to quickly deal with it when upgrading to a newer version. That recipe file is included in every release zip.

  • XML configuration: The XML solver configuration is backwards compatible for all elements, except for elements that require the use of non public API classes. The XML solver configuration is defined by the classes in the package namespace org.optaplanner.core.config.

Performance speedups

  • EntitySelector caching speedup for large datasets: Benchmarked on MachineReassignment’s B datasets.

    • Tabu Search: +3% on average, +4% on largest

    • Late Acceptance: +234% (x3.34) on average, +430% (x5.3) on largest

  • Generic cloning speedup for large datasets: Benchmarked on MachineReassignment’s B datasets.

    • Tabu Search: +18% on average, +24% on largest

    • Late Acceptance: +23% on average, +121% (x2.21) on largest

Declarative value ranges

When the planning value range of a planning variable is a number (such as int, double or BigDecimal), you can now declare the range by its bounds, instead of enumerating all values in the range.

So instead of reserving 5000 memory spaces for all the integer values:

    @ValueRangeProvider(id = "delayRange")
    public List<Integer> getDelayRange() {
        List<Integer> = new ArrayList<Integer>(5000);
        for (int i = 0; i < 5000; i++) {
        return delayRange;

You can now just reserve 2 memory spaces for the bounds of those integer values:

    @ValueRangeProvider(id = "delayRange")
    public CountableValueRange<Integer> getDelayRange() {
        return ValueRangeFactory.createIntValueRange(0, 5000);

New Construction Heuristic: Cheapest Insertion

A new Construction Heuristic that takes considerably longer than First Fit, First Fit Decreasing, but often has better results.


New Exhaustive Search: Branch And Bound

Branch And Bound is a smart version of Brute Force. It also explores nodes in an exponential search tree, but it investigates more promising nodes first and prunes away worthless nodes. Configure it like this:



The BenchmarkAggregator in optaplanner-benchmark allows you to merge multiple benchmark reports into 1 report.

Contributed by Matej Čimbora.

Generic move improvements

  • New PillarChangeMove: A pillar is a set of planning entities which have the same planning value(s) for their planning variable(s). The PillarChangeMove selects 1 entity pillar and changes the value of 1 variable for all entities.

  • The pillar moves can now select subPillars too.

Other improvements

  • The Manners2009 example has been cleaned up and renamed to the Dinner Party example.

  • Decision Table example: the Dinner Party example now demonstrates how to use a Drools Decision Table (an XLS file) to allow users to define score rules.

  • New BestScoreFeasibleTermination: terminates when the best score is feasible. Contributed by Matej Čimbora.

  • Real-time planning improvements, such as a daemon mode.


The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}