Selecting an optimizer in Python

Select an optimizer using the CPLEX Python API, according to these criteria.

The CPLEX Python API provides a single method, solve, to optimize problems. That method uses the features of the model to deduce the appropriate algorithm for solving the problem. While the default optimizer works well for a wide variety of models, the CPLEX Python API allows you to control which algorithm to invoke for certain types of problems by your changing the values of certain parameters.

For example, if cpx is an instance of the class Cplex encapsulating a MIP (mixed integer programming) problem, you can specify which linear programming algorithm is used for solving the root problem and the node subproblems, like this:

cpx.parameters.mip.strategy.startalgorithm.set(start)
cpx.parameters.mip.strategy.subalgorithm.set(sub)

where start is one of the attributes of cplex.parameters.mip.strategy.startalgorithm.values for the root node and sub is one of the attributes of cplex.parameters.mip.strategy.subalgorithm.values for the subproblem nodes.