I am solving a large MIP in Gurobi 6.0. My advisor wants to set a time limit of 12 hours on the problem. I have found that I can set the TimeLimit parameter and that will kill the solver after the alloted time, but I don't know how to retrieve the best feasible solution at that time, just the objective value and optimality gap. Is there a way to get the best feasible solution?
Get best-known feasible answer after time limit
2.1k Views Asked by Chris Hagmann At
2
There are 2 best solutions below
0

Have you tried using the Xn
attribute, possibly in the combination with the SolutionNumber
parameter? Although for your case you should keep the default 0 value of SolutionNumber
.
You can start from here: http://www.gurobi.com/documentation/6.0/reference-manual/xn.
To obtain the best feasible answer so far, you should first verify that there is a feasible solution by checking the Status attribute on your model object, then querying the
X
attribute on your variable objects. If you have named your variables (with the name parameter on e neat way to do it with the python api is to create a dictionary with the nonzero values.