Access starting solution variables
AnsweredHi all,
I'm using gurobipy and am setting starting values for some variables by using the .Start attribute. The initial solution is then correctly loaded.
After the optimization is done, how can I retrieve the values for all the variables related to the starting solution?
Maybe with a callback?
Or maybe it's possible to access all the solutions found? (it seems that the starting solution appears within the 'Solution count' list)
Thanks!
0
-
Try something like the following:
m.optimize()
for v in m.getVars():
if v.Start != GRB.UNDEFINED:
print('%s start %f, optimized %f' % (v.VarName, v.Start, v.X))0
Please sign in to leave a comment.
Comments
1 comment