||This article's use of external links may not follow Wikipedia's policies or guidelines. (November 2011)|
Quadratic programming (QP) is a special type of mathematical optimization problem. It is the problem of optimizing (minimizing or maximizing) a quadratic function of several variables subject to linear constraints on these variables.
The quadratic programming problem can be formulated as:
Minimize (with respect to x)
Subject to one or more constraints of the form:
- (inequality constraint)
- (equality constraint)
where indicates the vector transpose of . The notation means that every entry of the vector is less than or equal to the corresponding entry of the vector .
A related programming problem, quadratically constrained quadratic programming, can be posed by adding quadratic constraints on the variables.
For general problems a variety of methods are commonly used, including
Convex quadratic programming is a special case of the more general field of convex optimization.
Quadratic programming is particularly simple when there are only equality constraints; specifically, the problem is linear. By using Lagrange multipliers and seeking the extremum of the Lagrangian, it may be readily shown that the solution to the equality constrained problem is given by the linear system:
where is a set of Lagrange multipliers which come out of the solution alongside .
The easiest means of approaching this system is direct solution (for example, LU factorization), which for small problems is very practical. For large problems, the system poses some unusual difficulties, most notably that problem is never positive definite (even if is), making it potentially very difficult to find a good numeric approach, and there are many approaches to choose from dependent on the problem.
If the constraints don't couple the variables too tightly, a relatively simple attack is to change the variables so that constraints are unconditionally satisfied. For example, suppose (generalizing to nonzero is straightforward). Looking at the constraint equations:
introduce a new variable defined by
where has dimension of minus the number of constraints. Then
and if is chosen so that the constraint equation will be always satisfied. Finding such entails finding the null space of , which is more or less simple depending on the structure of . Substituting into the quadratic form gives an unconstrained minimization problem:
the solution of which is given by:
Defining the (Lagrangian) dual function , defined as , we find an infimum of , using
hence the dual function is
hence the Lagrangian dual of the QP is
subject to: .
Besides the Lagrangian duality theory, there are other duality pairings (e.g. Wolfe, etc.).
For positive definite Q, the ellipsoid method solves the problem in polynomial time. If, on the other hand, Q is indefinite, then the problem is NP-hard. In fact, even if Q has only one negative eigenvalue, the problem is NP-hard.
Solvers and scripting (programming) languages
|AMPL||A popular modeling language for large-scale mathematical optimization.|
|CPLEX||Popular solver with an API (C,C++,Java,.Net, Python, Matlab and R). Free for academics.|
|Excel Solver Function|
|Gurobi||Solver with parallel algorithms for large-scale linear programs, quadratic programs and mixed-integer programs. Free for academic use.|
|IMSL||A set of mathematical and statistical functions that programmers can embed into their software applications.|
|JOptimizer||open source library for solving minimization problem with linear equality and convex inequality constraints (is implemented in Java)|
|Maple||General-purpose programming language for mathematics. Solving a quadratic problem in Maple is accomplished via its QPSolve command.|
|MATLAB||A general-purpose and matrix-oriented programming-language for numerical computing. Quadratic programming in MATLAB requires the Optimization Toolbox in addition to the base MATLAB product|
|Mathematica||A general-purpose programming-language for mathematics, including symbolic and numerical capabilities.|
|MOSEK||A solver for large scale optimization with API for several languages (C++,java,.net, Matlab and python)|
|NAG Numerical Library||A collection of mathematical and statistical routines developed by the Numerical Algorithms Group for multiple programming languages (C, C++, Fortran, Visual Basic, Java and C#) and packages (MATLAB, Excel, R, LabVIEW). The Optimization chapter of the NAG Library includes routines for quadratic programming problems with both sparse and non-sparse linear constraint matrices, together with routines for the optimization of linear, nonlinear, sums of squares of linear or nonlinear functions with nonlinear, bounded or no constraints. The NAG Library has routines for both local and global optimization, and for continuous or integer problems.|
|OpenOpt||BSD licensed universal cross-platform numerical optimization framework, see its QP page and other problems involved. Uses NumPy arrays and SciPy sparse matrices.|
|OptimJ||Free Java-based Modeling Language for Optimization supporting multiple target solvers and available as an Eclipse plugin.|
|qpOASES||Open-source C++ implementation of an online active set strategy|
|R||GPL licensed universal cross-platform statistical computation framework, see its quadprog page|
|TOMLAB||Supports global optimization, integer programming, all types of least squares, linear, quadratic and unconstrained programming for MATLAB. TOMLAB supports solvers like Gurobi, CPLEX, SNOPT and KNITRO.|
- Support vector machine
- Sequential quadratic programming
- Quadratically constrained quadratic programming
- Linear programming
- Nonlinear programming
- Nocedal, Jorge; Wright, Stephen J. (2006). Numerical Optimization (2nd ed.). Berlin, New York: Springer-Verlag. p. 449. ISBN 978-0-387-30303-1.
- Murty, Katta G. (1988). Linear complementarity, linear and nonlinear programming. Sigma Series in Applied Mathematics 3. Berlin: Heldermann Verlag. pp. xlviii+629 pp. ISBN 3-88538-403-5. MR 949214.
- Delbos, F.; Gilbert, J.Ch. (2005). "Global linear convergence of an augmented Lagrangian algorithm for solving convex quadratic optimization problems". Journal of Convex Analysis 12: 45–69.
- Google search.
- Gould, Nicholas I. M.; Hribar, Mary E.; Nocedal, Jorge (April 2001). On the Solution of Equality Constrained Quadratic Programming Problems Arising in Optimization 23 (4). SIAM Journal of Scientific Computing. pp. 1376–1395. CiteSeerX: 10.1.1.129.7555.
- Kozlov, M. K.; S. P. Tarasov and Leonid G. Khachiyan (1979). "[Polynomial solvability of convex quadratic programming]". Doklady Akademii Nauk SSSR 248: 1049–1051. Translated in: Soviet Mathematics - Doklady 20: 1108–1111.
- Sahni, S. (1974). "Computationally related problems". SIAM Journal on Computing 3: 262–279.
- Pardalos, Panos M.; Vavasis, Stephen A. (1991). "Quadratic programming with one negative eigenvalue is NP-hard". Journal of Global Optimization 1 (1): 15–22.
- OptimJ used in an optimization model for mixed-model assembly lines. University of Münster.
- OptimJ used in an Approximate Subgame-Perfect Equilibrium Computation Technique for Repeated Games.
- Cottle, Richard W.; Pang, Jong-Shi; Stone, Richard E. (1992). The linear complementarity problem. Computer Science and Scientific Computing. Boston, MA: Academic Press, Inc. pp. xxiv+762 pp. ISBN 0-12-192350-9. MR 1150683.
- Garey, Michael R.; Johnson, David S. (1979). Computers and Intractability: A Guide to the Theory of NP-Completeness. W.H. Freeman. ISBN 0-7167-1045-5. A6: MP2, pg.245.
- A page about QP
- NEOS Optimization Guide: Quadratic Programming
- Solve an example Quadratic Programming (QP) problem