R API behaving differently from Gurobi via command line
Hello,
I am running into a strange problem where a model I constructed in R is apparently infeasible or unbounded (Gurobi return status is INF_OR_UNBD). However, I if I set the parameter dualreductions = 0, a solution suddenly exists. If I understand the manual correctly, though, this should not happen, i.e. the return status INF_OR_UNBD should happen only if the "Model was proven to be either infeasible or unbounded," and turning off dualreductions is a way to diagnose the problem.
However, if I export the model from R into a .lp file using the command gurobi_write(), and then have Gurobi solve it via command line, I get the same solution as above, even if dualreductions = 1. Moreover, if I import the model back into R using gurobi_read(), I can solve it using the R API, even when dualreductions = 1.
So I'm really not sure what is going on here, since the models should be the same. I have the model saved and code available to replicate my error, if there is a way to upload them.
Thanks so much.
Best,
Josh
-
Hi Joshua,
Several details: the LP format is not 100% accurate (as its intent is to browse models), if you want to capture the full detail of your model you should use the MPS format.
Now, most likely, you are experiencing some kind of numerical issue, I would suggest to take a look at our numerical issues guide: http://www.gurobi.com/documentation/8.1/refman/numerics_gurobi_guidelines.html
In (very short), for badly scaled models, it is perfectly possible to be both feasible (within tolerances) and infeasible. For example the problem:
x >= 0, x <= -1e-6
is infeasible, but feasible within tolerances...Now, if you have a problem where you have a truly feasible solution (i.e. no tolerances allowed when testing constraints) for a model that is declared infeasible, we would be happy to take a look. Also, please do test with the latest version as it may contain a fix to a known issue
0 -
Hello again,
I'm running into a similar problem again.
Specifically, if the MPS file below is loaded into R and passed to the Gurobi API, a solution is obtained in 13,581 iterations (in roughly 10 minutes).
However, when loaded into Gurobi directly via the command line, the algorithm does not converge, even within an hour.
It would be great to know what is causing this discrepancy.
Here is the link to the MPS file: https://www.dropbox.com/s/q3xuxi8jffxagv5/lpMin.mps?dl=0
Thanks so much.
0
サインインしてコメントを残してください。
コメント
2件のコメント