ILOG CPLEX 11.0 User's Manual > Continuous Optimization > Solving Problems with a Quadratic Objective (QP) > Changing Problem Type in QPs

Concert Technology (that is, applications written in the C++, Java, or .NET API of ILOG CPLEX) treats 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 problem type to distinguish Linear Programs (LPs) from QPs. The following sections discuss the topic for these users.

When you enter a problem, ILOG CPLEX discovers 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 usually treated as being of type qp if quadratic coefficients are present in the objective function and no quadratic terms are present among the constraints. (Quadratic terms among the constraints may make a problem of type QCP. For more about that type, see Solving Problems with Quadratic Constraints (QCP).) Otherwise, the problem type is usually lp. The issue of problem types that support integer restrictions in conjunction with quadratic variables is discussed in Solving Mixed Integer Programming Problems (MIP).

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 in the objective function, 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 from the objective function 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.