setting relative mip gap in cplex

945 views
Skip to first unread message

Thomas Bridi

unread,
Sep 6, 2018, 10:22:00 AM9/6/18
to Pyomo Forum
Hi All, 
I'm trying to set the relative mip gap using the cplex solver
so far i tried this approach
self.opt = SolverFactory('cplex')
self.opt.options['mipgap'] = 0.002

However, none of this works. What have I to put into the ticks to make it work?

Thomas

Rey Guerrero

unread,
Sep 10, 2018, 7:29:47 PM9/10/18
to pyomo...@googlegroups.com
Hi Thomas,

Pyomo uses the Interactive "method" in communicating with cplex. Have you tried using the parameter 'mip tolerances gap' as found in the link you mentioned?

Cheers,
Rey


--
You received this message because you are subscribed to the Google Groups "Pyomo Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-forum...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thomas Bridi

unread,
Sep 11, 2018, 9:47:36 AM9/11/18
to Pyomo Forum
I've tried them all and none of that worked

sophie...@gmail.com

unread,
Sep 11, 2018, 12:56:57 PM9/11/18
to Pyomo Forum
Thomas,

Have you tried using "add_options"? I am not using CPLEX, but I was having the same problem specifying options for GAMS solvers (specifically baron). I followed the format for BARON, so I am assuming you can just add an option following CPLEX format. 

Capture.JPG

Sophie 

sergio balderrama

unread,
Sep 11, 2018, 1:05:36 PM9/11/18
to Pyomo Forum
Hello Thomas,

results = opt.solve(instance, tee=True,options_string="mipgap=0.10")

This line is how I set the mip gap.

Regards,

Sergio

Ebrahim Fawzy

unread,
Nov 7, 2022, 9:23:39 AM11/7/22
to Pyomo Forum
Solution by  Sergio worked very well.

Thank you <3

Reply all
Reply to author
Forward
0 new messages