10.2 The Karush–Kuhn–Tucker conditions

For equality constraints alone, Lagrange’s condition says that at a minimum \(\nabla f + \sum _k\mu _k\nabla h_k = 0\) for some multipliers \(\mu _k\). With inequality constraints the multipliers must also have the right sign, and must vanish on constraints that are not active.

Theorem 10.2.1 (KKT conditions). Let \(x^*\) be a local minimum, with \(f\), \(g_i\), \(h_k\) continuously differentiable, and suppose a constraint qualification holds at \(x^*\) (for instance, the gradients of the active constraints are linearly independent). Then there are multipliers \(\lambda _i\) and \(\mu _k\) with \begin {align*} &\nabla f(x^*) + \sum _i\lambda _i\nabla g_i(x^*) + \sum _k\mu _k\nabla h_k(x^*) = 0 && \text {(stationarity)}, \\ &\lambda _i \geq 0, \qquad \lambda _ig_i(x^*) = 0 && \text {(dual feasibility, complementary slackness)}, \end {align*}

together with feasibility of \(x^*\). Conversely, for a convex programme, any feasible \(x^*\) satisfying these conditions is a global minimum, with no constraint qualification needed.

Proof. Necessity (sketch). At a local minimum there is no direction \(d\) that decreases \(f\) to first order, \(\nabla f^{\mathsf T}d < 0\), while keeping the active inequality constraints, \(\nabla g_i^{\mathsf T}d \leq 0\), and the equalities, \(\nabla h_k^{\mathsf T}d = 0\), satisfied to first order; the constraint qualification makes this linearisation accurate. By Farkas’ lemma (Theorem 5.4.1), the absence of such a \(d\) is equivalent to the existence of the multipliers, with \(\lambda _i = 0\) for the inactive constraints.

Sufficiency. Let \(x\) be feasible. By convexity, \(f(x) \geq f(x^*) + \nabla f(x^*)^{\mathsf T}(x - x^*)\), and by stationarity \(\nabla f(x^*)^{\mathsf T}(x - x^*) = -\sum _i\lambda _i\nabla g_i(x^*)^{\mathsf T}(x - x^*) - \sum _k\mu _k\nabla h_k(x^*)^{\mathsf T}(x - x^*)\). The last sum is \(0\) since \(h_k\) is affine and \(h_k(x) = h_k(x^*) = 0\). For each \(i\), convexity of \(g_i\) gives \(\nabla g_i(x^*)^{\mathsf T}(x - x^*) \leq g_i(x) - g_i(x^*)\), and \(\lambda _i\bigl (g_i(x) - g_i(x^*)\bigr ) = \lambda _ig_i(x) \leq 0\) by complementary slackness and feasibility. So \(f(x) \geq f(x^*)\). □

For a linear programme the KKT conditions are exactly primal feasibility, dual feasibility and complementary slackness (Theorem 5.3.1); the multipliers are the dual variables. In general \(\lambda _i\) is again a shadow price: if the constraint is relaxed to \(g_i \leq \varepsilon \), the optimal value changes at rate \(-\lambda _i\). For convex programmes satisfying Slater’s condition (some point with every \(g_i < 0\)) the theory extends to a full duality theorem, with no duality gap.

Example 10.2.2. Minimise \((x - 2)^2 + (y - 1)^2\) subject to \(x + y \leq 2\), \(x, y \geq 0\): the point of the triangle nearest to \((2, 1)\). If only \(x + y \leq 2\) is active, stationarity gives \(2(x - 2) + \lambda = 0\), \(2(y - 1) + \lambda = 0\), so \(x - 2 = y - 1\), and with \(x + y = 2\), \(x = \frac 32\), \(y = \frac 12\), \(\lambda = 1 \geq 0\). The other constraints are inactive. The problem is convex, so this is the global minimum, with value \(\frac 12\), and \(\lambda = 1\) says that relaxing the constraint to \(x + y \leq 2 + \varepsilon \) lowers the minimum by about \(\varepsilon \). Software 10.5.1 tries all eight active sets and finds only this one.

Questions on this section

Stuck on something here? Ask below and it stays attached to this topic.