Constrained Optimization

Lagrange multipliers and KKT conditions

Constrained Optimization

In constrained optimization, we seek the best value of an objective function subject to constraints. Lagrange multipliers handle equality constraints by finding points where the objective's gradient is parallel to the constraint's gradient. The KKT conditions generalize this to inequality constraints.

Lagrange Multipliers (2D)

At the constrained optimum, the level curve of the objective is tangent to the constraint curve. This means ∇f = λ∇g: the gradients are parallel. Slide along the constraint to find where this happens.

Slide a point along the constraint (white curve). At the constrained optimum, the gradients of f (∇f) and g (∇g) become parallel, satisfying ∇f = λ∇g.

Key insight: The Lagrange multiplier λ measures the rate of change of the optimal value with respect to the constraint. It is the "shadow price" of relaxing the constraint.

Lagrange Multipliers (3D View)

Visualize the objective function restricted to the constraint. As a point travels along the constraint curve, the objective value rises and falls. The constrained optimum is the peak (or trough) of this restricted function.

Left: the constraint circle with a moving point. Right: the value of f restricted to the constraint, plotted against angle. The maximum (√2 at θ=π/4) and minimum (-√2 at θ=5π/4) are the constrained optima where ∇f = λ∇g.

Key insight: The method of Lagrange multipliers converts a constrained problem into an unconstrained one by introducing auxiliary variables, one for each constraint.

KKT Conditions

The Karush-Kuhn-Tucker conditions extend Lagrange multipliers to inequality constraints. At the optimum, each constraint is either active (binding) or inactive, and complementary slackness says λ·g = 0 for each constraint.

011223344xyx+2y=4x+y=3optimum (2, 1)f = -3-∇fKKT Conditions: min -x-y, feasible region

Constraints at optimum (2, 1)

g₁: x + 2y ≤ 4[active] λ=0
g₂: x + y ≤ 3[active] λ=1
g₃: x ≥ 0[inactive] λ=0
g₄: y ≥ 0[inactive] λ=0

KKT Conditions

Stationarity
∇f + λ₁∇g₁ + λ₂∇g₂ = 0 → (-1,-1) + 0·(1,2) + 1·(1,1) = (0,0)
Primal feasibility
gᵢ(x*) ≤ 0 for all i → all constraints satisfied at (2,1)
Dual feasibility
λᵢ ≥ 0 for all i → λ = [0, 1, 0, 0] ≥ 0
Complementary slackness
λᵢ gᵢ(x*) = 0 for all i → only λ₂=1 is nonzero, and g₂=0 (active)

The KKT conditions are necessary for optimality in constrained optimization with inequality constraints. At the optimum, active constraints (on the boundary) can have positive multipliers, while inactive constraints must have zero multipliers (complementary slackness).

Key insight: KKT conditions are necessary for optimality in convex problems and sufficient under constraint qualifications. They are the foundation of all constrained optimization algorithms.

Key Takeaways

  • At a constrained optimum, ∇f is parallel to ∇g (Lagrange condition).
  • The multiplier λ is the shadow price of the constraint.
  • KKT conditions handle inequalities via complementary slackness: λ·g = 0.