Foundations to Frontier
Tests
A. Mathematical Foundations › A6 Optimization › Convex optimization

Linear, Quadratic and Semidefinite Programming

Most convex problems solved in practice fall into a hierarchy of standard forms: linear programs (LP), quadratic programs (QP), second-order cone programs (SOCP) and semidefinite programs (SDP), each a special case of the next. You will learn their standard forms and geometry, implement the simplex method (and see its exponential worst case), understand interior-point methods, recognize SOCP and SDP constraints, and solve a model-predictive-control QP with input limits.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Standard shapes for standard tools

Engineers love standard parts: a bolt of a standard size fits any wrench. Optimization problems have standard shapes too. When your problem has straight-line costs and straight-line limits, it’s a linear program, and decades-old, rock-solid software can solve it with millions of variables. If the cost curves like a bowl, it’s a quadratic program. Curved limits like cones or matrix conditions lead to SOCPs and SDPs.

The trick is to write your problem in one of these shapes. Then a reliable solver does the rest.

Linear vs quadratic objectives on the same constraints
simplex visits 3 vertices: (0.0, 0.0) → (0.0, 5.0) → (2.5, 5.0) · optimum value 5.58
A linear objective is optimized at a vertex. The simplex method pivots along edges to adjacent vertices that improve the objective, stopping when no neighbour is better. That local test is global for LPs. Tilting θ makes the optimum jump between vertices, and when θ is parallel to an edge the whole edge is optimal.
Why engineers care

Mission scheduling and resource allocation are LPs. MPC controllers solve a QP every few milliseconds. Rocket landing guidance is an SOCP. Robust control and SLAM certification use SDPs. Recognizing the form means you can reach for a certified, fast solver instead of a fragile general-purpose one.

📝 Quick check (Level 0)
0/3 answered
  1. 1. Straight-line cost and straight-line limits make a…
  2. 2. A bowl-shaped cost with straight-line limits is a…
  3. 3. An LP's best point is always found at…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

Standard forms

  • LP: min⁡c⊤x\min c^\top x s.t. Ax≤bAx\le b (or Ax=bAx = b, x≥0x\ge0). The feasible set is a polyhedron, and an optimum (if one exists) is attained at a vertex.
  • QP: min⁡12x⊤Qx+c⊤x\min\frac12x^\top Qx + c^\top x s.t. Ax≤bAx\le b, with Q⪰0Q\succeq0 for convexity. The optimum can be interior, on a face or at a vertex.
  • SOCP: linear objective with constraints ∥Aix+bi∥2≤ci⊤x+di\|A_ix + b_i\|_2\le c_i^\top x + d_i (ice-cream cones).
  • SDP: min⁡c⊤x\min c^\top x s.t. F0+∑ixiFi⪰0F_0 + \sum_ix_iF_i\succeq0 (a linear matrix inequality).

Hierarchy: LP ⊂ QP ⊂ SOCP ⊂ SDP. Each can express the previous.

The simplex method, in one paragraph

Move from vertex to adjacent vertex along edges that improve the objective. Stop when no neighbour is better; for an LP, that local test is global. In tableau form, each pivot brings one variable into the basis (the most negative reduced cost) and the ratio test picks the variable to leave so all stay non-negative.

📝 Quick check (Level 1)
0/3 answered
  1. 1. A QP is convex when…
  2. 2. The simplex method moves along…
  3. 3. Which is the most general class?

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.

Algorithms and complexity

  • Simplex is very fast in practice, but exponential in the worst case: the Klee–Minty cube makes Dantzig’s rule visit all 2n2^n vertices. Smoothed analysis explains why it’s fast on typical inputs (Spielman and Teng, 2004).
  • Interior-point methods follow the central path with damped Newton steps on a barrier problem, min⁡tc⊤x−∑log⁡(bi−ai⊤x)\min tc^\top x - \sum\log(b_i - a_i^\top x). They’re polynomial (Karmarkar, 1984; Nesterov and Nemirovski, 1994) and handle LP, QP, SOCP and SDP in about 20–50 iterations regardless of size.
  • First-order / splitting methods (OSQP, SCS) trade accuracy for speed and scale, and they warm-start well. That’s ideal for MPC (A6.2-8).

Recognizing the forms

  • L1 / L∞ fitting, max-flow, scheduling, allocation: LP.
  • Least squares with bounds, MPC, SVM, portfolio: QP.
  • Thrust-pointing cones, robust LP, norm constraints: SOCP.
  • Lyapunov stability A⊤P+PA≺0A^\top P + PA\prec0, max-cut relaxation, covariance estimation: SDP.

MPC as a QP

For linear dynamics xk+1=Adxk+Bdukx_{k+1} = A_dx_k + B_du_k, stack the inputs: X=Φx0+ΓUX = \Phi x_0 + \Gamma U. A quadratic tracking cost with input bounds becomes a box-constrained QP min⁡12U⊤HU+g⊤U\min\frac12U^\top HU + g^\top U, ∣U∣≤umax⁡|U|\le u_{\max}. Clipping the unconstrained LQ solution is not optimal. Solving the QP plans around the saturation.

🐍 Exercise 1: the simplex method
Implement tableau simplex for max cᵀx s.t. Ax ≤ b, x ≥ 0. Plan a rover day and check against vertex enumeration, then count pivots on the Klee–Minty cube.
📝 Quick check (Level 2)
0/3 answered
  1. 1. The Klee–Minty cube shows simplex can take…
  2. 2. Interior-point methods are…
  3. 3. Stability via AᵀP + PA ≺ 0 is a(n)…

Level 3: Advanced

★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.

Why the ratio test keeps feasibility

When variable jj enters at level t≥0t\ge0, each basic variable changes as xBi=bˉi−taˉijx_{B_i} = \bar b_i - t\bar a_{ij}. Those with aˉij≤0\bar a_{ij}\le0 never decrease. The first to hit zero as tt grows is arg⁡min⁡aˉij>0bˉi/aˉij\arg\min_{\bar a_{ij} > 0}\bar b_i/\bar a_{ij}. Stopping there keeps every variable non-negative. If no aˉij>0\bar a_{ij} > 0, the LP is unbounded. ∎

LP as an SDP

Ax≤bAx\le b is equivalent to diag⁡(b−Ax)⪰0\operatorname{diag}(b - Ax)\succeq0, since a diagonal matrix is PSD iff its entries are non-negative. Likewise ∥u∥≤t\|u\|\le t iff [tIuu⊤t]⪰0\begin{bmatrix}tI & u\\ u^\top & t\end{bmatrix}\succeq0 (Schur complement). So SOCP ⊂ SDP. ∎

Uniqueness for strictly convex QPs

If Q≻0Q\succ0, the objective is strictly convex. Two distinct minimizers x1,x2x_1, x_2 would give f(x1+x22)<12(f(x1)+f(x2))=p⋆f(\frac{x_1 + x_2}2) < \frac12(f(x_1) + f(x_2)) = p^\star, and the midpoint is feasible (the set is convex). That’s a contradiction. ∎

Exercise 3.1: How many basic solutions must vertex enumeration check for 3 variables and 4 constraints?

With slacks there are 7 variables and 4 equations, so (74)=35\binom74 = 35 candidate bases. That’s equivalent to choosing 3 tight constraints out of the 7 inequalities (including x≥0x\ge0). Simplex visits only a few.

📝 Quick check (Level 3)
0/3 answered
  1. 1. If no entry of the entering column is positive, the LP is…
  2. 2. ‖u‖ ≤ t is equivalent to an LMI via…
  3. 3. A QP with Q ≻ 0 has…

Level 4: Expert

★★★★★ Expert⏱ 40 minResearchers: original papers and open problems.

MPC for a double integrator with thrust limits

A spacecraft or rover axis behaves like a double integrator p¨=u\ddot p = u with ∣u∣≤1|u|\le1. Starting 5 m from the target at rest, MPC over a 20-step horizon minimizes position and velocity error plus control effort. The optimal plan saturates (full braking thrust) for the first 10 steps, then tapers. Clipping the unconstrained LQ solution gives a much worse cost. Projected gradient on the condensed QP converges, and the box KKT conditions certify the result.

🐍 Exercise 2 (research): an MPC QP with input limits
Condense a double-integrator MPC into a box-constrained QP. Solve it by projected gradient, compare with clipped LQ, and verify the KKT conditions.

LP/QP/SOCP/SDP in AI, robotics and aerospace

  • Powered-descent guidance is an SOCP solved on board in under a second (Açıkmeşe and Ploen, 2007; Blackmore, Açıkmeşe and Scharf, 2010).
  • Linear MPC for quadrotors, legged robots and spacecraft rendezvous solves QPs at 100–1000 Hz (OSQP, qpOASES; Ferreau et al., 2014).
  • SDP relaxations certify SLAM and rotation averaging (Rosen et al., 2019), and they power robust control and Lyapunov analysis (Boyd et al., 1994, LMIs in System and Control Theory).
  • Scheduling of the Deep Space Network and telescope time uses LP/MILP.

References

  1. G. Dantzig (1963). Linear Programming and Extensions. Princeton University Press.
  2. V. Klee, G. Minty (1972). “How good is the simplex algorithm?” In Inequalities III, Academic Press.
  3. N. Karmarkar (1984). “A new polynomial-time algorithm for linear programming.” Combinatorica, 4.
  4. Y. Nesterov, A. Nemirovski (1994). Interior-Point Polynomial Algorithms in Convex Programming. SIAM.
  5. D. Spielman, S.-H. Teng (2004). “Smoothed analysis of algorithms: why the simplex algorithm usually takes polynomial time.” JACM, 51(3).
  6. S. Boyd, L. El Ghaoui, E. Feron, V. Balakrishnan (1994). Linear Matrix Inequalities in System and Control Theory. SIAM.
  7. L. Vandenberghe, S. Boyd (1996). “Semidefinite programming.” SIAM Review, 38(1).
  8. L. Blackmore, B. Açıkmeşe, D. Scharf (2010). “Minimum-landing-error powered-descent guidance for Mars landing using convex optimization.” Journal of Guidance, Control, and Dynamics, 33(4).
  9. H. J. Ferreau, C. Kirches, A. Potschka, H. G. Bock, M. Diehl (2014). “qpOASES: a parametric active-set algorithm for quadratic programming.” Mathematical Programming Computation, 6.
  10. J. Rawlings, D. Mayne, M. Diehl (2017). Model Predictive Control: Theory, Computation, and Design, 2nd ed. Nob Hill.