JLL
JLL

Reputation: 1

Unable to resume solving using a previous best solution or a serialized solution

To all,

Version of optaplanner: 7.48 Since a moment now, I'm no longer able to resume solving. The process is:

    thread 1: solver.solve();
    thread 2: solver.terminateEarly();
    thread 2: solver.solve(solver.getBestSolution());

The longer the time spent between solve() and terminateEarly() is short, the less likely the resume is to work fine. When not working, symptoms are after the Construction Heuristics is finished, only a few new best solutions are found and then the solver stops for ever to find new best solutions even if it's still calculating at a significant CPU rate.

The problem is similar when solver.getBestSolution() is serialized and reloaded later.

Any suggestion?

Thanks.

Regards.

JLL

Upvotes: 0

Views: 103

Answers (1)

Based on the contents of the question, the title is wrong - OptaPlanner resumes just fine, it just can not find any better solutions. There are two reasons for why that could be the case:

  • There are no more better solutions to be found. The bigger your data set becomes, the less likely this is.
  • There are better solutions available, but OptaPlanner can not get to them, as it is stuck in a local optima. This is a common problem.

Escaping local optima is usually accomplished by a combination of the following:

  • Eliminating score traps from your constraints.
  • Increasing variety in move selection. See the available generic moves, or consider implementing a custom move for any intricacies of your particular problem.
  • Iterative local search. We do not (yet) support that out of the box, but the general idea is that at a certain point, you ruin a part of your solution (perhaps by uninitializing it) and then recreate it (randomly or otherwise).

Finally, I wholeheartedly recommend you to upgrade to OptaPlanner 8. The upgrade is easy, and the 7.x stream has been in maintenance mode for a very long time now.

Upvotes: 1

Related Questions