I’m currently working on a MILP problem using the Xpress solver in JuMP. Some instances of this problem are taking considerably longer to solve to optimality, and I would like to implement solver-specific callbacks that dynamically adjust the solver’s runtime/time limit based on the optimality gap. Examples of rules can be:
For a 10% gap, allow 10 minutes before terminating if no significant improvement to the objective function is made, with a 9% improvement threshold.
For a 5% gap, allow 5 minutes before terminating if no significant improvement is made, with a 4% improvement threshold.
For a 1% gap, allow 3 minutes before terminating if no significant improvement is made, with a 0.7% improvement threshold.
I have tried using callbacks but without success. I have read about the use of solver-specific callbacks in Xpress, but I am not entirely sure if this is the best way to achieve my goal. How should I correctly set up these callbacks in JuMP? Are there any examples or code available for such callbacks, or alternative approaches to achieve the same objective?