skip to content

What do the KKT conditions require at the optimum of an inequality-constrained problem?

level: seniorimportance: must knowfreq 48%

answer

  1. four conditions, not just one
  2. feasible and stationary at the same time
  3. inequality multipliers cannot go negative
  4. either it binds or its price is zero
  5. necessary only under a constraint qualification

basics

~20 s

For minimizing f subject to g(x) <= 0 and h(x) = 0, the KKT conditions require stationarity of the Lagrangian, primal feasibility, nonnegative multipliers on the inequalities, and complementary slackness - every inequality's multiplier times its constraint value is zero.

solid answer

~50 s

For `minimize f(x)` subject to `g_i(x) <= 0` and `h_j(x) = 0`, form `L = f + sum_i mu_i*g_i + sum_j lambda_j*h_j`. KKT is four conditions holding together at the optimum. **Stationarity**: the gradient of `L` in `x` is zero. **Primal feasibility**: every `g_i(x) <= 0` and `h_j(x) = 0`. **Dual feasibility**: every `mu_i >= 0`. **Complementary slackness**: `mu_i * g_i(x) = 0` for every `i`, so each inequality is either active (`g_i = 0`, and its multiplier may be positive) or slack (`g_i < 0`, forcing `mu_i = 0`). The intuition is that a constraint you are not pressed against costs nothing. These conditions are necessary at a local minimum only under a constraint qualification, and they become sufficient for a global minimum when the problem is convex and something like Slater's condition holds.

go deeper

for a junior

Learn the vocabulary first: active versus slack constraints, and the fact that a constraint you are not pressed against carries a multiplier of zero. Reciting the four condition names is a reasonable target.

for a middle

State all four conditions precisely with a consistent sign convention, and explain the case split complementary slackness forces on each inequality.

for a senior

Use KKT as a diagnostic on a reported solution - check feasibility, multiplier signs and slackness arithmetically - and explain which constraints are actually shaping the answer.

for a principal

Judge when to insist on a convex formulation so KKT certifies global optimality, and what to accept when the real problem is nonconvex and only candidate points are available.

## The setup KKT - Karush-Kuhn-Tucker - generalizes Lagrange multipliers from equalities to inequalities. Fix the standard form: `minimize f(x) subject to g_i(x) <= 0 for i = 1..m, and h_j(x) = 0 for j = 1..p` Every inequality is written with zero on the right, and the Lagrangian carries one multiplier per constraint: `L(x, mu, lambda) = f(x) + sum_i mu_i * g_i(x) + sum_j lambda_j * h_j(x)` ## The four conditions **1. Stationarity.** The gradient of `L` with respect to `x` vanishes: `grad f + sum_i mu_i * grad g_i + sum_j lambda_j * grad h_j = 0`. The objective's downhill pull is exactly balanced by the constraints pushing back. **2. Primal feasibility.** `g_i(x) <= 0` for all `i` and `h_j(x) = 0` for all `j`. The point must actually be legal - stationarity of the Lagrangian alone does not guarantee this. **3. Dual feasibility.** `mu_i >= 0` for every inequality multiplier. Equality multipliers `lambda_j` are unrestricted in sign. **4. Complementary slackness.** `mu_i * g_i(x) = 0` for every `i`. All four must hold simultaneously; quoting only stationarity is the classic incomplete answer. ## Reading complementary slackness The product `mu_i * g_i(x) = 0` forces a case split per constraint. Either `g_i(x) = 0` - the constraint is **active**, the optimum sits on its boundary, and its multiplier is allowed to be positive - or `g_i(x) < 0` - the constraint is **slack**, the optimum sits strictly inside the region it permits, and then `mu_i` must be zero. That second case is the intuitive one. Picture a bowl-shaped objective whose unconstrained minimum lies well inside the allowed region, plus a boundary far away from it. Nothing about that boundary changes where the minimum sits: delete the constraint and the same point is returned. Zero multiplier, zero shadow price, no influence. Now shrink the region until the boundary cuts through the bowl. The unconstrained minimum becomes illegal, the solution slides onto the boundary, the constraint becomes active, and its multiplier turns positive - it now has a price, because loosening it would let the objective fall further. This is also why constrained optimization is combinatorially awkward: solving the problem is essentially discovering which subset of inequalities is active, and there are exponentially many candidate subsets. Algorithms differ mainly in how they search that active set without enumerating it. ## Why inequality multipliers must be nonnegative An equality constraint pins you from both sides, so its multiplier may point either way and its sign is a convention. An inequality only resists motion in one direction - out of the feasible region. Under the sign convention above, stationarity says `grad f = -sum_i mu_i * grad g_i`, meaning the objective wants to move in the direction that would increase `g_i` past zero, and the constraint is what stops it. A negative `mu_i` would describe a constraint pulling you *toward* infeasibility, which is not what a constraint does; equivalently, it would say that tightening the constraint improves the objective, which is impossible since tightening only removes options. ## Necessary, sufficient, or neither KKT conditions are **necessary** at a local minimum only if a **constraint qualification** holds - a regularity condition ruling out degenerate constraint geometry. A common one is linear independence of the gradients of the active constraints at the point. Without such a condition, a genuine minimum can fail every KKT test, so failing KKT is not by itself proof that a point is suboptimal. They become **sufficient**, and sufficient for a *global* minimum, when the problem is convex: `f` convex, the `g_i` convex, the `h_j` affine, plus a qualification such as Slater's condition (some strictly feasible point exists). In that setting any point satisfying KKT is a global optimum, which is exactly why convex formulations are prized - the conditions turn from a filter into a certificate. For a nonconvex problem, a KKT point may be a local minimum, a local maximum, or a saddle. It is a candidate, not an answer. ## Practical use Beyond theory, KKT is a diagnostic. Given a claimed solution and its multipliers you can check each condition arithmetically: is it feasible, are all inequality multipliers nonnegative, does each multiplier vanish where its constraint is slack, does stationarity balance. A solver reporting a negative multiplier on an inequality, or a positive multiplier on a constraint that is strictly slack, is reporting an inconsistency worth investigating before the result is trusted. The multipliers that come back nonzero also tell you which requirements are actually shaping the answer - typically a small fraction of the ones written down.

  • What does complementary slackness tell you about a constraint that is strictly slack at the optimum?
    Its multiplier is exactly zero. The solution sits strictly inside the region that constraint permits, so it exerts no force: delete it and the same point is still optimal locally, and relaxing it further buys nothing. Practically, the constraints that come back with nonzero multipliers are the only ones shaping the answer.
  • Why can equality multipliers be negative while inequality multipliers cannot?
    An equality pins the solution from both sides, so the constraint can push either way and the sign of its multiplier is just a bookkeeping convention. An inequality only resists motion out of the feasible region. A negative multiplier would claim that tightening the constraint improves the objective, which is impossible since tightening only removes options.
  • When are KKT conditions sufficient rather than merely necessary?
    For a convex problem - convex objective, convex inequality constraints, affine equalities - together with a qualification such as Slater's condition, any KKT point is a global minimum. Outside convexity the conditions only identify candidates, which may be local minima, maxima or saddle points, so a second-order or global check is still required.

saying these in an interview costs you the question

  • Quotes stationarity alone and omits feasibility or slackness
  • Allows negative multipliers on inequality constraints
  • Treats any KKT point as a global optimum
  • Says every constraint has a positive multiplier at the optimum
  • Forgets that necessity requires a constraint qualification
  • Confuses an active constraint with a violated one

context