Second-Order Cone Programming
A step up from linear programming that lets constraints and objectives involve a length or a risk term shaped like a distance — exactly the shape a portfolio's volatility constraint naturally has.
Prerequisites: Linear Programming and the Simplex Method, Convex Sets and Convex Functions
A linear program can cap a portfolio's total capital or any single position's size, but it cannot naturally express "keep the portfolio's volatility under 10%" — volatility involves a square root of a sum of squares, which is not a straight-line relationship no matter how you slice it. Second-order cone programming (SOCP) is exactly the extension of linear programming built to handle constraints and objectives shaped like a length or distance — a Euclidean norm — while staying just as tractable to solve reliably and fast. It's the natural home for risk-constrained portfolio optimization, robust optimization under uncertainty, and any problem where "keep some vector's size under control" is a real constraint.
The analogy: capping how far you can wander, not just where
A linear constraint is like a set of straight fences: don't cross this line, don't cross that one. A second-order cone constraint is different — it's like being tied to a stake by a rope of fixed length: you can move in any direction, but your total distance from the stake (measured the ordinary way, as a straight-line distance, not city-block distance) can't exceed some limit. That "distance from a stake" shape — a norm — is precisely the geometry of an ice-cream cone in higher dimensions, which is where the name comes from: the constraint traces out a cone-shaped region.
The mechanics, one symbol at a time
A second-order cone constraint takes the form
where denotes the ordinary Euclidean norm (length) of a vector. In words: the length of some linear combination of the decision variables must stay below some other linear combination of them — a "budget" for how big a certain vector quantity is allowed to get, expressed through a square root of a sum of squares rather than a plain straight-line bound.
A key example: a portfolio variance constraint (weights , covariance matrix , volatility cap ) can be rewritten, using (a Cholesky factorization), as
exactly a second-order cone constraint. In plain English: instead of capping variance directly (a quadratic, awkward form), you cap the length of a transformed weight vector — same constraint, geometrically cleaner, and solvable by the same efficient algorithms used for linear programs (interior-point methods), because SOCP retains the crucial convexity property that makes those solvers reliable.
Worked example 1: a volatility-capped two-asset portfolio
Two assets have volatilities , uncorrelated (), so and . Cap portfolio volatility at with weights . The SOCP constraint is . Try : — feasible, with headroom. Try : — infeasible, breaching the volatility cap.
Worked example 2: comparing to a naive linear cap
A tempting shortcut is capping each weight's contribution linearly, e.g. . At : — this linear proxy also flags infeasibility here, but the two constraints don't agree in general. At : the linear proxy gives (flagged infeasible), while the true SOCP volatility is — actually feasible. The linear shortcut is systematically too conservative because it ignores diversification (the square-root-of-sum-of-squares shrinks total risk below the sum of individual risks); only the genuine SOCP constraint captures that correctly.
A norm constraint like traces a circle (or, in the general linear-combination form above, a tilted ellipse) rather than a straight boundary — picture the boundary curving smoothly rather than kinking at corners, which is exactly what separates a cone constraint from a linear one.
What this means in practice
SOCP is the standard formulation for volatility-constrained and risk-parity-flavored portfolio optimization, robust optimization (where uncertainty in expected returns is itself modeled as a norm ball), and any problem needing a "keep this vector's size bounded" constraint alongside otherwise linear objectives and constraints. Because it remains convex, SOCP inherits the reliable global-optimality guarantees and fast interior-point solvers of linear programming, unlike general nonconvex quadratic problems.
Second-order cone programming extends linear programming to allow constraints shaped like a Euclidean length — most importantly, a volatility or risk-budget constraint — while remaining convex and just as solvable via interior-point methods.
The common mistake is approximating a genuine norm (volatility) constraint with a linear proxy — like capping the sum of absolute risk contributions instead of the true portfolio volatility — because it seems simpler to set up. As the second worked example shows, this proxy is neither exactly right nor uniformly conservative in a useful sense: it ignores diversification and can reject perfectly good portfolios while occasionally still needing careful checking near the boundary. If the actual risk measure is a norm, formulate it as one.
Related concepts
Practice in interviews
Further reading
- Boyd & Vandenberghe, Convex Optimization, ch. 4.4
- Alizadeh & Goldfarb, Second-Order Cone Programming (survey), 2003