Strange behavior - Optimal solutions with different values, depend on whether StartSol is included
AnsweredHello Gurobi support team,
I'm building an MILP model by reading from a .mps file but a strange behavior has occurred: the optimal value depends on whether a .sol file is included.
Below is the code to generate the observation. I'm willing to upload the .mps and .sol files, but unfortunately, I can not figure out how to do so.
import gurobipy as gp
from gurobipy import GRB
modelWithStartSol = gp.read('model_MILP.mps')
modelWithStartSol.read('model_MILP.sol')
modelWithStartSol.optimize()
assert modelWithStartSol.status is GRB.OPTIMAL
modelWithoutStartSol = gp.read('model_MILP.mps')
modelWithoutStartSol.optimize()
assert modelWithoutStartSol.status is GRB.OPTIMAL
print(f'{modelWithStartSol.objVal = }') # 162720.0
print(f'{modelWithoutStartSol.objVal = }') # 162780.0
I'm looking forward for your response.
Best regards,
Quan.
-
Hi Quan,
Note that uploading files in the Community Forum is not possible but we discuss an alternative in Posting to the Community Forum.
Best regards,
Jaromił0 -
Dear Jaromił,
thank you for the instruction.
Here is the Google Drive link to the two files I mentioned in the previous post. https://drive.google.com/drive/folders/1SqJGWgwyW8znC0RCoBkg6-nLHdhTl-G_?usp=sharing
Hope it helps.
Best regards,
Quan.
0 -
Hi Quan,
Thank you for sharing the model and the solution file. I can reproduce the behavior and will investigate. I will update you on my findings.
Best regards,
Jaromił0 -
Hi Quan,
Thank you for reporting the issue.
We have found the source of the issue and a fix will be available with the upcoming technical release.
Best regards,
Jaromił0 -
Hi Jaromił,
Thank you for updating me on the issue. I'll make sure to use the next release once it's available.
In the meantime, is there any workaround to obtain the correct solution with the current Gurobi release (11.0.2)? I'm thinking of some (tricky) parameter settings but not entirely sure.
Best regards,
Quan.
0 -
Hi Quan,
Unfortunately, the only official parameter to currently avoid this issue is to set Presolve=0.
Best regards,
Jaromił0 -
Thanks for letting me know. That is indeed unfortunate.
0
Please sign in to leave a comment.
Comments
7 comments