Getting time values shown in the prints
AnsweredIs there any way in Python to record the time MIP start produces a solution. For example, how can I get 0.11s printed? Also, is there any way to get the time values for root relaxation and presolve?
MIP start produced solution with objective 201 (0.11s)
Loaded MIP start with objective 201
Root relaxation: objective 1.010000e+02, 1954 iterations, 0.28 seconds
Presolve time: 19.58s
-
Taner,
The only way to see if the mipstart was successful, is to get the log line
'Loaded MIP start with objective 201'
0 -
I have about the same question and problem. If you are an academic user of the solver it can be of your interest to have a table in your paper with the time spent in the root node relaxation. The way it is, there is no programmatic way of getting this info without parsing the output, what is very inconvenient (i.e., instead of being able to assemble a CSV already inside the code, it becomes necessary to do it using the output, or capturing the output inside the program what is not always possible, and if you have multiple calls to a MIP you need to put indicators in the output to be able to distinguish them and this also complicates the parsing).
0 -
Hi Henrique,
you could install a callback function that queries the MIP_NODLFT data. The first time this becomes non-zero, you are at the end of the root node.
Alternatively, you could launch your optimization with a NodeLimit of 1. Then, the process will stop after the root node. Afterwards, you set the NodeLimit back to infinity and call the optimization again. It will resume where it stopped, i.e., start with exploring the branch-and-bound tree.
Regards,
Tobias
0
Please sign in to leave a comment.
Comments
3 comments