7

I am currently using the cbc solver with Pyomo

opt = SolverFactory('cbc')
opt.solve(model)

How can more options for Cbc be used, such that what we run using Pyomo is similar to:

cbc -cuts off -strong 0 -preprocess off -heuristic off -solve
Athena Wisdom
  • 253
  • 1
  • 5

1 Answers1

6

You can use opt.options['Solver parameter to change']='value'. The following is part of the code that I tried and the generated output:

opt.options['heuristics'] = 'off'
opt.options['preprocess'] = 'off'
opt.options['loglevel'] = 50

Pyomo's output:

command line - ampl cbc heuristics off preprocess off loglevel 50 heuristics off preprocess off loglevel 50 -solve -quit (default strategy 1)

Option for heuristicsOnOff changed from on to off

Option for preprocess changed from sos to off

The list of options for cbc can be found here.

Oguz Toragay
  • 8,652
  • 2
  • 13
  • 41