Closed timvandam closed 1 year ago
It appears that replacing
model += total_complete_collections == xsum(trader_complete_collections)
model.objective = maximize(total_complete_collections)
with
model.objective = maximize(xsum(trader_complete_collections))
solves the issue. Strange
I found another case where even this change does not fix it. I am using MIP to verify the correctness of an algorithm, but it seems that I'm using the algorithm to verify MIP now š
Hi Tim,
Hereās the log of your run:
Cbc0011I Exiting as integer gap of 1 less than 1e-10 or 0.01%
Indeed, the solver (CBC in this case) considered the solution to be optimal since it has optimality gap smaller than 0.01%. Concerning the different result when changing the objective, this probably happened due to some level of "randomness" or high sensitivity to initial condition by the solver. For more info, I recommend reading this very niceĀ paper by M. Fischetti and M. Monaci (http://www.dei.unipd.it/~fisch/papers/exploiting_erraticism_in_search.pdf).
To get the result you want and verify the correctness of your algorithm using MIP, consider setting parameter max_mip_gap to a smaller value, such as 0.00001. ;)
Happy holidays!
Excellent, this worked. Thank you for the quick response :smile: Happy holidays to you too
Describe the bug A model is not returning an optimal (i.e. maximum objective value) solution, even though it is feasible
To Reproduce I've created the following reproduction code. It runs my model twice. The first time it lets the model do whatever it wants to find a solution. The second time I manually set some values in order to make it find a better solution. Running this script shows that the second time it indeed gets a better objective value, despite all the constraints being the exact same (except for it now forcing some variable values)
Expected behavior I would expect it to find an optimal solution. It does not appear to be doing this currently
Desktop (please complete the following information):
Additional context Add any other context about the problem here.