OptaPlanner continues as Timefold
All blog posts

Timefold Solver 1.0 is taking shape

The work on Timefold Solver 1.0.0 is progressing well. We intend to release in early July. This post will give you a sneak peek of what’s coming.

Brand new benchmark report

The solver benchmark report has been completely redesigned and modernized. It now fits nicely on all kinds of screens, from mobile phones to desktops.

Importantly, every chart in the report is now interactive, allowing you to filter the data points to only show those you want to see.

Screenshot of the new charts

Static pictures don’t do it justice, you need to see it to believe it. Did you know you can build the solver locally to get access to the latest developments before they’re generally available?

Constraint Streams improvements

Constraint Streams are a powerful way to express constraints in a declarative way. In Timefold Solver 1.0.0, they will become even more powerful by introducing the expand() building block. Consider the following constraint:

Constraint speakerRequiredRoomTags(ConstraintFactory factory) {
    return factory.forEach(Talk.class)
        .filter(talk -> talk.missingSpeakerRequiredRoomTagCount() > 0)
        .penalizeConfigurable(talk -> talk.missingSpeakerRequiredRoomTagCount() * talk.getDurationInMinutes())

Note that the method missingSpeakerRequiredRoomTagCount() is called twice; once to filter Talk instances and the second time to penalize every one of them. This is not ideal, and it becomes even worse when you realize that under the hood, this method does some heavy lifting to compute the missing tags. The end result is that this constraint is not very efficient. With the new expand() building block, we can rewrite it as follows:

Constraint speakerRequiredRoomTags(ConstraintFactory factory) {
    return factory.forEach(Talk.class)
            .filter((talk, missingTagCount) -> missingTagCount > 0)
            .penalizeConfigurable((talk, missingTagCount) -> missingTagCount * talk.getDurationInMinutes())
            .indictWith((talk, missingTagCount) -> Collections.singleton(talk))

Notice that the expand() building block caches the computation and propagate it downstream.

We use the not-so-well-known indictWith() building block, which allows us to indicate which facts are responsible for the constraint violation. Since missingTagCount is a plain integer without any semantics, it doesn’t help us to explain the score and therefore it is removed.

Performance improvements and bugfixes

Behind the scenes, we continue to work tirelessly to improve the performance of our solution. With Timefold Solver 1.0.0, users of Constraint Streams will see performance improvements of up to 15% in some cases. And that is on top of the significant speedup that Timefold already brings over OptaPlanner!

Comparison of OptaPlanner and Timefold performance


Timefold moves ahead at an ever increasing pace. Migrate to Timefold today, and enjoy the benefits of a modern, fast and powerful constraint solver.