Constrained Optimization and Lagrange Multipliers
Continuous Optimization
Real optimization problems often come with constraints: minimize f(mathbf{x}) subject to g_i(mathbf{x}) = 0 (equality) or h_j(mathbf{x}) leq 0 (inequality). Constraints restrict the feasible region, and the unconstrained optimum may lie outside it. The minimum on the feasible set may be anywhere — i
Lagrangian converts equality-constrained problems to unconstrained stationary-point problems.
No constrained optimization → no SVMs, no portfolio optimization, no LP/QP/SDP-based ML algorithms.
Real optimization problems often come with constraints: minimize subject to (equality) or (inequality). Constraints restrict the feasible region, and the unconstrained optimum may lie outside it. The minimum on the feasible set may be anywhere — interior, on the boundary of one constraint, or at the intersection of several.
For equality constraints , the Lagrange multiplier technique reduces the constrained problem to an unconstrained one. Form the Lagrangian and find stationary points: and . Geometrically, at the optimum, is parallel to — you can't reduce without violating the constraint.
For inequality constraints , we get the Karush–Kuhn–Tucker (KKT) conditions: stationarity , primal feasibility , dual feasibility , and complementary slackness (each constraint is either tight () or has zero multiplier). The multipliers have an interpretation as 'shadow prices' — the rate of change of the optimal value as the constraint is relaxed.
Every constrained problem has a dual problem: . Weak duality holds always: the dual objective lower-bounds the primal. Strong duality — equality between primal and dual optima — holds for convex problems under mild conditions. The dual is often easier to solve, and it exposes beautiful structure in many problems (SVMs are the textbook example).
In ML, constrained optimization is everywhere. SVMs solve a quadratic program with margin constraints, and their dual is where the kernel trick appears. Trust region methods use inequality constraints on step size. Proximal methods and ADMM solve constrained variants of common losses. Even fairness-aware learning and safe RL cast requirements as constraints. Knowing Lagrangians is knowing how to reason about 'what I want, subject to what I must'.
Worked example — inequality via KKT: Minimize subject to . Without the constraint the optimum is , but that's infeasible. KKT: stationarity , feasibility , slackness . Set (active constraint), giving . The shadow price says relaxing the bound by improves the objective by .
Exercises
Put your understanding to the test. Score + streak + speed all count.
Confirm you've got it
3 quick questions. Get 2 right to mark this lesson complete.