CPLEX gap setting with PULP

1.8k views Asked by At

Anyone know how to set the epgap parameter for CPLEX solver when calling CMD_CPLEX() from PULP (python)?

I have tried everything from an options file in the folder to tons of different syntax attempts like:

prob.solve(CPLEX_CMD(options = ['epgap = 0.25']))

Any tips would be greatly appreciated!

1

There are 1 answers

5
rkersh On BEST ANSWER

As you probably know, the CPLEX_CMD solver is a wrapper around the CPLEX interactive. To set parameters, you need to use the same syntax that you'd use within the interactive. So, to set the relative MIP gap tolerance parameter, you'd want to use the following syntax:

prob.solve(CPLEX_CMD(options=['set mip tolerances mipgap 0.25']))