ILOG CPLEX 10.1 User's Manual > Continuous Optimization > Solving Problems with a Quadratic Objective (QP) > Entering QPs

ILOG CPLEX supports two views of quadratic objective functions: a matrix view and an algebraic view.

Matrix View

In the matrix view, commonly found in textbook presentations of QP, the objective function is defined as 1/2 xTQx + cTx, where Q must be symmetric and positive semi-definite for a minimization problem, or negative semi-definite for a maximization problem. This view is supported by the MPS file format and the Callable Library routines, where the quadratic objective function information is specified by providing the matrix Q. Thus, by definition, the factor of 1/2 must be considered when entering a model using the matrix view, as it will be implicitly assumed by the optimization routines.

Similarly, symmetry of the Q matrix data is required; the MPS reader will return an error status code if the file contains unequal off-diagonal components, such as a nonzero value for one and zero (or omitted) for the other.

This symmetry restriction applies to quadratic programming input formats rather than the quadratic programming problem itself. For models with an asymmetric Q matrix, either express the quadratic terms algebraically, as described in Algebraic View, or provide as input (Q + Q')/2 instead of Q. This latter approach relies on the identity Q = (Q + Q')/2 + (Q - Q')/2 combined with the fact that (Q - Q')/2 contributes 0 (zero) to the quadratic objective.

Algebraic View

In the algebraic view, a quadratic objective function is specified as an expressions of the form:

c1*x1 + ... + cn*xn + q11*x1*x1 + q12*x1*x2 + ... + qnn*xn*xn.

This view is supported by the LP format, when entering quadratic objective functions in the Interactive Optimizer, and by Concert Technology. Again, a quadratic objective function must be convex in the case of a minimization problem, or concave in the case of a maximization problem. When entering a quadratic objective with the algebraic view, neither symmetry considerations nor any implicit factors need to be considered, and indeed attempting to specify both of the off-diagonal elements for one of the quadratic terms may result in double the intended value of the coefficient.