Constrained Optimization
From Theory to Algorithms
This page covers the formulation of constrained optimization problems, the theory of duality, the Karush-Kuhn-Tucker (KKT) conditions, and practical algorithms like Linear Programming and ADMM.
Based on the course "Constrained optimization" by Pr. Pierre Hellier (Université de Rennes / Inria).
1. Problem Formulation
Constrained optimization involves minimizing a loss function while satisfying specific equality and inequality requirements.
General Form
The standard problem is phrased as finding such that:
- : The objective (loss) function.
- : Equality constraints (e.g., physical laws, conservation of mass).
- : Inequality constraints (e.g., resource limits, non-negativity).
Common Applications
| Domain | Problem Type | Constraint Example |
|---|---|---|
| Machine Learning | Support Vector Machines (SVM) | (margin constraint) |
| Statistics | Sparse Regression (Lasso) | (sparsity constraint) |
| Logistics | Optimal Transport | Supply Factory limit; Demand Store need |
2. Duality and KKT Conditions
To solve constrained problems, we often convert them into unconstrained "dual" problems using Lagrange multipliers.
The Lagrangian
We define the Lagrangian function by adding weighted constraints to the objective:
- : Dual variables (multipliers) for inequality constraints.
- : Dual variables for equality constraints (no sign restriction).
The Dual Problem
The dual function is the minimum of the Lagrangian with respect to :
Weak Duality: The dual solution is always a lower bound for the primal solution (). Strong Duality: The duality gap is zero (). This holds for convex problems that satisfy Slater's condition (existence of a strictly feasible point).
Karush-Kuhn-Tucker (KKT) Conditions
For a solution to be optimal (under strong duality), it must satisfy the KKT conditions. These are necessary (and for convex problems, sufficient).
Stationarity: The forces must balance.
Primal Feasibility: The solution must be valid.
Dual Feasibility: Inequality multipliers must be non-negative.
Complementary Slackness: You only "pay" for active constraints.
(Either the constraint is active , or the multiplier is .)
3. Linear Programming (LP)
Linear programming is a specific class of problems where the objective and all constraints are linear.
LP Formulation
The feasible region defines a polytope (a multi-dimensional polygon).
If an LP problem has a unique optimal solution, that solution is always a vertex of the polytope.
View Solvers for LP
Simplex Method: Moves along the edges of the polytope from vertex to vertex until the optimum is found. Efficient in practice but exponential worst-case complexity.
Interior Point Methods: Traverses the interior of the feasible set using a "barrier function" (e.g., Log-barrier) that penalizes getting too close to the boundaries.
4. ADMM
Alternating Direction Method of Multipliers
For large-scale or distributed problems, we use ADMM. It combines the decomposability of dual ascent with the robustness of multipliers.
Problem Form
Minimize a separable objective:
Augmented Lagrangian
ADMM adds a quadratic penalty term () to the standard Lagrangian to ensure stability:
The Algorithm
ADMM solves the problem by updating , , and sequentially:
-
x-update: Minimize w.r.t (often done in parallel).
-
z-update: Minimize w.r.t .
-
Dual-update: Update the price/dual variable based on the residual.
It is extremely robust and allows for decentralized optimization. For example, in a market exchange problem, agents can optimize their own objectives locally (-update), while a central authority updates prices based on supply and demand (-update).