How to fix variables of the presolved model and get the solution of original model ?
AnsweredI want to try many kinds of fixations of the original model m and solve it. However, the optimization of m take much time on presolving. So i want to presolve m first(only once) and then do the fixations, in order to save time. p=m.presolve() , p.optimize() is impractical because i can't get the solution of m
0

The mapping between the original model and the presolved model is not exposed. We don't recommend working on the presolved model, because in general there's no way to recover a solution to the original model. Additionally, the variables you're interested in fixing may not even be present in the presolved model.
Some alternative ideas:
 Convert your model to a multiscenario model, where you define a new scenario for each set of variable fixings. When solving a multiscenario model, Gurobi performs a single presolve step, then attempts to find optimal solutions for all scenarios.
 Limit the amount of time Gurobi spends in presolve by modifying the PrePasses/Presolve parameters.
0
Please sign in to leave a comment.
Comments
1 comment