---
title: Edge Waterfilling Algorithm
url: https://www.emergentmind.com/topics/edge-waterfilling-algorithm
type: topic
---

# Edge Waterfilling Algorithm

In the cited literature, an edge waterfilling algorithm most directly denotes either a boundary-driven flooding procedure or a waterfilling-type resource-allocation rule at the wireless edge. In digital elevation model preprocessing, the canonical instance is Priority-Flood, which floods inward from the DEM boundary in order of lowest currently reachable spill level and raises enclosed low areas to the minimum elevation required for drainage. In wireless communications, the exact phrase appears in “Waterfilling at the Edge” for percentile-rate optimization, while related works use nearby formulations such as backhaul-aware, tail, sequential, or asynchronous waterfilling [1511.04463] [2507.10838].

## 1. Terminology and scope

In DEM hydrology, the relevant terminology is “flooding inward from the DEM edges,” “depression filling,” and “Priority-Flood.” The paper states that Priority-Flood is, in substance, exactly an “edge waterfilling” algorithm for DEMs, even though that phrase is not used in the paper itself. The central idea is that the correct place to begin filling is not at local pits, but at the boundary, because edge cells are the only cells that are trivially known to drain: each edge cell already has a path to the outside of the DEM [1511.04463].

In graph morphology, related papers speak of flooding on edge-weighted or node-weighted graphs, watersheds, waterfalls, flooding adjunction, and flooding graphs. There, “edge” refers to edge-weighted graphs and pass-point altitudes rather than wireless edge service or boundary-initialized DEM flooding [1305.5756] [1204.2837].

In communications, several papers use classical waterfilling structure without the exact phrase. One paper explicitly names an “Edge Waterfilling Algorithm” for cell-edge percentile resource allocation, while others study backhaul-aware waterfilling at the wireless edge, tail waterfilling under fading risk, capture aware sequential waterfilling for LoRaWAN, and distributed asynchronous iterative waterfilling for interference channels [2507.10838] [1506.06390] [2312.01251] [1907.12360] [0801.2480].

## 2. Priority-Flood as boundary-driven edge waterfilling

For a DEM \(Z\), the filled DEM \(W\) is required to satisfy three conditions: \(W(c)\ge Z(c)\) for every cell \(c\); for each cell \(c\) of \(W\), there exists a path from \(c\) to the boundary that descends by at least \(\epsilon\) at each step; and \(W\) is the lowest surface satisfying those two properties. With \(\epsilon=0\), this is ordinary depression filling. The result has no undrainable depressions and no digital dams; every cell is guaranteed to drain to the edge [1511.04463].

The basic algorithm initializes a priority queue `Open`, a boolean array `Closed`, pushes every edge cell into `Open` with priority equal to its elevation, and marks those cells closed. Then, while `Open` is not empty, it pops the cell \(c\) with minimum priority and processes each unclosed neighbor \(n\) by the update
\[
DEM(n)\gets \max(DEM(n),DEM(c)).
\]
If \(n\) is lower than the current flood level at \(c\), it is raised to that level; otherwise it is left unchanged. The paper emphasizes that `Closed` is set when the cell is enqueued, not when later popped, preventing duplicate insertions. `NoData` can be treated as less than any real elevation, which allows irregularly shaped DEMs to be handled naturally as if surrounded by a sea lower than all terrain [1511.04463].

The boundary-first ordering supplies the correctness intuition. When the minimum-priority cell \(c\) is popped, it is the lowest known cell that drains to the edge. Any unprocessed neighbor \(n\) lower than \(c\) cannot have a lower outlet to the edge than \(c\), so the least elevation to which \(n\) can be raised while preserving eventual drainage is \(DEM(c)\). This is why the method corresponds so closely to edge waterfilling: the fill height assigned to each depression cell is exactly its lowest spill elevation encountered from the outside [1511.04463].

## 3. Correctness, complexity, and DEM variants

Priority-Flood is described as optimal for both integer and floating-point data, working in \(O(n)\) and \(O(n\lg n)\) time, respectively. For integer data, queue operations can be \(O(1)\) with an integer-key structure such as a hierarchical queue or calendar queue, so the whole algorithm is \(O(n)\). For floating-point data, comparison-based priority queues give \(O(n\log_2 n)\). The paper also notes an \(O(n\log_2 k)\) complexity when floating-point values are binned by unique levels using the mapped-queue method of Liu et al. [1511.04463].

The improved Priority-Flood variant uses a plain FIFO queue `Pit` inside depressions and a priority queue `Open` only for the normal flood frontier. If a neighbor \(n\) is lower than \(c\), and thus raised to \(DEM(c)\), the algorithm pushes \(n\) into `Pit` rather than into the priority queue. This yields \(O(m\log_2 m)\), where \(m\le n\), and is presented as the lowest known time complexity for a floating-point depression-filling algorithm. In testing, the improved variation performed up to \(37\%\) faster than the original, and an older parallel algorithm required six processors to match the run time of the improved single-processor variant [1511.04463].

The same framework extends beyond flat filling. Priority-Flood+\(\epsilon\) uses `NextAfter` to create strictly descending paths while perturbing the DEM as little as possible; Priority-Flood+FlowDirs computes flow directions directly without changing elevations and is described as a depression-carving formulation; and a watershed-labeling variant propagates outlet labels inward. The method applies to 4-connected, 6-connected, 8-connected, and general \(n\)-connected grids, as well as irregular meshes, provided a boundary can be identified and neighbors can be enumerated [1511.04463].

## 4. Edge- and node-weighted graph flooding

In edge-weighted graph flooding, nodes carry flood levels \(\tau_i\) and edges carry pass or pipe altitudes \(e_{ij}\). The hydrostatic law is local: if \(\tau_i\) is higher than the pipe \(e_{ij}\), then levels equalize. The paper gives the flooding criterion in equivalent forms,
\[
\tau_p>\tau_q \Rightarrow e_{pq}\ge \tau_p,
\]
\[
\tau_p\le \tau_q\vee e_{pq},
\]
and
\[
\tau_p\le \bigwedge_{q\sim p}(\tau_q\vee e_{pq}).
\]
With a ceiling function \(\omega\), the highest flooding under \(\omega\) satisfies
\[
\tau_p=\omega_p\wedge \bigwedge_{q\sim p}(\tau_q\vee e_{pq}).
\]
If \(e_{pq}<\tau_p\), then necessarily \(\tau_p=\tau_q\); this is the equalization rule across a sufficiently low barrier [1305.5756].

The same paper shows that flooding on edge-weighted graphs admits a shortest-path interpretation with path altitude
\[
\operatorname{alt}(\pi)=\max_{e\in\pi} e
\]
and flooding distance
\[
d(x,y)=\min_{\pi:x\leadsto y}\max_{e\in\pi} e.
\]
By adding a dummy source \(\Omega\) and edges \(e_{\Omega p}=\omega_p\), the highest flooding under \(\omega\) becomes the shortest ultrametric distance to \(\Omega\). This yields a minimax Dijkstra relaxation
\[
\tau_i\leftarrow \min(\tau_i,\tau_j\vee e_{ji}),
\]
as well as hierarchical-queue and minimum-spanning-tree formulations [1305.5756].

A companion watershed paper develops the flooding adjunction and flooding graphs, with
\[
[\delta_{en}n]_{ij}=n_i\vee n_j,\qquad [\varepsilon_{ne}e]_i=\bigwedge_{k\text{ neighbors of }i} e_{ik},
\]
and defines a flooding graph by the mutual consistency conditions \(\delta_{en}n=e\) and \(\varepsilon_{ne}e=n\). It also introduces pruning operators of increasing steepness and a scissor operator that keeps one flooding edge per node outside minima, producing nonoverlapping watershed partitions. This makes explicit that edge-weighted and node-weighted formulations are treated as equivalent rather than hierarchically ordered [1204.2837].

## 5. Explicit “Edge Waterfilling” in percentile resource allocation

The paper “Waterfilling at the Edge” studies deterministic resource allocation in a point-to-point multi-terminal AWGN channel with no inter-terminal interference. Terminal \(i\) has rate
\[
r_i(p_i,\sigma_i^2)=\log\!\left(1+\frac{p_i}{\sigma_i^2}\right),
\]
with total power constraint \(\sum_i p_i\le P_0\). The objective is not sum-rate, but the sum of the smallest \(\alpha\)-quantile rates, written as the sum-least-\(\alpha\)-quantile utility. Using a pseudo-stochastic interpretation over the set of terminal noise variances, the paper establishes an exact equivalence between that utility and a lower-tail CVaR of the rate distribution [2507.10838].

This reformulation yields a convex program and a closed-form waterfilling-type policy
\[
p^*(\sigma^2)=\min\left\{\left(\frac{1}{\mu\alpha}-\sigma^2\right)_+,\,\sigma^2(e^t-1)\right\}.
\]
The first term is classical waterfilling with water level \(1/(\mu\alpha)\); the second is a CVaR- or VaR-induced cap. The paper interprets this as a policy that flattens rates among sufficiently good terminals while redirecting saved power toward weaker users. As \(\alpha\to 1\), the method reduces to classical waterfilling or sum-rate maximization [2507.10838].

The proposed Edge Waterfilling Algorithm is an inexact dual subgradient descent. At each iteration it computes \(t^*(\mu)\) by bisection to tolerance \(\epsilon\), evaluates the closed-form \(p^*(\sigma^2)\), and updates the scalar dual variable \(\mu\) using the power-constraint residual. The paper states a per-iteration complexity of
\[
\mathcal O\!\left(N_U\log \frac{1}{\epsilon}\right),
\]
and gives a finite-budget \(O(T^{-1/2})\)-type bound when \(\epsilon=1/\sqrt{T}\) and \(\gamma=1/\sqrt{T}\). In the reported experiments, Edge Waterfilling attains higher SL\(\alpha\)Q values than proportional fairness and classical waterfilling in both scenarios listed in Table 1, including \(0.6421\) versus \(0.5986\) and \(0.5004\) in one case, and \(0.8215\) versus \(0.6915\) and \(0.4540\) in the other [2507.10838].

## 6. Broader wireless formulations and related uses

The broader literature uses waterfilling structure in several edge-adjacent ways rather than under a single uniform name. In online basestation allocation, the optimal mutual-information value of classical waterfilling over a subset of parallel Gaussian channels is proved to be a monotone submodular set function, which yields an online greedy allocation algorithm with competitive ratio at most \(2\) for the sum-rate objective under per-basestation waterfilling [1402.4892]. In multi-connectivity with constrained backhaul, a UE allocates power across multiple AP uplinks using path-state feedback and the update
\[
P_k(t+1)=
\begin{cases}
(W_k\mu(t+1)-E_k(t))^+, & \mathcal S_{\mathrm{eff}}^{(k)}(t)=1,\\
P_k(t), & \mathcal S_{\mathrm{eff}}^{(k)}(t)=2,\\
ZP_k(t), & \mathcal S_{\mathrm{eff}}^{(k)}(t)=3,
\end{cases}
\]
with convergence to within \(\tau\) bps of the topology-aware optimum under the stated condition on \(Z\) [1506.06390].

Distributed interference-channel formulations replace centralized control by asynchronous best-response waterfilling. For Gaussian frequency-selective interference channels, the asynchronous iterative waterfilling algorithm updates each user with possibly outdated interference measurements and converges to the unique Nash equilibrium under the sufficient condition \(\rho(\mathbf S^{\max})<1\) [0801.2480]. The MIMO extension develops a fully distributed asynchronous iterative waterfilling algorithm for arbitrary channel matrices, together with uniqueness and convergence conditions and a modified game with milder sufficient conditions [0812.2324].

Risk-aware formulations use the language of tail waterfilling rather than edge waterfilling. In one paper, the CVaR-optimal policy for stochastic fading channels is
\[
p_i^*(h_i,\cdot)=\min\left\{\left(\frac{\lambda_i}{\mu\alpha_i}-\frac{\sigma_i^2}{h_i^2}\right)_+,\,\frac{\sigma_i^2(e^{(t_i)_+}-1)}{h_i^2}\right\},
\]
and the optimal quantile threshold is available in closed form from the fading quantile \(F_{h_i}^{-1}(\alpha_i)\); a later paper develops a purely dual tail waterfilling scheme to compute the dual variables more rapidly and assuredly than the earlier primal-dual method [2305.01053] [2312.01251].

Other specialized variants retain the waterfilling structure but target different operating points. “Approaching Waterfilling Capacity of Parallel Channels by Higher Order Modulation and Probabilistic Amplitude Shaping” uses classical waterfilling and mercury-waterfilling as reference allocations and approaches them via PAS and product distribution matching [1804.01922]. “Capture Aware Sequential Waterfilling for LoraWAN Adaptive Data Rate” equalizes Time-on-Air load across spreading factors and reports up to \(38\%\) capacity improvement over legacy ADR in multi-gateway settings [1907.12360]. “Data-Importance-Aware Waterfilling for Adaptive Real-Time Communication in Computer Vision Applications” derives a task-weighted power law for semantic-region and bit-plane sub-streams and reports more than \(7\) dB and \(10\) dB gains in normalized IMSE over margin-adaptive waterfilling and equal power allocation at high SNRs \((>10\ \mathrm{dB})\) [2502.20926]. “Energy Efficient Iterative Waterfilling for the MIMO Broadcasting Channels” uses uplink-downlink duality and block-coordinate ascent to obtain an energy-efficiency-maximizing eigenmode waterfilling scheme for MIMO BCs [1201.3697].

| Domain | Representative formulation | Paper |
|---|---|---|
| DEM preprocessing | Boundary flooding from edge cells with \(DEM(n)\leftarrow \max(DEM(n),DEM(c))\) | [1511.04463] |
| Edge-weighted graph flooding | Minimax flooding with \(\tau_i\leftarrow \min(\tau_i,\tau_j\vee e_{ji})\) | [1305.5756] |
| Cell-edge percentile allocation | CVaR-based \(p^*(\sigma^2)=\min\{(1/(\mu\alpha)-\sigma^2)^+,\sigma^2(e^t-1)\}\) | [2507.10838] |
| Backhaul-aware wireless edge | Dynamic-subset waterfilling under path-state feedback | [1506.06390] |
| Distributed interference networks | Asynchronous iterative waterfilling with stale interference information | [0801.2480] |

The resulting picture is not a single algorithmic lineage but a family resemblance. In DEMs, edge waterfilling is literally boundary flooding from the outside in. In graph morphology, it is flooding over edge barriers and ultrametric pass heights. In wireless systems, it names or approximates several thresholded resource-allocation laws, with the 2025 percentile-rate method being the clearest explicit use of the term “Edge Waterfilling Algorithm” [2507.10838].

Source: https://www.emergentmind.com/topics/edge-waterfilling-algorithm