Make Callback after defined amount of time in MIP stage - Python API

20 views
Skip to first unread message

Fritjof Knier

unread,
Oct 21, 2016, 4:07:48 AM10/21/16
to Gurobi Optimization
Hey guys, 

I have seven different models for the same optimization problem. 
I want to compare their performance over time. 

So while solving a model I want to get the current objective best after time intervalls 5 sec, 10 sec, 30 sec and so on. 
Does anybody of you have experience building something like that in Pyton, like triggering a callback after certain time intervalls. 

Thank you guys in advance. 

Tobias Achterberg

unread,
Oct 21, 2016, 8:12:05 AM10/21/16
to gur...@googlegroups.com
Just use a callback and record time and bound value. Usually, the callback is
called much more frequently than once every five seconds, so you probably do not
want to record every single data point that you get. Note, however, it may also
happen (depending on the model) that the callback is called less frequently.
Moreover, the time intervals in which the callback is called will vary over time.

But all this shouldn't affect your evaluation. Just record the data points you
want and do a piece-wise linear interpolation to get a fully defined function.
This should fit your needs.


Regards,

Tobias
Reply all
Reply to author
Forward
0 new messages