Using CPLEX (solver dependent) callbacks for custom branching strategy in Julia

I’ve made a mistake. It should be column = CPLEX.column(cb_data, index(m[:x])) - 1. See

But also:

Cchar[‘U’], # varlu
Cdouble[1.0], # varbd #need to make two child nodes…

If you want to force the variable to 1, don’t you need to set the lower bound to 1?

or does it already implicitly know that it should create the other child node, or is there something completely different I need to do?

Not sure. You’d have to carefully read the IBM documentation. You probably need to make two calls to CPXcallbackmakebranch?

but I don’t know if can both provide a solver-independent heuristic callback to CPLEX on top of the solver-dependent branching callback that I am implementing now, but maybe CPLEX has some other way to do it?

Modify the if statement to include

if context_id == CPX_CALLBACKCONTEXT_RELAXATION
    # ... heuristic stuff ...
elseif context_id == CPX_CALLBACKCONTEXT_BRANCHING
    # ... branching stuff ...
end

you can see how we post the heuristic solution here https://github.com/jump-dev/CPLEX.jl/blob/ccde44778f93d65af3c6492e44571af03bc015cc/src/MOI/MOI_callbacks.jl#L350-L357

1 Like