| ILOG CPLEX Performance Tuning for Quadratic Programs |
|
ILOG CPLEX can solve Quadratic Programs (QPs) using the barrier, primal or dual simplex methods. While you may be unlikely to improve performance by changing parameters from the defaults, the following tips may enable you to improve performance in other respects. Refer to the ILOG CPLEX User's Manual if you need more information.
- Take advantage of implicit sparsity.
- Account for numerical issues.
- Remember that the quadratic objective can affect the feasibility of the computed solution.
- Try each quadratic programming algorithm.
1. Take advantage of implicit sparsity whenever possible.
ILOG CPLEX quadratic programming algorithms work best when all matrices in the problem it solves are sparse. For linear programming, the only matrix involved is the constraint matrix. For quadratic programs, the objective is c'x + .5 x' Q x. The sparsity or density of the Hessian matrix Q can also influence performance. If Q is dense, ILOG CPLEX will probably create a dense factorization of Q, which will slow down performance. However, in many cases, you may know of a sparse representation of Q that can help improve performance. For example, if you know that Q = F'F, where F is a sparse matrix, then x'Qx = x'F'Fx, so you can reformulate the objective as c'x + y'y, along with the constraint y - Fx = 0. You have added constraints and variables to the problem, but you have simplified the objective. And the constraints you have added involve a sparse matrix, where the matrix Q was dense. This kind of reformulation often improves ILOG CPLEX performance. It is particularly effective for financial problems, where Q often corresponds to the dense covariance matrix of a universe of possible stocks in a portfolio, while F is a sparse matrix of factors that contribute to the nonzero co-variances. More generally, consider increasing the problem size in exchange for sparsity. A larger, sparser problem is often solved faster than a smaller, denser one.

2. Account for numerical issues.
Quadratic programming algorithms tend to be more sensitive to numerically difficult problems than the corresponding linear programming algorithms. Therefore, examining the solution quality becomes even more important. Use the command display solution quality from the Interactive Optimizer of ILOG CPLEX, the routine CPXgetdblquality from the Callable Library C API, or IloCplex::getQuality from Concert. Large values in the primal variables, slacks, dual variables, or reduced costs can cause problems. Large values in the primal variables often correspond to large yet finite values in the right hand sides or bounds; large dual or reduced costs often correspond to large values in the objective function.

3. Remember that the quadratic objective can affect the feasibility of the computed solution.
ILOG CPLEX factors the Hessian matrix Q into L'L and replaces x'Qx = x'L'Lx in the objective with y'y, then adds the constraints y - Lx = 0 to the problem it actually solves. This computation can lead to surprising behavior, as numerical instability in Q can affect the computed solution. As a result, ILOG CPLEX barrier may indicate that a QP is infeasible, yet removing the quadratic part of the objective and solving the resulting linear program results in feasible solutions. In such cases, look for sources of numerical instability and round off error in the Q matrix. Mixes of very large and very small coefficients, especially among the diagonal elements, can cause this behavior. In many cases, a simple rescaling—using Euros instead of Lira in a financial model, for example— for some of the variables in the model can resolve the problem.

4. Try each quadratic programming algorithm.
As with linear programming, the barrier and simplex methods for quadratic programs can behave quite differently for different types of models for both run time and memory usage. If one of the ILOG CPLEX quadratic programming algorithms struggles with a particular model, be sure to try the other algorithms as well.

|