Changing Problem Type in QPs
Concert Technology (IloCplex
) programs treat all models as capable of containing quadratic coefficients in the objective function. These coefficients can therefore be added or deleted at will. When extracting a model with a quadratic objective function, IloCplex
will automatically detect it as a QP and make the required adjustments to data structures.
However, the other ways of using ILOG CPLEX-the Callable Library and the Interactive Optimizer-require an explicit notion of a Problem Type to distinguish Linear Programs (LPs) from QPs. This subsection discusses the topic for these users.
When you enter a problem, ILOG CPLEX determines the Problem Type from the available information. When read from a file (LP, MPS, or SAV format, for example), or entered interactively, a continuous optimization problem is treated as being of Type qp
if quadratic coefficients are present in the objective function. Otherwise, the Problem Type is lp
. The issue of Problem Types that support integer restrictions in conjunction with quadratic variables is discussed in Chapter 8, Solving Mixed Integer Programming Problems.
If you enter a problem that lacks any quadratic coefficients, its Problem Type is initially lp
. If you then wish to modify the problem to contain quadratic coefficients, you do this by first changing the Problem Type to qp
. Conversely, if you have entered a QP model and wish to remove all the quadratic coefficients and thus convert the model to an LP, you can change the Problem Type to lp
. Note that deleting each of the quadratic coefficients individually still leaves the Problem Type as qp
, although in most instances the distinction between this problem and its lp
or qp
counterpart is somewhat arbitrary in terms of the steps to solve it.
When using the Interactive Optimizer, you use the command change problem
with one of the following options:
From the Callable Library, use the routine CPXchgprobtype()
to change the Problem Type to either CPXPROB_LP
or CPXPROB_QP
for the LP and QP case, respectively, for the same purposes.