> Continuous Optimization > Solving Problems with a Quadratic Objective (QP) > Changing Problem Type in QPs |
Changing Problem Type in QPs |
INDEX PREVIOUS NEXT |
Concert Technology (that is, applications written in C++ , Java, or .NET with the class IloCplex
) 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 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 13, 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, 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:
lp
indicates that you want ILOG CPLEX to treat the problem as an LP. This change in Problem Type removes from your problem all the quadratic information, if there is any present.
qp
indicates that you want ILOG CPLEX to treat the problem as a QP. This change in Problem Type creates in your problem an empty quadratic matrix, if there is not one already present, for the objective function, ready for populating via the change qpterm
command.
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.
Copyright © 1987-2003 ILOG, S.A. All rights reserved. Legal terms. | PREVIOUS NEXT |