Passing mipgap parameter to cbc with pyomo using script

1,013 views
Skip to first unread message

张翼

unread,
Mar 20, 2018, 12:20:23 AM3/20/18
to Pyomo Forum
Hello,

May I know the script of passing mipgap parameter to cbc with pyomo?

I used the following code and "MIPGap" as the name of parameter, but python shows no match for "MIPGap":

opt=SolverFactory('cbc')
instance = model.create_instance()
opt.options['MIPGap'] = 0.01
results = opt.solve(instance,tee=True)
instance.solutions.store_to(results)

Thank you!

Regards,
Yi

Cord Kaldemeyer

unread,
Mar 20, 2018, 5:08:05 AM3/20/18
to Pyomo Forum
To me it looks as you are passing a gurobi option (MIPGap) to the solver and it thus does not show any effect.

Did you have a look at the CBC documentation and try "man cbc"?

...
AVAILABLE COMMANDS
       
Double parameters:
              dualB
(ound)  dualT(olerance)  primalT(olerance)  primalW(eight)

       
Branch and Cut double parameters:
                allow
(ableGap)  cuto(ff)  inc(rement)  inf(easibilityWeight)  integerT(olerance)
                preT
(olerance)  ratio(Gap)  sec(onds)
...



At a first glance, it looks like "allowableGap" might be your friend. You might test for the right argument with the CBC command line interface and simple test problems (LP, MPS, ...) before passing the argument to pyomo.

Cheers
Cord
Reply all
Reply to author
Forward
Message has been deleted
0 new messages