Add a Control-C Interrupt and Saved Pool of Integer-Feasible Solutions - Simpler than an Integer-Feasible Callback #949
Replies: 3 comments
-
Control-C might be fine for the executable but for users of the library it can cause issues - the application highs is used in probably does want to handle control-C differently, i.e. terminate the process. We had huge fun with libraries installing signal handlers before. In the best case there is some more or less documented option to disable them (e.g. SCIP) or we have to modify 3rd party code to get rid off them(CBC)... It is possible to jury-rig basic interrupt functionality into the MIP solver by hacking HighsMipSolverData::checkLimits. In case a callback or other data is needed, it can be added to HighsOptions. Call frequency is not that high, especially if some of the LP are difficult. |
Beta Was this translation helpful? Give feedback.
-
Thanks - what I am suggesting is having both mechanisms i.e., interrupt + solution pool and callbacks. For example, both SCIP and COPT have user interrupts using CRTL-C. And, CPLEX, GUROBI and XPRESS retain a user specified number of integer-feasible solutions in a solution pool that can be retrieved after the solver finishes and these solvers of course have full-featured callback support. |
Beta Was this translation helpful? Give feedback.
-
I'll have a discussion with @lgottwald about the CRTL-C interrupt. The accumulation of a solution pool is WIP |
Beta Was this translation helpful? Give feedback.
-
I thought I would mention that a simple and effective intermediate remedy to a full-blown integer-feasible solution callback is as follows:
Add an interrupt status to your MILP solver which can be interrupted by the user using Control-C command on the console.
Retain the intermediate integer-feasible solutions in a pool which can be recovered after the MILP is interrupted and before the termination of the HiGHS problem.
For example, COPT also does not have callbacks but they have a Control-C console interrupt and a simple solution-pool so it is straightforward to write-out the intermediate integer-feasible solutions.
In our industrial modeling language we also use the simple Control-C interrupt mechanism for all MILP solvers as a generic way to abort a long MILP solve but where incidental integer-feasible solutions have been found and are available to be output or serialized either incrementally as they are found (via callbacks) or retrieved from the solution-pool upon termination.
Perhaps you already thought of this but I thought I would suggest as a stop-gap to the system of callbacks.
Beta Was this translation helpful? Give feedback.
All reactions