Large LP problem
I want to solve a large lp problem until the first feasible solution is found. (I do not want to spend too much time on it). Also, I want to give 5 minutes extra time to find a possible better solution. If not, terminate the simplex and print the current best feasible solution. I searched for the tutorial, but I could not find a good answer.
Thanks,
Amin

Hi Amin,
LPs are usually solved until optimality. Gurobi does not provide an easy way to query the best found primal feasible LP solution. You can use the Simplex callback to query the primal and dual violations as well as the current objective value (check the callback example). The solution itself is not accessible, though.
Please note that you would also need to set the Method to 0 to enforce using the primal simplex, otherwise there might not be any feasible solutions until optimality.
Did you try some parameter tuning to check whether your LP is really not solvable in an acceptable time frame?
If you are only interested in a feasible solution, you may also ignore the objective function and solve the feasibility problem:
f = model.feasibility()
f.optimize()Cheers,
Matthias 
You can find some suggestions to speed up your model build here: How do I speed up the time to build my model?
Please sign in to leave a comment.
Comments
3 comments