JuliaOpt / MathProgBase.jl

DEPRECATED: Solver-independent functions (i.e. linprog and mixintprog) and low-level interface for Mathematical Programming
Other
81 stars 38 forks source link

variable bound functions not documented and without no signature #216

Open matbesancon opened 6 years ago

matbesancon commented 6 years ago

Trying to use the setvarLB!, setvarUB! getvarLB, getvarUB functions in a callback but couldn't find a definition in the docs nor in MathProgBase source code. What's the signature, should these be called with the callback object? Do they get updated in the current node of the branch and bound?

odow commented 6 years ago

From JuMP or MPB? Which solver?

It's worth having a look at the JuMP implementation.

Remember that solver-independent callbacks will no longer be supported in MOI. Instead, you should use the solver specific functionality - precisely because the specifics of which functions are available and when are not solver specific.

Here is an example of a lazy cut in MOI with Gurobi: https://github.com/JuliaOpt/Gurobi.jl/blob/0d73b3e35b9fac7e25eb0d4f4776a76d53deefd3/test/MOIWrapper.jl#L125-L191 Gurobi defines a new Gurobi.CallbackFunction attribute here: https://github.com/JuliaOpt/Gurobi.jl/blob/0d73b3e35b9fac7e25eb0d4f4776a76d53deefd3/src/MOIWrapper.jl#L480-L494

matbesancon commented 6 years ago

From MPB, solver is CPLEX. Yes I'm checking the solver documentation for this. Thing is, I was wondering how to call it and was looking at the interface for that but it's not going to be an issue after MOI.

In any case, it's worth knowing if querying the information will give the bounds at current node or of the initial formulation

mlubin commented 6 years ago

As far as I recall, these methods have no specific use in callbacks, which is why there's no documentation on it. I would expect that they give either the bounds on the initial formulation or they fail if the solver doesn't support querying this information during a callback.