Retrieve root node value
Hi
I want to store the objective value for the solution of the root node relaxation. How can I do that?
I've tried to find it with a callback:
if (where ==GRB_CB_MIPNODE )) {
std::cout<<"Root node = " << getDoubleInfo(5004) << std::endl;
}
Optimize a model with 2601 rows, 24884 columns and 1040444 nonzeros
Variable types: 38 continuous, 24846 integer (24846 binary)
Coefficient statistics:
Matrix range [1e+00, 7e+02]
Objective range [1e+03, 2e+04]
Bounds range [1e+00, 6e+02]
RHS range [1e+00, 7e+02]
Presolve removed 1705 rows and 108 columns
Presolve time: 0.69s
Presolved: 896 rows, 24776 columns, 623534 nonzeros
Variable types: 38 continuous, 24738 integer (24738 binary)
Root relaxation: objective 6.651437e+04, 559 iterations, 0.09 seconds
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
0 0 66787.8921 0 48 - 66787.8921 - - 2s
H 0 0 81006.069044 66787.8921 17.6% - 2s
Root node = 66787.9
The value I print to console isn't the same value as the root relaxation value shown above. I'm guessing the reason is that I get the solution after Gurobi has added some cuts.
How can I get the root relaxation value from my model? Gurobi cuts excluded.
And, how can I trough a callback get the root relaxation value shown above? (6.651437e+04)
Thanks!
-
正式なコメント
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?. -
Are you using the "Cuts=3" parameter setting? From the source code, this looks like being the only way of getting cuts before the first call to the user callback function.
Regards,
Tobias
0 -
Sorry for the late reply.
Changing the Cuts parameter to 3 doesn't seem to change anything, I still get 66787.9.
0
投稿コメントは受け付けていません。
コメント
3件のコメント