JuMP only for formulation and CPLEX.jl (or Gurobi.jl) as callable library wrapper?

Hello!
I’ve read the documentation for both JuMP and CPLEX.jl (the readme page on Github) but I just want to be 100% if it is possible to do the following:

  • Formulate a MILP (using only constraints supported by the solver, nothing fancy)
  • Use only the CPLEX C Callable library (through CPLEX.jl as a wrapper) to interact with the solver.

Could I run into any limitations when trying to use the advanced features in the Callable library?

The reason for doing this is that I love using JuMP for formulating a model, but there are certain “tricks” that I think I can achieve with the C callable library (e.g. getting the cuts generated by CPLEX at the root node cut loop).

Thanks in advance for your comments! :bowing_man:

Hi @rocarvaj, you can use JuMP’s direct mode to build the model and then interact with it using the CPLEX API. In direct mode, there’s a 1:1 mapping from JuMP variables and constraints to CPLEX variables and constraints.

2 Likes

Thanks, Miles! I read about direct mode but I wasn’t sure. This definitely gives me the best of both worlds :slightly_smiling_face:.