How to get the fractional values of the root node relaxation solution?
進行中I need to extract the fractional solution of the root node relaxation. I have tried following the callback function, but the output appears to be an empty list ([]).
def mycallback(model, where):
if where == GRB.Callback.MIPNODE:
depth = model.cbGet(GRB.Callback.MIPNODE_NODCNT)
if depth == 0:
if model.cbGet(GRB.Callback.MIPNODE_STATUS) == GRB.Status.OPTIMAL:
print( model.cbGetNodeRel(model._vars))
model._vars = model.getVars()
0
-
正式なコメント
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
Hi Farin,
Could you post the LOG of your optimization run and/or some output showing the behavior? Are you sure that you are in the MIPNODE callback? Please note that if the relaxation solution is integral, no MIPNODE will be performed, since we can directly terminate the optimization process.
Best regards,
Jaromił0 -
Hi Jaromil,
Thank you for the feedback. It seems that the relaxation solution is not integral. Here is the LOG from the moment after sifting:
Root relaxation: objective 5.247974e+04, 508821 iterations, 204.58 seconds
Total elapsed time = 645.08s
Total elapsed time = 681.20s Total elapsed time = 728.88s
Total elapsed time = 766.43s
Nodes | Current Node | Objective Bounds | Work Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
0 0 52479.7442 0 72 - 52479.7442 - - 811s
[]
0 0 52500.1714 0 301 - 52500.1714 - - 916s
[]
0 0 52598.8421 0 290 - 52598.8421 - - 1045s
[]
0 0 52620.0000 0 178 - 52620.0000 - - 1144s
[]
0 0 52620.0000 0 181 - 52620.0000 - - 1157s
[]
0 0 52620.0000 0 200 - 52620.0000 - - 1208s
[]
* 0 0 0 52620.000000 52620.0000 0.00% - 1344s
Cutting planes:
Cover: 1
Clique: 10
MIR: 5
StrongCG: 6
GUB
cover: 26
Zero half: 4
Relax-and-lift: 4
Explored 1 nodes (783910 simplex iterations) in 1345.40 seconds Thread count was 1 (of 8 available processors) Solution count 1: 52620 Optimal solution found (tolerance 1.00e-04) Best objective 5.262000000000e+04, best bound 5.262000000000e+04, gap 0.0000% User-callback calls 16806, time in user-callback 1.46 sec0
投稿コメントは受け付けていません。
コメント
3件のコメント