How to print the evolution of mipgap through iterations? #505
Replies: 1 comment
-
Why do you want this?
You get a feel for how the gap is changing just from the normal output e.g.
Cbc0010I After 1000 nodes, 9 on tree, 7350 best solution, best possible
6848.5558 (3.88 seconds)
and a gap of approximately 7%
If you want to stop when the gap drops beow 7% then you can set
-ratiogap 0.07
Otherwise choose an example e.g. interrupt.cpp and modify the event
handler to something like
} else if (whichEvent == treeStatus) {
if (model_->bestSolution()) {
double bestPossible = model_->getBestPossibleObjValue();
double bestObjective = model_->getObjValue();
printf("Gap %g\n",(bestObjective-bestPossible)/fabs(bestPossible));
} else {
printf("No solution found yet\n");
}
return noAction; // carry on
…On 23/05/2022 12:46, Ángel Manuel González Rueda wrote:
Is there any option to print the evolution of mipgap through the
iterations in the output while CBC is running?
I have tried the following options:
{'ratio': 1, 'slog': 3}
and it prints now many information but the gap is not included
throught the iterarions, I can only see the final gap of the solution.
—
Reply to this email directly, view it on GitHub
<#505>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABWJYHA3OX5DPFJURCGZ2XDVLNVX3ANCNFSM5WVR57XQ>.
You are receiving this because you are subscribed to this
thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
boiro9
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there any option to print the evolution of mipgap through the iterations in the output while CBC is running?
I have tried the following options:
{'ratio': 1, 'slog': 3}
and it prints now many information but the gap is not included throught the iterarions, I can only see the final gap of the solution.
Beta Was this translation helpful? Give feedback.
All reactions