Reputation: 13
Under what situation does the Solver will choose to break hard constraint while there is exiting suitable solution with higher soft score. we create this following solution: enter image description here We use the FIRST_FIT and Tabu Search algorithm to build this solution, and we run it for some minitues, then we got a reault which breaks many hard constraints, and we find there is existing a solution which not break any hard constraints.
We let the Solver to explain the solution which we find, the Solver also shows it break 0 hard.
We wonder what cause this problem. does it cause by the running time? are there any way to let the Solver not try the solution which break the hard contraint?
Upvotes: 0
Views: 185
Reputation: 5702
Timefold Solver employs Local Search under the hood. One of the characteristics of local search is that it doesn't guarantee that the optimal solution will be reached. In theory, this is a downside - in practice, for big problems, no known algorithm can provide this guarantee in a realistic time frame, and local search will at least give you a decent solution.
The fact that you were able to find a better solution by hand tells me you're dealing with a very small problem. As explained above, local search is not exhaustive, and sometimes it doesn't find something that may seem obvious to humans. Once you start scaling the problem size, you will no longer be able to find a better solution by hand, and the solver will certainly get you a better solution than you can find yourself. (Especially if you include many custom constrains, that's our strength.)
There may be other reasons why the solver didn't perform well for your problem. Maybe you've introduced a score trap. Maybe you need to introduce more variety in your moves, or create custom moves altogether. I cannot help you there, because I do not have your domain knowledge.
Upvotes: 0