Controlling the optimizers

Describes parameters that control the optimizers in the C++ API.

Though CPLEX defaults will prove sufficient to solve most problems, CPLEX offers a variety of parameters to control various algorithmic choices. CPLEX parameters can assume values of type bool, num, int, and string. IloCplex provides four categories of parameters that are listed in the nested enumeration types:

To access the current value of a parameter that interests you from Concert Technology, use the method getParam. To access the default value of a parameter, use the method getDefault. Use the methods getMin and getMax to access the minimum and maximum values of num and int type parameters.

Some integer parameters are tied to nested enumerations that define symbolic constants for the values the parameter may assume. The table Table 1 summarizes those parameters and their enumeration types.
Table 1. Nested enumerations for integer parameters
This Enumeration: Is Used for This Parameter:
IloCplex::Algorithm IloCplex::RootAlg
IloCplex::Algorithm IloCplex::NodeAlg
IloCplex::MIPEmphasisType IloCplex::MIPEmphasis
IloCplex::VariableSelect IloCplex::VarSel
IloCplex::NodeSelect IloCplex::NodeSel
IloCplex::PrimalPricing IloCplex::PPriInd
IloCplex::DualPricing IloCplex::DPriInd
IloCplex::BranchDirection IloCplex::BrDir

There are, of course, routines in Concert Technology to set these parameters. Use the following methods to set the values of CPLEX parameters:

For example, the numeric parameter IloCplex::EpOpt controlling the optimality tolerance for the simplex algorithms can be set to 0.0001 by this call:

setParam(IloCplex::EpOpt, 0.0001);

The CPLEX Parameters Reference Manual documents the type of each parameter (bool, int, num, string) along with the Concert Technology enumeration value, symbolic constant, and reference number representing the parameter.

The method setDefaults resets all parameters (except the log file) to their default values, including the CPLEX callback functions. This routine resets the callback functions to NULL.

When you are solving a MIP, CPLEX provides additional controls of the solution process. Priority orders and branching directions can be used to control the branching in a static way. These controls are discussed in Heuristics. These controls are static in the sense that they allow you to control the solution process based on data that does not change during the solution and can thus be set up before you solve the model.

Dynamic control of the solution process of MIPs is provided through goals or control callbacks. They are discussed in Using goals, and in Using legacy optimization callbacks. Goals and callbacks allow you to control the solution process based on information that is generated during the solution process. Goals and callbacks: a comparison contrasts the advantages of each approach.