I am solving a two stage stochastic program (in the extensive or the "deterministic" form) with integer variables in both the stages. I observe that Gurobi's heuristics find good first-stage solutions fast, but the second stage solutions are suboptimal.
But given the first-stage solution, it is easy to solve a second-stage problem. So, I would like to do the following:
Whenever gurobi finds a feasible solution, (GRB.Callback.MIPSOL), I would like to retrieve the first-stage solutions (by using Model.cbGetSolution), and solve the 100 much smaller second-stage MIPs, and feed the solution of the second stage to gurobi (using Model.cbSetSolution and cbUseSolution). I believe this could considerably improve the objective value of the current solution.
My problem is that Model.cbGetSolution is allowed only if where==GRB.Callback.MIPSOL while Model.cbSetSolution is allowed only if where == GRB.Callback.MIPNODE.
Is there a work-around for this problem? I am using the Python API.
Please sign in to leave a comment.