Quadratic programming (QP) is the process of solving certain mathematical optimization problems involving quadratic functions. 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. "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 , an -dimensional real matrix , and an -dimensional real vector , the objective of quadratic programming is to find an -dimensional vector , that will {| cellspacing="10" |- | minimize | |- | subject to | |} where denotes the vector transpose 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: {| cellspacing="10" |- | minimize | |- | subject to | |} 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 and is set to its gradient . 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, active set, augmented Lagrangian, conjugate gradient, gradient projection, extensions of the simplex algorithm. In the case in which is positive definite, the problem is a special case of the more general field of convex optimization. Equality constraints Quadratic programming is particularly simple when is positive definite 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 is given by the linear system where is a set of Lagrange multipliers which come out of the solution