python-mip
python-mip copied to clipboard
Feature request: user defined stopping rule
We can stop a long running optimization process by setting one or more of the following criteria before starting the optimization:
- max_mip_gap
- max_mip_gap_abs
- max_nodes
- max_seconds
- max_solutions
It would be helpful if we can place a handler that will be called from time to time during the solution process to gracefully end the optimization, independent of one of the above criteria.
For example if we can change the max_nodes or max_seconds property of a running process, we could force a graceful termination and receive the current solution, even if it might take some time until a node is processed.
Any ideas on how to achieve this?
We can create a callback for that... I like the idea very much!