KKT Conditions and Water-Filling

From Duality to Optimality Conditions

The KKT conditions are the "first-order necessary and sufficient conditions" for convex problems with strong duality. They unify unconstrained optimality (f=0\nabla f = 0) with constraint handling. The most celebrated application in wireless is water-filling: optimal power allocation across parallel channels.

Theorem: Karush–Kuhn–Tucker (KKT) Conditions

Consider a convex problem with differentiable f0,f1,,fmf_0, f_1, \ldots, f_m and affine equality constraints. If strong duality holds (e.g., Slater's condition), then x\mathbf{x}^\star is optimal if and only if there exist λ0\boldsymbol{\lambda}^\star \succeq 0 and ν\boldsymbol{\nu}^\star such that:

  1. Stationarity: f0(x)+i=1mλifi(x)+j=1pνjhj(x)=0\nabla f_0(\mathbf{x}^\star) + \sum_{i=1}^m \lambda_i^\star \nabla f_i(\mathbf{x}^\star) + \sum_{j=1}^p \nu_j^\star \nabla h_j(\mathbf{x}^\star) = \mathbf{0}

  2. Primal feasibility: fi(x)0f_i(\mathbf{x}^\star) \leq 0, hj(x)=0h_j(\mathbf{x}^\star) = 0

  3. Dual feasibility: λi0\lambda_i^\star \geq 0

  4. Complementary slackness: λifi(x)=0\lambda_i^\star f_i(\mathbf{x}^\star) = 0 for all ii

Complementary slackness says: either a constraint is tight (fi=0f_i = 0) or its multiplier is zero (λi=0\lambda_i = 0). An inactive constraint exerts no "force" on the optimal solution. This is the key to water-filling: channels with too-poor quality get zero power (their constraint is inactive).

,

Historical Note: The KKT Conditions

1939–1951

William Karush derived these conditions in his 1939 master's thesis at the University of Chicago, but the work went largely unnoticed. Harold Kuhn and Albert Tucker independently rediscovered them in 1951. The conditions were initially named "Kuhn–Tucker"; Karush's priority was recognised only in the 1970s.

Definition:

Water-Filling Problem

Consider NN parallel sub-channels with gains g1,,gN>0g_1, \ldots, g_N > 0 and noise powers σ12,,σN2\sigma_1^2, \ldots, \sigma_N^2. The goal is to maximise the total rate (sum capacity):

maximisei=1Nlog2 ⁣(1+gipiσi2)subject toi=1NpiPtot,pi0\begin{aligned} \text{maximise} \quad & \sum_{i=1}^N \log_2\!\left(1 + \frac{g_i p_i}{\sigma_i^2}\right) \\ \text{subject to} \quad & \sum_{i=1}^N p_i \leq P_{\text{tot}}, \quad p_i \geq 0 \end{aligned}

where pip_i is the power allocated to sub-channel ii and PtotP_{\text{tot}} is the total power budget.

Theorem: Water-Filling Solution

The optimal power allocation for the water-filling problem is

pi=(μσi2gi)+p_i^\star = \left(\mu - \frac{\sigma_i^2}{g_i}\right)^+

where (x)+=max(x,0)(x)^+ = \max(x, 0) and the water level μ>0\mu > 0 is chosen so that i=1Npi=Ptot\sum_{i=1}^N p_i^\star = P_{\text{tot}}.

The quantity σi2/gi\sigma_i^2 / g_i is the "noise floor" of sub-channel ii. The solution "pours water" up to a common level μ\mu: channels with high noise floors may receive zero power.

Imagine sub-channels as vessels of different heights (the noise floor σi2/gi\sigma_i^2 / g_i). Pouring a fixed volume of water (the power budget PtotP_{\text{tot}}) fills the vessels to a common water level μ\mu. Tall vessels (poor channels) may not receive any water if the total budget is small.

,

Example: Water-Filling with 4 Sub-Channels

Given 4 OFDM sub-channels with noise floors σi2/gi=[0.5,1.0,2.0,3.5]\sigma_i^2/g_i = [0.5, 1.0, 2.0, 3.5] and total power Ptot=4P_{\text{tot}} = 4, find the optimal power allocation.

Water-Filling Animation

Watch water pour into vessels of different heights as the total power budget increases. Observe how channels with high noise floors receive zero power until the water level rises enough.

Parameters
5

Water-Filling Power Allocation Sweep

Watch the water level μ\mu rise as the total power budget increases. Channels with high noise floors receive zero power until the budget is large enough for the water to reach them.
Four sub-channels with noise floors [0.5,1.0,2.0,3.5][0.5, 1.0, 2.0, 3.5]. As PtotP_{\text{tot}} increases from 0 to 6, channels activate one by one.

Key Takeaway

Water-filling is the prototypical example of KKT in action. Complementary slackness yields the (x)+(x)^+ operator: allocate resources only to channels good enough to clear the noise floor. This principle recurs in OFDMA, MIMO spatial multiplexing, and cognitive radio spectrum allocation.

⚠️Engineering Note

Water-Filling in Practice — From Theory to Standards

The elegant water-filling solution assumes perfect channel state information (CSI) at the transmitter. In real systems, several practical constraints modify the solution:

  • Discrete modulation: Power is not allocated continuously but mapped to discrete MCS (modulation and coding scheme) levels. In LTE/5G NR, each resource block uses one of ~30 MCS indices. The effective allocation is a quantised approximation of water-filling.
  • Feedback delay: CSI is outdated by the time the transmitter uses it. At vehicular speeds (120 km/h, 3.5 GHz carrier), the coherence time is 1.4\sim 1.4 ms — comparable to the feedback loop. Equal power allocation can outperform water-filling with stale CSI.
  • Per-antenna power constraints: Unlike the total power constraint in classic water-filling, practical amplifiers have per-element peak power limits. The resulting optimisation is still convex but no longer admits a closed-form solution.
  • Computational cost: For NN sub-channels, the water-filling algorithm runs in O(NlogN)O(N \log N) (sorting-based) or O(N)O(N) (bisection on μ\mu). Both are negligible compared to channel estimation.
Practical Constraints
  • MCS quantisation: ~30 discrete levels in 5G NR (TS 38.214 Table 5.1.3.1-1)

  • Feedback delay limits CSI freshness; equal power may be preferable at high mobility

  • Per-antenna power limits require iterative solvers instead of closed-form water-filling

📋 Ref: 3GPP TS 38.214 (5G NR Physical Layer Procedures)

Why This Matters: Water-Filling in OFDM Systems

In an OFDM system with NN sub-carriers, each sub-carrier is a parallel sub-channel. If the transmitter knows the channel (via feedback), it applies water-filling to allocate power across sub-carriers. In 5G NR, this is approximated by adaptive modulation and coding (AMC) per resource block.

See full treatment in Transmit Diversity

Common Mistake: Equal Power Allocation Is Not Always Optimal

Mistake:

Assuming that dividing power equally across sub-channels (pi=Ptot/Np_i = P_{\text{tot}}/N) is optimal.

Correction:

Equal power is optimal only when all sub-channels have the same noise floor. In frequency-selective fading, water-filling significantly outperforms equal allocation, especially at low SNR. At very high SNR, the difference diminishes because all channels are active and the water-level differences become negligible.

Quick Check

In the KKT conditions, complementary slackness states λifi(x)=0\lambda_i^\star f_i(\mathbf{x}^\star) = 0. If a constraint is strictly inactive (fi(x)<0f_i(\mathbf{x}^\star) < 0), what can we conclude about λi\lambda_i^\star?

λi\lambda_i^\star can be any non-negative value

λi=0\lambda_i^\star = 0

λi>0\lambda_i^\star > 0

λi=fi(x)\lambda_i^\star = f_i(\mathbf{x}^\star)

Deeper Treatment in the ITA Book

Water-filling reappears as the capacity-achieving input distribution for parallel Gaussian channels in information theory (§Capacity with Diversity). The ITA book (Chapters 5–6) provides the full derivation from mutual information maximisation, including the continuous-frequency generalisation and the connection to rate-distortion theory. The MIMO book (Chapter 5) extends water-filling to the spatial domain via SVD precoding: the MIMO channel decomposes into parallel singular-value sub-channels, each receiving water-filled power.

KKT Conditions

Karush–Kuhn–Tucker conditions: necessary and sufficient conditions for optimality in convex problems with strong duality. Comprise stationarity, primal feasibility, dual feasibility, and complementary slackness.

Related: Lagrangian and Lagrangian Dual Function, Complementary Slackness, Water-Filling Problem

Water-Filling

Optimal power allocation across parallel channels: pi=(μσi2/gi)+p_i^\star = (\mu - \sigma_i^2/g_i)^+ where μ\mu is the water level determined by the total power constraint.

Related: KKT Conditions, Water-Filling in OFDM Systems, Power Allocation