pulp icon indicating copy to clipboard operation
pulp copied to clipboard

Examples with Solver Callbacks

Open Kuifje02 opened this issue 4 years ago • 5 comments

Hi !

I am a big fan of PuLp and use it (almost) every day. I think it would be great if there were some examples showing how to use User Callbacks, such as Lazy Constraints or User Cuts.

This is done in the Jump package (Julia) for example, as shown in the docs here.

I think this is possible, as per this conversation in pulp-or-discuss.

Kuifje02 avatar May 17 '21 12:05 Kuifje02

Very good idea. We could add some cplex/ gurobi examples. With CBC it's not possible (at least with the CMD api which is the most/ only one used). That being said, another option is to go to the gurobi / cplex docs (e.g., https://www.gurobi.com/documentation/9.1/refman/py_cb_s.html) and checking how to do that (pulp uses their apis internally). We could at least link to their docs and show a small example.

Do you have a small code example we could use?

pchtsp avatar May 17 '21 18:05 pchtsp

I don't have any code at hand unfortunately !

I currently only have access to CPLEX 20.1 and its examples here, but I am not sure how this would translate into PuLP. If I figure something out I will post it here!

Kuifje02 avatar May 18 '21 08:05 Kuifje02

I don't have any code, but just noticed (in the docs) the callback argument does not exist anymore ?

Kuifje02 avatar May 19 '21 20:05 Kuifje02

The examples of Jump use GLPK: https://jump.dev/JuMP.jl/stable/manual/callbacks/

MLopez-Ibanez avatar Jul 26 '21 15:07 MLopez-Ibanez

Bumping this necro thread. Is it possible to get callback facility using SCIP?

SmokeShine avatar Apr 09 '24 12:04 SmokeShine