Optionally allow BestSolutionEvents for new, equal score solutions too. #880
Replies: 3 comments 5 replies
-
Well, if you just need the history, you can use If you need the actual solution, you would need to access internal API that is subject to breakage between versions, and probably will considerably slow down the solver as it would most likely significantly increase the number of times the working solution is cloned, and increase memory pressure. From what I read in the issue, it seem you want simulations; that is, testing how different soft constraint weights change the solution and deciding which set of weights leads to the "best" solution. For instance, assume two soft constraints for VRP:
These two constraints go against one other, since in order to avoid left turns, sometimes you need to take a longer route and thus spend more fuel. So what constraint configuration does is allow users to change the constraint weights depending on business needs. For instance:
Different businesses will have different ideas on which of the two solutions are "better". How the solver decide which solution is better is by using the constraint weights for "Minimize fuel usage" and "Minimize the number of left turns". So what you actually want to do is quickly run the solver using different constraint configurations, and show the solution generated by each constraint configuration to the user, and have the user decide based on the solutions produced what constraint configuration to use.
|
Beta Was this translation helpful? Give feedback.
-
Thanks @Christopher-Chianelli ! I understand your point of using constraint configuration. It makes sense if we have complicated problems which always have soft constraints violated. However, in our case, there could be a lot of cases that none of these constraints are violated and hence we could have several solutions that are feasible and acceptable. So in that case, I want to store these actual solutions and return all of them to the user. |
Beta Was this translation helpful? Give feedback.
-
BestSolutionRecaller is a dead end for multi-objective optimization. It won't make your users happy.
That's just the tip of the tip of the iceberg. And yet, it is solvable. It will take a while, but we'll tackle it. |
Beta Was this translation helpful? Give feedback.
-
We have a closed issue. Post it here to be discussed with you and shared with a bigger audience who might face the same issue.
#352
I checked the doc of the recommendFit() method. But from my understanding, it sounds not a perfect case if we just want to record all the solutions with equal score. recommendFit() is aimed to solve the problem that after optimizing, if a new planning entity is added, how could we make faster optimizations to assign planning variables to the new planning entity. But in my case, I don't have new planning entity added. I just need the history of the problem solving process.
The proposals from @ge0ffrey all look good, but it sounds hard for me to hack it. Do you have some other suggestions on my issue? How could I make a hack on BestSolutionRecaller(I don't want to fork from your master branch to hack it)? Also BestSolutionRecaller is a final field which cannot be manually overridden outside timfold. Or could you give more insights on how to apply recommendFit() to fit into our use case?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions