Quadratic Program
   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 criteria, from some set of available alternatives. It is generally divided into two subfiel ...
problems A problem is a difficulty which may be resolved by problem solving. Problem(s) or The Problem may also refer to: People * Problem (rapper), (born 1985) American rapper Books * ''Problems'' (Aristotle), an Aristotelian (or pseudo-Aristotelian) co ...
involving
quadratic function In mathematics, a quadratic function of a single variable (mathematics), variable is a function (mathematics), function of the form :f(x)=ax^2+bx+c,\quad a \ne 0, where is its variable, and , , and are coefficients. The mathematical expression, e ...
s. Specifically, one seeks to optimize (minimize or maximize) a multivariate quadratic function subject to linear
constraints Constraint may refer to: * Constraint (computer-aided design), a demarcation of geometrical characteristics between two or more entities or solid modeling bodies * Constraint (mathematics), a condition of an optimization problem that the solution m ...
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 are not linear equalities or the objective function is not a linear function. An optimization problem is one of calculation ...
. "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 (: matrices or matrixes) or MATRIX may refer to: Science and mathematics * Matrix (mathematics), a rectangular array of numbers, symbols or expressions * Matrix (logic), part of a formula in prenex normal form * Matrix (biology), the m ...
, 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 (mathematics), 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 ...
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).


Constrained least squares

As a special case when is symmetric positive-definite, the cost function reduces to least squares: : where follows from the
Cholesky decomposition In linear algebra, the Cholesky decomposition or Cholesky factorization (pronounced ) is a decomposition of a Hermitian, positive-definite matrix into the product of a lower triangular matrix and its conjugate transpose, which is useful for eff ...
of and . Conversely, any such
constrained least squares In constrained least squares one solves a linear least squares problem with an additional constraint on the solution. This means, the unconstrained equation \mathbf \boldsymbol = \mathbf must be fit as closely as possible (in the least squar ...
program can be equivalently framed as a quadratic programming problem, even for a 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, Hessian or (less commonly) Hesse matrix is a square matrix of second-order partial derivatives of a scalar-valued Function (mathematics), function, or scalar field. It describes the local curvature of a functio ...
and is set to its
gradient In vector calculus, the gradient of a scalar-valued differentiable function f of several variables is the vector field (or vector-valued function) \nabla f whose value at a point p gives the direction and the rate of fastest increase. The g ...
. 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 t ...
, :*
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 inequalit ...
, :* 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-semidefinite. The conjugate gradient method is often implemented as an it ...
, :* 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 ...
. In the case in which is
positive definite In mathematics, positive definiteness is a property of any object to which a bilinear form In mathematics, a bilinear form is a bilinear map on a vector space (the elements of which are called '' vectors'') over a field ''K'' (the elements of w ...
, 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 problems ...
.


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 In mathematics, a bilinear form is a bilinear map on a vector space (the elements of which are called '' vectors'') over a field ''K'' (the elements of w ...
and there are only equality constraints; specifically, the solution process is linear. By using
Lagrange multipliers In mathematical optimization, the method of Lagrange multipliers is a strategy for finding the local maxima and minima of a function subject to equation constraints (i.e., subject to the condition that one or more equations have to be satisfie ...
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 multiplication and matrix decomposition). The produ ...
), 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 part of the domain which is mapped to the zero vector of the co-domain; the kernel is always a linear subspace of the domain. That is, given a linear ...
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 for the numerical solution of particular systems of linear equations, namely those whose matrix is positive-semidefinite. The conjugate gradient method is often implemented as an it ...
which avoids the explicit calculation of .


Lagrangian duality

The Lagrangian dual of a quadratic programming problem is also a quadratic programming problem. To see this let us focus on the case where and is positive definite. We write the
Lagrangian Lagrangian may refer to: Mathematics * Lagrangian function, used to solve constrained minimization problems in optimization theory; see Lagrange multiplier ** Lagrangian relaxation, the method of approximating a difficult constrained problem with ...
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; : infima) of a subset S of a partially ordered set P is the greatest element in P that is less than or equal to each element of S, if such an element exists. If the infimum of S exists, it is unique ...
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 quadratic programming problem 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.).


Run-time complexity


Convex quadratic programming

For
positive definite In mathematics, positive definiteness is a property of any object to which a bilinear form In mathematics, a bilinear form is a bilinear map on a vector space (the elements of which are called '' vectors'') over a field ''K'' (the elements of w ...
, when the problem is convex, the
ellipsoid method In mathematical optimization, the ellipsoid method is an iterative method for convex optimization, minimizing convex functions over convex sets. The ellipsoid method generates a sequence of ellipsoids whose volume uniformly decreases at every ste ...
solves the problem in (weakly)
polynomial time In theoretical 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 p ...
. Ye and Tse present a polynomial-time algorithm, which extends
Karmarkar's algorithm Karmarkar's algorithm is an algorithm introduced by Narendra Karmarkar in 1984 for solving linear programming problems. It was the first reasonably efficient algorithm that solves these problems in polynomial time. The ellipsoid method is also pol ...
from linear programming to convex quadratic programming. On a system with ''n'' variables and ''L'' input bits, their algorithm requires O(L n) iterations, each of which can be done using O(L n3) arithmetic operations, for a total runtime complexity of O(''L''2 ''n''4). Kapoor and Vaidya present another algorithm, which requires O(''L'' * log ''L'' ''* n''3.67 * log ''n'') arithmetic operations.


Non-convex quadratic programming

If is indefinite, (so the problem is non-convex) then the problem is
NP-hard In computational complexity theory, a computational problem ''H'' is called NP-hard if, for every problem ''L'' which can be solved in non-deterministic polynomial-time, there is a polynomial-time reduction from ''L'' to ''H''. That is, assumi ...
. A simple way to see this is to consider the non-convex quadratic constraint ''xi''2 = ''xi''. This constraint is equivalent to requiring that ''xi'' is in , that is, ''xi'' is a binary integer variable. Therefore, such constraints can be used to model any integer program with binary variables, which is known to be NP-hard. Moreover, these non-convex problems might have several stationary points and local minima. In fact, even if has only one negative
eigenvalue In linear algebra, an eigenvector ( ) or characteristic vector is a vector that has its direction unchanged (or reversed) by a given linear transformation. More precisely, an eigenvector \mathbf v of a linear transformation T is scaled by a ...
, the problem is (strongly)
NP-hard In computational complexity theory, a computational problem ''H'' is called NP-hard if, for every problem ''L'' which can be solved in non-deterministic polynomial-time, there is a polynomial-time reduction from ''L'' to ''H''. That is, assumi ...
. Moreover, finding a KKT point of a non-convex quadratic program is CLS-hard.


Mixed-integer quadratic programming

There are some situations where one or more elements of the vector will need to take on
integer An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...). The negations or additive inverses of the positive natural numbers are referred to as negative in ...
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. These resources can be either Fresh water, freshwater from natural sources, or water produ ...
and the construction of index funds.


Solvers and scripting (programming) languages


Extensions

Polynomial optimization is a more general framework, in which the constraints can be
polynomial function In mathematics, a polynomial is a mathematical expression consisting of indeterminates (also called variables) and coefficients, that involves only the operations of addition, subtraction, multiplication and exponentiation to nonnegative int ...
s of any degree, not only 2.


See also

*
Sequential quadratic programming Sequential quadratic programming (SQP) is an iterative method for constrained nonlinear optimization, also known as Lagrange-Newton method. SQP methods are used on mathematical problems for which the objective function and the constraints are twi ...
*
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 and objective are represented by linear function#As a polynomia ...
*
Critical line method Portfolio optimization is the process of selecting an optimal portfolio (asset distribution), out of a set of considered portfolios, according to some objective. The objective typically maximizes factors such as expected return, and minimizes co ...


References


Further reading

* * A6: MP2, pg.245. *


External links


A page about quadratic programmingNEOS Optimization Guide: Quadratic ProgrammingQuadratic Programming

Cubic programming and beyond
in Operations Research stack exchange {{Authority control Optimization algorithms and methods