-
Notifications
You must be signed in to change notification settings - Fork 275
Description
I notice that smart usage of callback methods could help HiGHS to massively outperform commercial solvers like CPLEX on certain large-scale real-world MILP problems, with user-defined heuristic methods. However, the callback support in the C API at the moment seems a bit limited for me to implement my problem-specific heuristic method inside the HiGHS solving routine. Just thought that an improvement in the current heuristic support could be very helpful for users of HiGHS that work on challenging MILP problems.
I would like to trigger this heuristic callback when HiGHS successfully solves the LP relaxation, with the C API. Just wondering if a new MIP relaxation solution callback (similar to the existing MIP improving solution callback) could be added to the C API, which is called when the MIP solver finishes the crossover and obtains an optimal solution of the LP relaxation.
It seems to me that another possible way to implement this is to use MIP interrupt callback, which would ideally interrupt the MIP solver when presolving or crossover has been performed. However, it does not seems to me that this can be done via the current C API.
Just wondering which way you guys think is better.
Also wondering if a new method Highs_getRelaxationSolution() could be added to the C API. It could be similar to the existing Highs_getSolution() method, but obtains the optimal solution of the LP relaxation rather than a solution of the MIP problem. After the callback is triggered, I would like to obtain three things from HiGHS: 1) the presolved model, via the method Highs_gerPresolvedLp(); 2) an optimal solution of the presolved LP problem, via the new method Highs_getRelaxationSolution(); 3) names of variables in the presolved model, via Highs_getPresolvedColNames().
I also notice that in the examples, only the python example, e.g. call_highs_from_python.py shows how to use callback. Just thought that it would be very helpful for people using the C/Julia API to have some examples about callback in call_highs_from_c.c, especially on the C methods Highs_setCallback, Highs_setCallbackSolution and Highs_setCallbackSparseSolution.