pulp
pulp copied to clipboard
Examples with Solver Callbacks
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.
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?
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!
I don't have any code, but just noticed (in the docs) the callback argument does not exist anymore ?
The examples of Jump use GLPK: https://jump.dev/JuMP.jl/stable/manual/callbacks/
Bumping this necro thread. Is it possible to get callback facility using SCIP?