model.write()
Hi,
I'm using Gurobi's C++ interface, trying to solve a model which I expect to be feasible. Gurobi returns "infeasible", and so I try to dump the model to a file using write() in order to inspect it. However, when I invoke command-line Gurobi on the dumped model, it returns "feasible". The fingerprints on the two models (before dumping, and after reloading from the dump file) are different. I call write() immediately before (or after, same result) the call to optimize().
Any advice on what could be the cause? Is it possible that the model solved by optimize() and the one dumped by write() have different fingerprints?
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
Hi Guy,
Apparently, your model is on the brink of infeasibility and very little changes in the model may make Gurobi find a solution or claim infeasibility.
To ensure that you are getting the exact data written to a file, please use the MPS format rather than LP. This should preserve all numbers and reading the model back in should return the same fingerprint.
Cheers,
Matthias0 -
Hi Matthias,
Thanks for the prompt reply! Writing in MPS format indeed changed the fingerprint, but to a 3rd, distinct value.
In the meantime I've discovered new information. When using the C++ interface, I specified a cutoff value. When I run command line Gurobi and specify cutoff=x, I get "Model is infeasible" - which reproduces the C++ behavior, although the model has a different fingerprint.
However, this raises a followup question: is it the intended behavior that Gurobi declares "infeasible" in this case? In previous queries I've run it declared "Model objective exceeds cutoff" in these cases. My cutoff value is 0 and the best objective (without cutoff) is -1.242708955096e+00.
0
Post is closed for comments.
Comments
3 comments