Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.A tug of war that balances
At the best allowed point, two kinds of forces balance. The objective pulls toward lower cost. Each wall you’re pressing against pushes back, straight out from the wall. A wall you aren’t touching doesn’t push at all. And walls can only push, never pull.
Those four common-sense facts are the KKT conditions: forces balance, you’re inside the walls, walls only push, and only walls you touch push.
Every QP and NLP solver in robotics and aerospace (OSQP for MPC, IPOPT for trajectory optimization, SNOPT for mission design) is built to satisfy the KKT conditions. The multipliers they return say which constraints bind and how much each costs. That’s exactly what an engineer needs to decide which limit to relax.
- 1. A constraint you aren't touching pushes…
- 2. Walls (inequality constraints) can only…
- 3. At the optimum, the objective's pull is…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.The four conditions
For s.t. , , a point with multipliers satisfies KKT if:
- Stationarity: .
- Primal feasibility: and .
- Dual feasibility: .
- Complementary slackness: for each .
1-D example
s.t. :
- Stationarity: .
- If , then , which is infeasible.
- So the constraint is active: and . ✓
- 1. Complementary slackness says…
- 2. min (x − 3)² s.t. x ≤ 2: λ* =
- 3. Multipliers of equality constraints must be…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.When are KKT conditions necessary or sufficient?
- Convex problems: KKT is sufficient. If Slater holds, it’s also necessary, and the KKT multipliers are exactly the dual optimal solution (A6.2-4).
- General smooth problems: at a local minimum, KKT multipliers exist if a constraint qualification holds, for example LICQ (the active constraint gradients are linearly independent). Without one, they may not exist. Second-order conditions on the Lagrangian Hessian then classify the point.
Solving with KKT
- Small problems: guess which constraints are active, solve the resulting equations, and check and feasibility. Active-set methods do this systematically.
- Interior-point methods relax complementary slackness to and drive with Newton steps.
- Closed forms: for one linear constraint, s.t. gives . That’s the control-barrier-function filter.
Multipliers as shadow prices
At the optimum, for constraint . A large multiplier means that constraint is expensive. An engineer might buy more battery, actuator authority or margin there.
- 1. For a convex problem, a KKT point is…
- 2. LICQ requires the active constraint gradients to be…
- 3. Interior-point methods replace λᵢgᵢ = 0 by…
Level 3: Advanced
★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.Proof: KKT is sufficient for convex problems
With , the Lagrangian is convex in (the are affine), and stationarity says minimizes it. For any feasible :
The first inequality holds because and . The last equality is complementary slackness. ∎
Why must λ be non-negative?
At , stationarity is . If some active , moving slightly into the interior along would stay feasible and decrease , contradicting optimality. Geometrically, must lie in the cone of outward normals (A6.2-3).
The CBF filter from KKT
. Stationarity gives . If the constraint is inactive, . If active, gives . Combining: . ∎
Exercise 3.1: min x² + y² s.t. x + y ≥ 2
Write it as . Stationarity: and , so . Active: , , .
- 1. The sufficiency proof uses that x* minimizes…
- 2. A negative multiplier on an active constraint would mean…
- 3. min x² + y² s.t. x + y ≥ 2 gives λ* =
Level 4: Expert
★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.A safety filter that is pure KKT
A mobile robot follows a nominal controller straight toward its goal, through an obstacle. A control barrier function defines the safe set . Requiring gives a linear constraint on the control at each instant. The safety filter solves subject to that constraint. KKT gives it in closed form. The robot slides around the obstacle, the constraint is active only nearby, and complementary slackness holds at every step.
KKT in AI, robotics and aerospace
- Control barrier functions for collision avoidance on drones, legged robots and cars (Ames et al., 2017, 2019).
- MPC and trajectory optimization solvers are built around the KKT system: OSQP (ADMM on the KKT system), IPOPT and SNOPT.
- SVM support vectors are exactly the data points with positive KKT multipliers (complementary slackness).
- Contact mechanics in robotics simulation: non-penetration and Coulomb friction are complementarity conditions (LCPs; Stewart and Trinkle, 1996).
References
- W. Karush (1939). “Minima of functions of several variables with inequalities as side conditions.” MSc thesis, University of Chicago.
- H. Kuhn, A. Tucker (1951). “Nonlinear programming.” Proc. 2nd Berkeley Symposium.
- S. Boyd, L. Vandenberghe (2004). Convex Optimization. Cambridge University Press. §5.5.
- J. Nocedal, S. Wright (2006). Numerical Optimization, 2nd ed. Springer. Ch. 12, 16, 19.
- A. Ames, X. Xu, J. Grizzle, P. Tabuada (2017). “Control barrier function based quadratic programs for safety critical systems.” IEEE Transactions on Automatic Control, 62(8).
- A. Ames et al. (2019). “Control barrier functions: theory and applications.” European Control Conference.
- B. Stellato et al. (2020). “OSQP: an operator splitting solver for quadratic programs.” Mathematical Programming Computation, 12.
- D. Stewart, J. Trinkle (1996). “An implicit time-stepping scheme for rigid body dynamics with inelastic collisions and Coulomb friction.” International Journal for Numerical Methods in Engineering, 39.
- C. Cortes, V. Vapnik (1995). “Support-vector networks.” Machine Learning, 20.
- A. Wächter, L. Biegler (2006). “On the implementation of an interior-point filter line-search algorithm for large-scale nonlinear programming.” Mathematical Programming, 106.