Logarithmic water filling 2026-10-07
To maximize for positive baselines, nonnegative allocations and a positive budget , the KKT conditions equalize the shifted values on allocated coordinates. The unique water level solves . Inactive coordinates have baselines at least the water level. Strict convexity of the negative objective ensures uniqueness, and sorting the baselines gives an efficient water-filling algorithm.
Let . The feasible probability simplex is a nonempty compact convex set, so the extreme value theorem guarantees a minimizer. Its Hessian matrix is diagonal with positive entries , making a strictly convex function. Hence the minimizer is unique.
Use the Lagrange multipliers for the sum constraint and for . The Lagrangian is
The KKT conditions are
A strictly positive feasible allocation exists, so the Slater condition holds. These conditions are necessary and sufficient for this convex optimization. At least one coordinate is positive, giving . Put . For a positive coordinate, complementary slackness gives . At a zero coordinate, stationarity gives , or . Thus
Here . This logarithmic water filling raises the smaller baseline values to a common level. The scalar left side is a continuous function and strictly increasing above , starts at zero, and tends to infinity, so exactly one solves it. One can find it by interval bisection, or sort the baseline values increasingly and find an index for which
using . Equality at the next baseline simply gives a zero allocation. Sorting and a running sum implement the water-filling algorithm in time.
The increasing baseline order is . A water-filling algorithm with three active coordinates gives
Therefore, in the original coordinate order,
The first three shifted coordinates all equal , the fourth remains , and the allocations sum to one. For an explicit KKT certificate take , , and . The strict convexity established above makes this optimum unique.
The Lagrange sufficiency theorem says that if a feasible point and nonnegative multipliers satisfy complementary slackness and globally maximizes the Lagrangian function in constrained optimization, then globally solves the constrained maximization problem. Indeed, for every feasible , the signs of the constraints give . Concavity and the Karush-Kuhn-Tucker conditions are a common way to verify the global Lagrangian maximum.
For fixed , A maximizes
subject to and . This is a concave function of . On every active coordinate, the multiplier equation is
Thus A's optimal allocation is given by the water-filling algorithm:
where is chosen so that . Coordinates with zero expression receive no resource. This is a water-filling algorithm. The formula gives the optimum when every . If , any already gives A the whole market in that region, so A assigns such coordinates arbitrarily small positive amounts and applies water filling to the remaining budget; without a convention for , the resulting value can be a supremum rather than an attained maximum.