AI Glossary / Mathematics and optimization / Intermediate
Karush-Kuhn-Tucker conditions
Definition
The Karush-Kuhn-Tucker conditions, or KKT conditions, are equations and inequalities that characterize certain solutions of constrained optimization problems. They combine feasibility, nonnegative inequality multipliers, stationarity of the Lagrangian, and complementary slackness. Under appropriate assumptions they are necessary at an optimum; for differentiable convex problems in standard form, satisfying them is sufficient for global optimality.
What it means
An unconstrained differentiable optimum is often sought where the objective gradient vanishes. A constraint changes that picture: an optimum may lie on a boundary where the objective would improve if movement outside the allowed region were permitted.
KKT conditions balance the objective's gradient with gradients of active constraints using multipliers. The result explains why a nonzero objective gradient can coexist with constrained optimality. The conditions belong to a mathematical problem with specified signs and domains; they are not a universal checklist that certifies any candidate returned by a numerical optimizer.
How it works
For minimizing f(x) subject to g_i(x)≤0 and h_j(x)=0, form L=f+sum_i lambda_i g_i+sum_j nu_j h_j. Primal feasibility requires the original constraints. Dual feasibility requires lambda_i≥0; equality multipliers nu_j are unrestricted in sign. Stationarity requires the gradient of L with respect to x to vanish. Complementary slackness requires lambda_i g_i(x)=0 for every inequality.
For differentiable convex f and g_i with affine equalities, a feasible KKT point is globally optimal. Constraint qualifications, such as suitable Slater conditions in convex settings, help ensure multipliers exist at an optimum. Outside convex settings, KKT conditions alone need not establish a minimum.
Three practical examples
- A resource-allocation model can use KKT multipliers to analyze which capacity constraints are active at a proposed solution.
- A constrained learning problem can use stationarity and feasibility residuals to assess whether a numerical result approximately satisfies its optimality conditions.
- An analyst can derive a small optimization model's solution and distinguish a boundary optimum from an unconstrained stationary point.
Think of it this way
Think of moving downhill until a boundary prevents further improvement. The objective pushes one way, while a boundary can supply an opposing force. The analogy is limited: multipliers are mathematical coefficients, not physical forces, and balancing them does not prove global optimality without the relevant structure and assumptions.
Worked example
Consider an original scalar problem: minimize f(x)=(x−5)^2 subject to 0≤x≤3. Write the inequalities as g_1=x−3≤0 and g_2=−x≤0. The Lagrangian is (x−5)^2+lambda_1(x−3)−lambda_2 x.
At x=3, the upper constraint is active and the lower constraint is strictly satisfied. Complementary slackness therefore requires lambda_2=0. Stationarity becomes 2(3−5)+lambda_1−lambda_2=0, giving lambda_1=4. Both multipliers are nonnegative, feasibility holds, and both complementary products are zero. Because the objective is convex and constraints are affine, this KKT point is a global minimum, with objective value 4.
For a direct check, every feasible x is at most 3, so its distance from 5 is at least 2. Squaring gives an objective at least 4. This independently confirms the result.
An active constraint does not necessarily have a positive multiplier. Minimize x² subject to −x≤0. At x=0 the constraint is active, but stationarity 2x−lambda=0 gives lambda=0. Complementary slackness permits this.
Finally, consider minimizing x subject to x²≤0. Its only feasible point is x=0, so that point is optimal. Yet stationarity would require 1+lambda times 2x=0, which is impossible at zero. The constraint gradient vanishes there, and the usual qualification fails. This demonstrates why necessity claims need assumptions: an optimum can exist without KKT multipliers for a badly behaved constraint representation.
Illustrative case study
In a fictional example, Juniper Planning checks a constrained allocation model. Its report marks every active limit as economically valuable because it assumes active means positive multiplier. A reviewer constructs the zero-multiplier boundary example and shows that the inference is too strong.
The team revises the report to distinguish active constraints, positive multipliers, and sensitivity claims that need additional regularity. This invented case illustrates careful interpretation of optimization diagnostics; it does not assign real monetary values to the example's multipliers.
Common misconceptions and mistakes
Complementary slackness says a strictly inactive inequality has zero multiplier, and a positive multiplier requires an active inequality. It does not say every active inequality must have a positive multiplier.
Sign conventions matter. If constraints are written with the opposite inequality direction, the Lagrangian or multiplier-sign convention must change consistently. Mixing conventions can turn an incorrect calculation into an apparently valid one.
KKT stationarity does not alone distinguish minima from maxima or saddles in nonconvex problems. With no constraints, minimizing −x² has a stationary point at zero, which is a maximum rather than a minimum. Approximate KKT residuals also need tolerances and scaling appropriate to the problem.
Business use
KKT conditions can make an optimization result easier to audit. A useful report separates constraint violations, stationarity residuals, multiplier signs, and complementary products instead of compressing them into an unexplained success label.
Multipliers can inform local sensitivity analysis under suitable assumptions, but their units depend on the objective and constraint scaling. Rescaling a constraint can change its multiplier without changing the feasible decisions. Business interpretations should therefore identify the precise perturbation being considered and test whether a small-change approximation remains appropriate. The mathematical model's optimum still depends on whether its objectives and constraints represent the actual decision.
People also ask
Are KKT conditions an optimization algorithm?
No. Algorithms may seek points satisfying them, but the conditions themselves characterize candidate solutions.
Do KKT conditions always prove a global minimum?
No. Convexity and the standard structural assumptions provide the sufficiency result described here.
Are equality multipliers nonnegative?
Not in the stated convention. Equality multipliers may have either sign.
Check your understanding
An inequality satisfies g_i(x)<0 at a KKT point. What must its multiplier be?
Answer: Zero, because complementary slackness requires lambda_i g_i(x)=0 and g_i(x) is nonzero.
Related terms
- Constrained optimization
- Lagrangian
- Stationarity
- Convex optimization
- complementary slackness
- dual feasibility
- Slater condition
- active constraint
- duality
Learn next
Change the worked upper bound from 3 to a number below 5 and derive the optimizer and upper-bound multiplier. Then rescale the same constraint by a positive factor and check how the multiplier changes while the feasible set and optimizer stay the same.
More in Mathematics and optimization
- Absolute error loss - Absolute error loss measures a numerical prediction's error as the absolute difference between its predicted and reference values: L(y,y-hat)=|y-y-hat|.
- Active-set method - An active-set method is an optimization approach that works with a changing subset of constraints believed to be tight at the solution.
- Adjoint state method - The adjoint state method computes how a chosen objective changes when the parameters of a mathematical model change.
- Σ-algebra
- Algebraic connectivity - Algebraic connectivity is the second-smallest eigenvalue of a graph's Laplacian matrix.
- Algorithm IMED - Algorithm IMED, short for Indexed Minimum Empirical Divergence, is a method for choosing actions in a stochastic multi-armed bandit problem.
Sources
Primary teaching source: Boyd, Vandenberghe, and Nobel, Convex Optimization slides, KKT conditions and convex sufficiency: https://web.stanford.edu/~boyd/cvxbook/bv_cvxslides.pdf . The source-list Aalto entry was also consulted. The scalar examples and direct optimality check above are original.
Previous: Karmarkar's algorithm Next: Keepout