Cplex.jl change parameters and display info

Hello,
I am trying to use cplex.jl to solve linear problems without using JuMP or MOI. I want to use the barrier method without presolve and crossover/vertex, so I used these commands:

CPLEX.set_param!(env, "CPX_PARAM_MIPCBREDLP", 0) 
CPLEX.set_param!(env, "CPXPARAM_Barrier_Algorithm", 0)

Are these commands correct, and is there a way to be sure they are doing what I want, using some display messages?
Thanks

1 Like

CPLEX.jl wraps CPLEX’s C API. You can find the full documentation at:

For example, the documentation for CPX_PARAM_MIPCBREDLP can be found:

I don’t think this is what you want because it is about callbacks.

Instead, you’re probably looking for:

2 Likes

This is the setting I use for solving problems with barrier, no presolve, no crossover.
Hope it can be useful.

CPXENV = CPLEX.Env()  # create CPLEX environment

# Set parameters
CPLEX.set_param!(CPXENV, "CPXPARAM_ScreenOutput", 1)  # Enable output
CPLEX.set_param!(CPXENV, "CPXPARAM_TimeLimit", 3600)  # Time limit
CPLEX.set_param!(CPXENV, "CPXPARAM_Threads", 1)  # Single thread
CPLEX.set_param!(CPXENV, "CPXPARAM_SolutionType", 2)  # No crossover
CPLEX.set_param!(CPXENV, "CPXPARAM_LPMethod", 4)  # Use barrier
CPLEX.set_param!(CPXENV, "CPXPARAM_Preprocessing_Presolve", 0)  # No presolve

...

CPLEX should display non-default parameters values at the beginning of the optimization.
For the above case, you should see something like this in the log:

...
CPXPARAM_Preprocessing_Presolve                  0
CPXPARAM_LPMethod                                4
CPXPARAM_Threads                                 1
CPXPARAM_SolutionType                            2
CPXPARAM_TimeLimit                               3600
...

FWIW, I’ve observed that CPLEX still performs a “reduced presolve”, even with the CPXPARAM_Preprocessing_Presolve set to 0.

As odow points out, the answer to all these questions will be in CPLEX’s documentation, there’s nothing additional that’s done in the Julia wrapper.

2 Likes

Thank you!

Thank you this is what I was looking for!