> Languages and APIs > ILOG Concert Technology for Java Users > Choosing an Optimizer

The algorithm used in the solve methods can be controlled and if necessary tailored to the particular needs of the model. The most important control is that of selecting the optimizer. For solving the active model, ILOG CPLEX solves one continuous relaxation or a series of continuous relaxations.

In short, an LP model has a linear objective function and linear constraints; a QP model has a quadratic objective function and linear constraints; a QCP includes quadratic constraints, and it may have a linear or quadratic objective function. A problem that that can be represented as LP, QP, or QCP is also known collectively as a continuous model or a continuous relaxation.

A series of relaxations is solved if the active model is a MIP, which can be recognized by IloCplex.isMIP returning true. This is the case if the model contains any of the objects excluded for single continuous models. If a MIP contains a purely linear objective function, (that is, IloCplex.isQO returns false), the problem is more precisely called an MILP. Otherwise it is called an MIQP or MIQCP. MIPs are solved using branch & cut search, explained in more detail in Chapter 13, Solving Mixed Integer Programming Problems (MIP).

Solving a Single Continous Model

To choose the optimizer to solve a single continous model, or the first continuous relaxation in a series, use

IloCplex.setParam(IloCplex.IntParam.RootAlg, alg)

where alg is an integer specifying the algorithm type. Table 2.3 shows you the available types of algorithms.

Table 2.3 Algorithm Types for RootAlg
alg 
Algorithm Type 
LP? 
QP? 
QCP? 
0 
IloCplex.Algorithm.Auto 
yes 
yes 
yes 
1 
IloCplex.Algorithm.Primal 
yes 
yes 
not available 
2 
IloCplex.Algorithm.Dual 
yes 
yes 
not available 
3 
IloCplex.Algorithm.Network 
yes 
yes 
not available 
4 
IloCplex.Algorithm.Barrier 
yes 
yes 
yes 
IloCplex.Algorithm.Sifting 
yes 
not available 
not available 
IloCplex.Algorithm.Concurrent 
yes 
yes 
not available 

You are not obliged to set this parameter. In fact, if you do not explicitly call IloCplex.setParam(IloCplex.IntParam.RootAlg, alg), ILOG CPLEX will use the default: IloCplex.Algorithm.Auto. Any invalid setting will produce an error message.

The IloCplex.Algorithm.Sifting algorithm is not available for QP. IloCplex will default to the IloCplex.Algorithm.Auto setting when the parameter IloCplex.IntParam.RootAlg is set to IloCplex.Algorithm.Sifting for a QP.

Only the settings IloCplex.Algorithm.Auto and IloCplex.Algorithm.Barrier are valid for a QCP.

Solving Subsequent Continuous Relaxations in a MIP

Parameter IloCplex.IntParam.RootAlg also controls the algorithm used for solving the first continuous relaxation when solving a MIP. The algorithm for solving all subsequent continous relaxations is then controlled by the parameter IloCplex.IntParam.NodeAlg. The algorithm choices appear in Table 2.4

Table 2.4 Algorithm Types for NodeAlg
alg 
Algorithm Type 
MILP? 
MIQP? 
MIQCP? 
0 
IloCplex.Algorithm.Auto 
yes 
yes 
yes 
1 
IloCplex.Algorithm.Primal 
yes 
yes 
not available 
2 
IloCplex.Algorithm.Dual 
yes 
yes 
not available 
3 
IloCplex.Algorithm.Network 
yes 
not available  
not available 
4 
IloCplex.Algorithm.Barrier 
yes 
yes 
yes 
IloCplex.Algorithm.Sifting 
yes 
not available 
not available