-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a variable slows down the search #200
Comments
Thanks for opening up this issue. It's very valuable for me to have different people trying out different problems to improve this solver. I'll test this out tmr and get back to you with some more insight. For now I can just guess that the extra constraint that you have might be called relatively late inside the pruning step which will prune everything again. The order in which the constraints are called might make a difference but yeah such a huge one is definitely unexpected. Will do some debugging and plotting of the search graph tmr. |
Okay some new ideas 😄 When you write I'll further investigate this in the next days. |
In most cases it is reasonable to use an lp solver as my bound computation is really bad but I've seen that you have tried that as well so I'll check what happens in that case. |
(Perhaps I should be surprised by this, but I wanted to report it.)
The following model solves the problem of finding the smallest difference between ABCDE - FGHIJ, where A..J are distinct integers 0..9. The optimal answer is
247 = 50123 - 49876
.When using the variable
diff
, the best solution time I've found is 20.4s.Withoutdiff
- i.e. using only the constraint@constraint(model, v[1] - v[2] >= 1)
(commented below) - it's much faster: about 0.6s.Is this expected, i.e. that the solver works better with as few variables as possible? This kind of makes sense since more variables mean a larger model, but I'm a little surprise by the difference between the two solving times.
That said, the reason it's slow might be that I've not found the best heuristics + solver (but I've tried many combinations).
The text was updated successfully, but these errors were encountered: