Dynamical timeout
AnsweredThis question might sound weird, but the point of "dynamical timeout" is that: my model stops exploring more nodes and returns the sub-optimal value when it has already "stayed" on the same objective value (say) 1 minute
I know we can set the timeout limit before we turn on the model, but I refer to this kind of action as the statical timeout, and that's why I name my question as the dynamical timeout.
Is there any way to do such kind of "dynamical timeout"?
Thanks a lot!
-
Official comment
Absolutely, you can implement this with a callback function.
Here is a documentation link for Python: https://www.gurobi.com/documentation/current/refman/py_callbacks.html
Within the callback, you would have to keep track of the timing and the current progress (see also https://www.gurobi.com/documentation/current/refman/callback_codes.html) . You can then call the terminate() function whenever you want the process to stop.
There is a callback example for each API in the "examples" folder of your Gurobi installation.
-
Official comment
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?.
Post is closed for comments.
Comments
2 comments