HOME

TheInfoList



OR:

Quadratic programming (QP) is the process of solving certain
mathematical optimization Mathematical optimization (alternatively spelled ''optimisation'') or mathematical programming is the selection of a best element, with regard to some criterion, from some set of available alternatives. It is generally divided into two subfi ...
problems involving
quadratic function In mathematics, a quadratic polynomial is a polynomial of degree two in one or more variables. A quadratic function is the polynomial function defined by a quadratic polynomial. Before 20th century, the distinction was unclear between a polynomia ...
s. Specifically, one seeks to optimize (minimize or maximize) a multivariate quadratic function subject to linear constraints on the variables. Quadratic programming is a type of
nonlinear programming In mathematics, nonlinear programming (NLP) is the process of solving an optimization problem where some of the constraints or the objective function are nonlinear. An optimization problem is one of calculation of the extrema (maxima, minima or ...
. "Programming" in this context refers to a formal procedure for solving mathematical problems. This usage dates to the 1940s and is not specifically tied to the more recent notion of "computer programming." To avoid confusion, some practitioners prefer the term "optimization" — e.g., "quadratic optimization."


Problem formulation

The quadratic programming problem with variables and constraints can be formulated as follows. Given: * a real-valued, -dimensional vector , * an -dimensional real
symmetric matrix In linear algebra, a symmetric matrix is a square matrix that is equal to its transpose. Formally, Because equal matrices have equal dimensions, only square matrices can be symmetric. The entries of a symmetric matrix are symmetric with ...
, * an -dimensional real
matrix Matrix most commonly refers to: * ''The Matrix'' (franchise), an American media franchise ** '' The Matrix'', a 1999 science-fiction action film ** "The Matrix", a fictional setting, a virtual reality environment, within ''The Matrix'' (franchi ...
, and * an -dimensional real vector , the objective of quadratic programming is to find an -dimensional vector , that will : where denotes the vector
transpose In linear algebra, the transpose of a matrix is an operator which flips a matrix over its diagonal; that is, it switches the row and column indices of the matrix by producing another matrix, often denoted by (among other notations). The tr ...
of , and the notation means that every entry of the vector is less than or equal to the corresponding entry of the vector (component-wise inequality).


Least squares

As a special case when ''Q'' is symmetric positive-definite, the cost function reduces to least squares: : where follows from the Cholesky decomposition of and . Conversely, any such constrained least squares program can be equivalently framed as a QP, even for generic non-square matrix.


Generalizations

When minimizing a function in the neighborhood of some reference point , is set to its
Hessian matrix In mathematics, the Hessian matrix or Hessian is a square matrix of second-order partial derivatives of a scalar-valued function, or scalar field. It describes the local curvature of a function of many variables. The Hessian matrix was developed ...
and is set to its
gradient In vector calculus, the gradient of a scalar-valued differentiable function of several variables is the vector field (or vector-valued function) \nabla f whose value at a point p is the "direction and rate of fastest increase". If the gr ...
. A related programming problem, quadratically constrained quadratic programming, can be posed by adding quadratic constraints on the variables.


Solution methods

For general problems a variety of methods are commonly used, including :*
interior point In mathematics, specifically in topology, the interior of a subset of a topological space is the union of all subsets of that are open in . A point that is in the interior of is an interior point of . The interior of is the complement of ...
, :*
active set In mathematical optimization, the active-set method is an algorithm used to identify the active constraints in a set of inequality constraints. The active constraints are then expressed as equality constraints, thereby transforming an inequality ...
, :* augmented Lagrangian, :*
conjugate gradient In mathematics, the conjugate gradient method is an algorithm for the numerical solution of particular systems of linear equations, namely those whose matrix is positive-definite. The conjugate gradient method is often implemented as an itera ...
, :* gradient projection, :*extensions of the
simplex algorithm In mathematical optimization, Dantzig's simplex algorithm (or simplex method) is a popular algorithm for linear programming. The name of the algorithm is derived from the concept of a simplex and was suggested by T. S. Motzkin. Simplices are n ...
. In the case in which is
positive definite In mathematics, positive definiteness is a property of any object to which a bilinear form or a sesquilinear form may be naturally associated, which is positive-definite. See, in particular: * Positive-definite bilinear form * Positive-definite fu ...
, the problem is a special case of the more general field of
convex optimization Convex optimization is a subfield of mathematical optimization that studies the problem of minimizing convex functions over convex sets (or, equivalently, maximizing concave functions over convex sets). Many classes of convex optimization pr ...
.


Equality constraints

Quadratic programming is particularly simple when is
positive definite In mathematics, positive definiteness is a property of any object to which a bilinear form or a sesquilinear form may be naturally associated, which is positive-definite. See, in particular: * Positive-definite bilinear form * Positive-definite fu ...
and there are only equality constraints; specifically, the solution process 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 :\text \quad \tfrac \mathbf^\mathrm Q\mathbf + \mathbf^\mathrm \mathbf :\text \quad E\mathbf =\mathbf is given by the linear system : \begin Q & E^\top \\ E & 0 \end \begin \mathbf x \\ \lambda \end = \begin -\mathbf c \\ \mathbf d \end 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 In numerical analysis and linear algebra, lower–upper (LU) decomposition or factorization factors a matrix as the product of a lower triangular matrix and an upper triangular matrix (see matrix decomposition). The product sometimes includes a ...
), which for small problems is very practical. For large problems, the system poses some unusual difficulties, most notably that the 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: :E\mathbf = 0 introduce a new variable defined by :Z \mathbf = \mathbf x where has dimension of minus the number of constraints. Then :E Z \mathbf = \mathbf 0 and if is chosen so that the constraint equation will be always satisfied. Finding such entails finding the
null space In mathematics, the kernel of a linear map, also known as the null space or nullspace, is the linear subspace of the domain of the map which is mapped to the zero vector. That is, given a linear map between two vector spaces and , the kern ...
of , which is more or less simple depending on the structure of . Substituting into the quadratic form gives an unconstrained minimization problem: :\tfrac \mathbf^\top Q\mathbf + \mathbf^\top \mathbf \quad \implies \quad \tfrac \mathbf^\top Z^\top Q Z \mathbf + \left(Z^\top \mathbf\right)^\top \mathbf the solution of which is given by: :Z^\top Q Z \mathbf = -Z^\top \mathbf Under certain conditions on , the reduced matrix will be positive definite. It is possible to write a variation on the
conjugate gradient method In mathematics, the conjugate gradient method is an algorithm In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific problems or to perform a c ...
which avoids the explicit calculation of .


Lagrangian duality

The Lagrangian dual of a QP is also a QP. To see this let us focus on the case where and is positive definite. We write the Lagrangian function as :L(x,\lambda) = \tfrac x^\top Qx + \lambda^\top (Ax-b). Defining the (Lagrangian) dual function as g(\lambda) = \inf_ L(x,\lambda) , we find an
infimum In mathematics, the infimum (abbreviated inf; plural infima) of a subset S of a partially ordered set P is a greatest element in P that is less than or equal to each element of S, if such an element exists. Consequently, the term ''greatest lo ...
of , using \nabla_ L(x,\lambda)=0 and positive-definiteness of : :x^* = -Q^ A^\top \lambda. Hence the dual function is :g(\lambda) = -\tfrac \lambda^\top AQ^A^\top \lambda - \lambda^\top b, and so the Lagrangian dual of the QP is :\text_ \quad -\tfrac \lambda^\top AQ^ A^\top \lambda - \lambda^\top b Besides the Lagrangian duality theory, there are other duality pairings (e.g. Wolfe, etc.).


Complexity

For
positive definite In mathematics, positive definiteness is a property of any object to which a bilinear form or a sesquilinear form may be naturally associated, which is positive-definite. See, in particular: * Positive-definite bilinear form * Positive-definite fu ...
, the
ellipsoid method In mathematical optimization, the ellipsoid method is an iterative method for minimizing convex functions. When specialized to solving feasible linear optimization problems with rational data, the ellipsoid method is an algorithm which finds ...
solves the problem in (weakly)
polynomial time In computer science, the time complexity is the computational complexity that describes the amount of computer time it takes to run an algorithm. Time complexity is commonly estimated by counting the number of elementary operations performed by ...
. If, on the other hand, is indefinite, then the problem is
NP-hard In computational complexity theory, NP-hardness ( non-deterministic polynomial-time hardness) is the defining property of a class of problems that are informally "at least as hard as the hardest problems in NP". A simple example of an NP-hard pr ...
. There can be several stationary points and local minima for these non-convex problems. In fact, even if has only one negative
eigenvalue In linear algebra, an eigenvector () or characteristic vector of a linear transformation is a nonzero vector that changes at most by a scalar factor when that linear transformation is applied to it. The corresponding eigenvalue, often denote ...
, the problem is (strongly)
NP-hard In computational complexity theory, NP-hardness ( non-deterministic polynomial-time hardness) is the defining property of a class of problems that are informally "at least as hard as the hardest problems in NP". A simple example of an NP-hard pr ...
.


Integer constraints

There are some situations where one or more elements of the vector will need to take on
integer An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign ( −1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the languag ...
values. This leads to the formulation of a mixed-integer quadratic programming (MIQP) problem. Applications of MIQP include
water resources Water resources are natural resources of water that are potentially useful for humans, for example as a source of drinking water supply or irrigation water. 97% of the water on the Earth is salt water and only three percent is fresh water; slight ...
and the construction of index funds.


Solvers and scripting (programming) languages


See also

* Sequential quadratic programming *
Linear programming Linear programming (LP), also called linear optimization, is a method to achieve the best outcome (such as maximum profit or lowest cost) in a mathematical model whose requirements are represented by linear relationships. Linear programming is ...
* Critical line method


References


Further reading

* * A6: MP2, pg.245. *


External links


A page about QPNEOS Optimization Guide: Quadratic ProgrammingQuadratic Programming
{{Optimization algorithms Optimization algorithms and methods