Search code examples
pyomo

turning off the presolve for Cplex in Pyomo


I am trying to solve a MIP in pyomo with the Cplex solver (Interactive Optimizer 20.1.0.0). I want to turn off the presolve in pyomo, and I found out that I have to use:

opt = SolverFactory("cplex")
opt.options['preprocessing presolve'] = 0

, but I get the error:

CPLEX> New value could not be interpreted.
New value for presolve indicator ['y' or 'n']: New value could not be interpreted.

If I use:

opt = SolverFactory("cplex")
opt.options['preprocessing presolve', 'n']

I won't get any error, but I don't know that it worked or not. Since "Presolve time = 0.03 sec. (34.16 ticks)" in the output remains almost the same when I don't use the (opt.options['preprocessing presolve', 'n'])


Solution

  • In the cplex log you will see

    CPXPARAM_Preprocessing_Presolve                  0
    

    And that means that presolve is off