Module II·Article III·~5 min read
Linear, Quadratic, and Semidefinite Programming
Duality and Optimality Conditions
Reading tools · save, download, print, audio
Turn this article into a podcast
Pick voices, format, length — AI generates the audio
Hierarchy of Convex Problems
Convex programming is a "family" of optimization problems of varying complexity. Linear programming (LP) is the simplest: linear objective, linear constraints. Quadratic programming (QP) involves a quadratic objective. Second-order cone programming (SOCP) has conic constraints. Semidefinite programming (SDP) has matrix constraints. Each subsequent class strictly generalizes the previous one. Understanding this hierarchy allows one to choose the right tool for a specific problem.
Linear Programming (LP)
Standard form: min subject to , .
Here is the vector of objective coefficients, is the constraint matrix, is the right-hand sides.
Geometry: the feasible region is a convex polyhedron (polytope). The linear objective function attains its minimum at a vertex of the polyhedron. The simplex method (Dantzig, 1947) "moves" from vertex to vertex until it finds the optimum. The interior point method moves through the interior.
Duality in LP: the primal problem min subject to , has a dual max subject to , . Strong duality always holds (if both problems are feasible).
Example — Diet Problem: minimize the cost of a set of products while ensuring sufficient nutrients. This is a classic LP problem, solved back in the 1940s.
Quadratic Programming (QP)
Standard form: min subject to
is the matrix for the quadratic term; it must be (positive semidefinite) for the problem to be convex.
Why ? The quadratic form is convex if and only if . Criterion: all eigenvalues are .
Application: Markowitz Portfolio Optimization
Given a set of assets with expected returns and a covariance matrix . The problem: minimize risk subject to achieving a target return and a budget constraint .
min subject to , ,
This is QP! The covariance matrix is inherently .
Application: SVM
min subject to — strictly convex QP with a unique solution.
Second-Order Cone Programming (SOCP)
SOCP constraint: — the norm of a vector is bounded by a linear function of .
Geometrically: the feasible set is the intersection of second-order cones and affine subspaces.
Includes LP and QP: LP is a special case (when , degenerates to linear). QP with allows an SOCP formulation.
Example: Robust Linear Programming
Suppose we have LP, but the matrix contains an error. Problem: min subject to for all .
Robust constraint: — this is an SOCP constraint!
Semidefinite Programming (SDP)
SDP problem: subject to , ,
where is a symmetric matrix, means positive semidefinite.
Variable — matrix ! This generalizes LP (variable — vector ) to the matrix case.
Why is this a convex problem? The set of matrices is a convex cone. The objective function is linear.
Complete Analysis: SDP Relaxation of the MAX-CUT Problem
Problem: graph . Partition the vertices into two sets and , maximizing the number of edges between them.
ILP formulation: . Cut: . NP-hard.
SDP relaxation (Goemans-Williamson, 1995): replace by vectors with . Product scalar product . Matrix !
max subject to ,
Solution: this is SDP! Randomized rounding (random hyperplane) yields a -approximation of MAX-CUT.
What does this mean: the algorithm is guaranteed to find a cut constituting at least of the optimum. This is the best known polynomial algorithm.
Solvers
In practice, problems are solved by specialized packages:
- CVXPY (Python): high-level language for describing problems
- MOSEK: commercial, very fast for LP/QP/SOCP/SDP
- SCS: open, scalable for large SDP
- ECOS: efficient for embedded systems
Example in CVXPY: x = cp.Variable(n); prob = cp.Problem(cp.Minimize(0.5*cp.quad_form(x,P) + q.T@x), [A@x <= b]); prob.solve()
Hierarchy of Problem Classes
There exists a natural hierarchy of convex conic programs by expressive power and complexity:
Each subsequent class is strictly more powerful: SDP can express SOCP via standard embedding, SOCP includes QP with positive semidefinite matrices, QP includes LP. Complexity also increases: LP solved in by simplex or interior point, QP in , SOCP in , SDP in for general problems, though structured ones may be much faster.
Industrial Solvers
- LP: Gurobi, CPLEX, MOSEK, HiGHS (open source) — millions of variables in seconds
- QP: OSQP, qpOASES (for real-time control), Gurobi
- SOCP: ECOS, MOSEK, SCS — widely used in finance for robust portfolios
- SDP: SDPT3, SeDuMi, MOSEK, COSMO — for problems up to several thousand variables
- Universal modeling languages: CVXPY, JuMP, YALMIP — allow writing the problem in natural form and automatically reducing to canonical for the solver
Modern Applications
- LP in aviation: American Airlines solves problems with millions of variables for crew assignments
- QP in robotics: quadratic regulators (LQR) and MPC (Model Predictive Control) — foundation for controlling manipulators and quadcopters
- SOCP in finance: Goldfarb-Aiyengar robust portfolios account for uncertainty in return estimates using ellipsoidal sets
- SDP in quantum computing: quantum tomography problems, estimation of quantum channels are formulated via SDP
- SDP in combinatorics: Goemans-Williamson’s MAX-CUT relaxation yields a -approximation via SDP — a record in theoretical computer science
§ Act · what next