I'm using the Gurobi Python interface gurobipy
. I have a model formulation with a lot of variables. I would like to initialize less important variables that are supposed to be binary as continuous variables, and to change them to binary when needed. However, this will not happen very often.
I have tried the solution from the answer to a similar question, but this needs to rebuild the model. Rebuilding the model in the callback routine at GRB.Callback.MIPSOL
causes a crash.
Is this possible? Or am I supposed to introduce all variables as binary, and deal with these cases in GRB.Callback.MIPNODE
?