Choosing an optimizer
Describes the optimizers available in the C++ API.
Solving the extracted model with CPLEX involves solving one or a series of continuous relaxations:
-
Only one continuous relaxation needs to be solved if the extracted model is continuous itself, that is, if it does not contain integer variables, Boolean variables, semi-continuous or semi-integer variables, logical constraints, special ordered sets (SOS), or piecewise linear functions. Solving LPs: simplex optimizers and Solving LPs: barrier optimizer discuss the algorithms available for solving LPs. Similarly, Solving problems with a quadratic objective (QP), discusses the algorithms available for solving QPs. Solving problems with quadratic constraints (QCP) re-introduces the barrier optimizer in the context of quadratically constrained programming problems (QCPs). Using piecewise linear functions in optimization: a transport example introduces piecewise-linear functions through a transportation example. Logical constraints in optimization introduces logical constraints, and chapters following it offer examples.
-
In all other cases, the extracted problem that CPLEX sees is indeed a MIP and, in general, a series of continuous relaxations needs to be solved. The method
cplex.isMIPreturnsIloTruein such a case. Solving mixed integer programming problems (MIP) discusses the algorithms applied.
The optimizer option used for solving the first continuous relaxation (whether it is the only one or just the first in a series of problems) is controlled by the root algorithm parameter:
cplex.setParam(IloCplex::RootAlg, alg);
where alg is a member of the nested enumeration IloCplex_Algorithm.
IloCplex::Primal, IloCplex::Dual,
and so on. Table 1 displays
the meaning of the optimizer options defined by IloCplex::Algorithm. Sifting is not available
for QP models. Only the Barrier option is available
for QCP models. Table 2 summarizes
these options.| Optimizer | Purpose |
|---|---|
AutoAlg
|
let CPLEX decide which algorithm to use |
| Primal | use the primal simplex algorithm |
| Dual | use the dual simplex algorithm |
| Network | use the primal network simplex algorithm on an embedded network followed by the dual simplex algorithm for LPs and the primal simplex algorithm for QPs on the entire problem |
| Barrier | use the barrier algorithm. The type of crossover performed
after the barrier algorithm is set by the parameter IloCplex::BarCrossAlg . |
| Sifting | use the sifting algorithm |
| Concurrent | use multiple algorithms concurrently on a multiprocessor system |
| Value | Algorithm Type |
LP? MILP? |
QP? MIQP? |
QCP? MIQCP? |
|---|---|---|---|---|
0
|
IloCplex::AutoAlg
|
yes | yes | yes |
1
|
IloCplex::Primal
|
yes | yes | not available |
2
|
IloCplex::Dual
|
yes | yes | not available |
3
|
IloCplex::Network
|
yes | yes | not available |
4
|
IloCplex::Barrier
|
yes | yes | yes |
| 5 |
IloCplex::Sifting
|
yes | not available | not available |
| 6 |
IloCplex::Concurrent
|
yes | yes | not available |
If the extracted model requires the solution of more than one continuous
relaxation, the algorithm for solving the first one at the root is
controlled by the RootAlg parameter. The algorithm
at all other nodes except the root is controlled by the NodeAlg
parameter:
cplex.setParam(IloCplex::NodeAlg, alg)
| Value | Algorithm Type | MILP? | MIQP? | MIQCP? |
|---|---|---|---|---|
0
|
IloCplex::Auto
|
yes | yes | yes |
1
|
IloCplex::Primal
|
yes | yes | not available |
2
|
IloCplex::Dual
|
yes | yes | not available |
3
|
IloCplex::Network
|
yes | not available | not available |
4
|
IloCplex::Barrier
|
yes | yes | yes |
| 5 |
IloCplex::Sifting
|
yes | not available | not available |