Dear Johan Löfberg,
I hope this email finds you well. I am currently working with the Matlab-YALMIP-Gurobi setup and have encountered an issue related to stopping the solver after finding two integer solutions that make the objective function non-positive.
Initially, I tried using the following solver options:
However, these options led to premature pruning, causing the solver to miss solutions that should have been found. Therefore, I am now considering using a callback mechanism to achieve my goal.
I would like to know if YALMIP supports callback functions for this purpose. If not, I was thinking of using the following approach:
Define the variables, constraints, and objective function using YALMIP.
Use the export command to convert the YALMIP model to the format required by the Gurobi native API.
Call the solver using the Gurobi native API and pass in the callback function to monitor the solver's progress and stop it once the desired condition (two non-positive integer solutions) is met.
Could you kindly confirm if this approach is feasible? Or do you have a better solution or alternative recommendation for achieving the same objective?
Thank you for your time and support.
Dear Johan Löfberg,
Thank you for your quick response. I appreciate your confirmation on the export of the numerical model and Gurobi's callback API.
I would like to follow up on whether it is possible to directly implement callbacks within YALMIP, rather than utilizing the Gurobi native API for this purpose. Specifically, I want to know if YALMIP offers any built-in functionality or interface for setting up callbacks to stop the solver when two integer solutions with non-positive objective values are found.
If this is not directly supported by YALMIP, could you recommend any alternative strategies or workarounds within YALMIP to achieve similar functionality?
Thanks again for your guidance, and I look forward to hearing from you.