- Introduced by
- Stephen Boyd & Lieven Vandenberghe
- Year
- 2004
- Type
- Mathematical optimization framework
- Family
- Mathematical programming
What does it do?
Convex optimization is the branch of mathematical optimization that minimizes a convex objective function over a convex feasible set.
Stephen Boyd and Lieven Vandenberghe presented and popularized the framework in their 2004 textbook, which brings linear, quadratic, semidefinite and second-order cone programming under one theory, although its foundations in convex analysis predate the book. Its defining property is that any locally optimal solution is also globally optimal, which makes these problems reliable to solve in engineering, statistics, machine learning and operations research.
The intuition behind the method
Imagine a bowl-shaped valley: a ball released anywhere on its slopes settles at the same lowest point. In convex optimization the objective plays the role of the bowl and the feasible set is a convex region, so a descent method that stops where no feasible move improves is already at the global minimum. A convex function has no hidden local dips, and this is what separates convex problems from general nonlinear ones, where a method can stop in a local minimum that is not the best solution.
History
Convex analysis has roots in the work of Minkowski and Farkas in the early twentieth century, and linear programming emerged in the 1940s through Dantzig. Interior-point methods, introduced by Karmarkar in 1984 and developed through the 1990s, made general convex programs computationally practical. Boyd and Vandenberghe's 2004 Cambridge University Press textbook gathered these results into a single framework for convex programs. The disciplined convex programming rules and the modelling tools CVX and CVXPY were developed in later work and are not part of the content of the 2004 text.
When to use it
Choose convex optimization when the objective and every constraint are convex, or can be reformulated as convex without changing the problem of interest. Typical fits include portfolio optimization, regularized regression, network flow, support vector machines and control design. Do not apply it to the original problem when integer or combinatorial decisions are essential, or when the nonconvexity is intrinsic to the model, because the global-optimum guarantee then does not hold. In those cases a convex relaxation or a local nonlinear solver may be considered, with its approximation stated explicitly. If the problem is linear, a dedicated linear programming solver is usually more efficient.
Limitations and considerations
- Applicability depends on whether the problem can be posed, or accurately approximated, in convex form; many real-world problems are inherently nonconvex.
- Interior-point methods form and factor large linear systems at each iteration, so memory and time requirements grow quickly with problem dimension.
- Convex relaxations of integer or combinatorial problems can return fractional solutions that need rounding or branching before they are usable.
- An incorrect convexity claim removes the optimality guarantee silently: the solver still returns a point, which may not be optimal for the intended problem.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- If the problem is convex, every local optimum is global, so the solver cannot end at a poor local minimum.
- Interior-point methods have polynomial-time complexity guarantees for standard convex classes, which is a practical reason they scale to large problems.
- Duality provides optimality certificates and dual variables that measure how the optimum responds to changes in the constraints.
- Disciplined convex programming rules let modelling tools check convexity and transform the problem into a form the solver accepts.
Applications
- Portfolio optimization, for example minimizing variance or CVaR subject to return targets and allocation constraints.
- Machine learning, for example training support vector machines or fitting lasso, ridge or logistic regression, which are standard convex programs.
- Signal and image processing, for example compressed sensing, total-variation denoising and sparse recovery, which are commonly posed as convex programs.
- Network and resource allocation, for example optimal routing, power control in wireless networks and bandwidth allocation under capacity constraints.
- Control systems, for example semidefinite programming-based synthesis of H-infinity controllers and Lyapunov stability verification.
How it works
How it works
The analyst writes the decision problem in standard form: minimize a convex objective f0(x) subject to convex inequality constraints fi(x) ≤ 0 and affine equality constraints Ax = b. This step decides whether the guarantees apply at all, because the choice of variables and the way each constraint is written determine whether the convex structure is preserved.
Formula
\min_{x \in \mathcal{C}} f_0(x) \quad \text{s.t.} \quad f_i(x) \leq 0,\; i=1,\ldots,m,\; Ax = bEvery objective and constraint function must be shown to be convex, either by checking the defining inequality with a weight θ between 0 and 1 over the function's domain, or by building the function from known convex pieces with convexity-preserving composition rules. Disciplined convex programming (DCP) rules, implemented in modelling tools such as CVX and CVXPY, check this composition structure automatically, so the analyst does not have to prove convexity from scratch for each function. A function that fails the check invalidates the guarantees, even though the solver may still return a point.
Formula
f(\theta x + (1-\theta)y) \leq \theta f(x) + (1-\theta)f(y), \quad \forall x,y \in \text{dom}\,f,\; \theta \in [0,1]The Lagrangian L(x, λ, ν) relaxes the constraints using multipliers λ ≥ 0 for the inequalities and ν for the equalities. Under Slater's constraint qualification, strong duality holds and the primal and dual optima coincide. In that case the KKT conditions (stationarity, primal and dual feasibility, and complementary slackness) are necessary for optimality, and for a convex problem they are sufficient even without that qualification. The dual variables also indicate how sensitive the optimum is to changes in the constraints.
Formula
L(x,\lambda,\nu) = f_0(x) + \sum_{i=1}^{m}\lambda_i f_i(x) + \nu^T(Ax-b), \quad \lambda_i \geq 0The update shown in the mechanics step is a plain gradient step, x(k+1) = x(k) − t_k ∇f0(x(k)) with t_k > 0. It applies to smooth unconstrained problems only and illustrates how the step size t_k controls progress; it is not the solution method for constrained convex programs. Constrained problems are usually solved with interior-point methods, the standard choice for general convex programs, while proximal or ADMM-type first-order methods are used when problems are very large or structured.
Formula
x^{(k+1)} = x^{(k)} - t_k \nabla f_0(x^{(k)}), \quad t_k > 0Common pitfalls
- Assuming convexity without checking the composition rules; inspecting the shape of the objective by eye is not a proof.
- Neglecting conditioning: badly scaled data can make the solver report inaccurate or infeasible results even when the problem is feasible in theory.
- Using the KKT conditions as an optimality test without first confirming that the problem is convex. For convex problems the KKT conditions are sufficient for optimality; for nonconvex problems they are not, and their necessity requires a constraint qualification such as Slater's condition.
- Reporting the solution of a relaxed problem as the solution of the original one after integer or combinatorial constraints were dropped.
Frequently asked questions
How do I know whether my problem is convex?
Check whether the objective function and each constraint function satisfy the convexity inequality with a weight θ between 0 and 1, or verify convexity with the disciplined convex programming rules. Those rules check that every function is built from known convex primitives combined by convexity-preserving composition rules, such as a non-decreasing convex outer function applied to convex inner functions. Boyd and Vandenberghe's Chapter 3 provides an extensive catalog of convex functions.
What is the difference between convex optimization and linear programming?
Linear programming is the special case in which the objective and all constraints are affine (linear) functions. Convex optimization covers that case and also quadratic, second-order cone and semidefinite programs. The simplex method is specific to linear programs, while interior-point and first-order methods handle the wider convex class.
Can convex optimization handle integer or binary variables?
Not directly, because integer constraints make a problem combinatorially hard and generally nonconvex. A common approach is to solve the convex relaxation (dropping integrality) to obtain a lower bound, then apply branch-and-bound or rounding. Convex mixed-integer programming solvers combine these ideas, but the global-optimum guarantee of pure convex optimization no longer applies in full generality.
Related methods
Sources
Boyd, S., & Vandenberghe, L. (2004). Convex Optimization. Cambridge University Press.
ISBN: 978-0-521-83378-3Mathematic for Machine Learning (Deisenroth, Faisal & Ong), Section 7.3 'Convex Optimization', p. 236