ERGO-Code / HiGHS

Linear optimization software
MIT License
946 stars 175 forks source link

MIP Callbacks #781

Open jajhall opened 2 years ago

jajhall commented 2 years ago

Placeholder issue for the introduction of MIP callbacks, as discussed with @lgottwald

Requested within https://github.com/coin-or/python-mip/issues/255

odow commented 2 years ago

Leaving a bread-crumb to https://jump.dev/JuMP.jl/stable/manual/callbacks/, which contains the documentation of the callbacks JuMP supports. However I think a good rule of thumb is "if in doubt, follow Gurobi."

jajhall commented 6 months ago

Since there are MIP callbacks for improving solutions, any solution and simple interrupt, and code for lazy constraints is WIP, this "prompt" issue seems unnecessary

rlloretb commented 3 months ago

Any news on callbacks for user cuts (different from lazy constraints)?

jajhall commented 3 months ago

What's the difference?

Just the point at which the cuts are generated - in the cut generation phase, rather than when an improving integer feasible solution is obtained?

rlloretb commented 3 months ago

I agree that they are very similar. Technically, in Gurobi they are implemented differently due to incompatibilities with the preprocessing step (see precrush parameter). I was wondering if it is possible to add user cuts in HiGHs while the root node is being solved.

jajhall commented 3 months ago

OK thanks, that gives me a pointer to find out more.

rlloretb commented 3 months ago

So it is not possible to add cuts at the root node with the current callback implementation (v1.7.2)?

jajhall commented 3 months ago

User cuts, no. My focus had been lazy constraints

rlloretb commented 3 months ago

I see. Any plans to implement it within a year? It is a very powerful feature.

jajhall commented 3 months ago

There are plans - and money - to enhance the MIP solver over the coming 12 months

Thell commented 2 months ago

Hi Julian, I've been wondering recently about HiGHS callbacks and am curious if a simple callback could be used that would allow a user to return an objective value modifier? Seeing that there are plans to work on callbacks this year I figured it'd be a good time to ask.

For example if the object is to maximize value minus cost but the cost is calculated out of HiGHS the callback would send the proposed solution and the user would simply send back the value... I guess you could say that it would essentially be setting a variable value via callback. Could that be a thing or ...?

jajhall commented 2 months ago

I can't see how we could allow this. HiGHS needs the explicit objective function to optimize.