Overview
Quadratic Programming (QP) optimizes a quadratic objective over linear constraints. It is one of the most common nonlinear programming subtopics because it extends LP while preserving strong algorithmic structure in the convex case.
QP appears in least squares, portfolio optimization, control, curve fitting, machine learning, and resource planning. Convex QP can be solved reliably with active-set, interior-point, or operator-splitting methods; nonconvex QP should be treated as a global optimization problem.
Core ideas
Quadratic programming
QP uses a quadratic objective and linear constraints, making it a structured NLP class between LP and general nonlinear programming.
Linear constraints
The feasible region remains polyhedral; the nonlinearity is in the objective rather than the constraints.
Quadratic objective
A positive semidefinite quadratic objective gives a convex QP; indefinite objectives create nonconvex QP.
Least squares
Least-squares estimation is a canonical unconstrained or constrained QP pattern.
Piecewise-linear models
Piecewise-linear models is a core checkpoint for Least Squares, QP & Piecewise-Linear Models: define it concretely, attach units or rules where possible, and test whether stakeholders interpret it the same way.
Active set methods
Active-set methods solve QP by predicting which linear constraints bind at the optimum.
Parametric QP
Parametric QP studies how the solution changes as coefficients or right-hand sides vary, which is important in control and sensitivity analysis.
How to use it
- 1Start with Regression: write the decision, time horizon, actors, and objective in operational language.
- 2Write the quadratic objective matrix, linear term, linear constraints, bounds, and units.
- 3Check whether the quadratic matrix is positive semidefinite before assuming the QP is convex.
- 4Build a small QP instance that can be solved or inspected before using full production data.
- 5Compare the recommendation against a baseline policy, not just against mathematical optimality.
- 6Document assumptions, sensitivity results, and the conditions under which the recommendation should be revisited.
Applications
- Regression: compare feasible policies, quantify the operating tradeoffs, and make the assumptions behind the recommendation visible.
- Portfolio: compare feasible policies, quantify the operating tradeoffs, and make the assumptions behind the recommendation visible.
- Control: compare feasible policies, quantify the operating tradeoffs, and make the assumptions behind the recommendation visible.
- Curve fitting: compare feasible policies, quantify the operating tradeoffs, and make the assumptions behind the recommendation visible.
- Resource planning: compare feasible policies, quantify the operating tradeoffs, and make the assumptions behind the recommendation visible.
Common pitfalls
- Assuming every QP is convex without checking the quadratic objective matrix.
- Using a general NLP solver when the model has QP structure a dedicated solver can exploit.
- Reporting one answer without showing sensitivity to demand, capacity, costs, or behavioral assumptions.
- Ignoring implementation details such as data quality, explainability, ownership, and how users will override bad recommendations.
Resources
- NEOS Guide — Quadratic Programming
Topic-specific source curated for Least Squares, QP & Piecewise-Linear Models.
- VMLS — Boyd & Vandenberghe
Topic-specific source curated for Least Squares, QP & Piecewise-Linear Models.
- Stanford EE364A — Convex Optimization
Convex analysis, duality, least squares, quadratic programs, and conic optimization.
- Convex Optimization — Boyd & Vandenberghe
Open textbook for convex optimization theory and modeling examples.
- CVXPY Short Course
Hands-on examples for disciplined convex modeling in Python.
- NVIDIA cuOpt Documentation
cuOpt supports QP in its GPU-accelerated optimization stack.