Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Semi-discrete and Wasserstein-1

This chapter develops three computational consequences of duality. Eliminating one potential gives the semi-dual; for discrete measures, this viewpoint leads to auction algorithms, while a continuous source and discrete target lead to Laguerre-cell geometry. The final part specializes duality to W1\Wass_1, where Lipschitz functions and flow fields replace convex potentials. The material connects auction and network-flow methods Bertsekas, 1992Bertsekas & Eckstein, 1988, computational geometry Aurenhammer et al., 1998Mérigot, 2011Mérigot, 2013, and the Kantorovich--Rubinstein and Beckmann formulations Kantorovich & Rubinstein, 1958Beckmann, 1952.

Semi-dual

The semi-dual eliminates one potential by an exact cc-transform. It preserves concavity while removing the explicit pointwise inequality constraint.

General Measure Semi-dual

For arbitrary measures, partial maximization converts the constrained two-potential dual into an unconstrained optimization over one function.

Denote the extended full-dual objective by

E0(f,g):={Xfdα+Ygdβ,(f,g)R(c),,otherwise.\mathcal E_0(f,g) \eqdef \begin{cases} \displaystyle \int_\X f\,\d\alpha+\int_\Y g\,\d\beta, & (f,g)\in\Potentials(c),\\ -\infty,&\text{otherwise}. \end{cases}

Thus Lc(α,β)=maxf,gE0(f,g)\mathcal L_c(\alpha,\beta)=\max_{f,g}\mathcal E_0(f,g). For fixed gg, feasibility is equivalent to fgcˉf\leq g^{\bar c}. Since α\alpha is nonnegative, the largest admissible choice f=gcˉf=g^{\bar c} maximizes the objective and gives

Lc(α,β)=supgC(Y)E(g),E(g):=E0(gcˉ,g)=supfC(X)E0(f,g)=Xgcˉdα+Ygdβ.\mathcal L_c(\alpha,\beta) = \sup_{g\in\Cc(\Y)}\mathcal E(g), \qquad \mathcal E(g) \eqdef \mathcal E_0(g^{\bar c},g) = \sup_{f\in\Cc(\X)}\mathcal E_0(f,g) = \int_\X g^{\bar c}\,\d\alpha+\int_\Y g\,\d\beta.

Partial maximization preserves concavity. Moreover, E(g+s)=E(g)\mathcal E(g+s)=\mathcal E(g) because (g+s)cˉ=gcˉs(g+s)^{\bar c}=g^{\bar c}-s and both measures have unit mass. Potentials are therefore defined only up to an additive constant, while the optimization is unconstrained.

Discrete Semi-dual

For two discrete measures

α=i=1naiδxi,β=j=1mbjδyj,Cij=c(xi,yj),\alpha=\sum_{i=1}^n a_i\delta_{x_i}, \qquad \beta=\sum_{j=1}^m b_j\delta_{y_j}, \qquad \C_{ij}=c(x_i,y_j),

with common total mass MM, use the same notation for vectors:

E0(f,g):={f,a+g,b,fgC,,otherwise.\mathcal E_0(f,g) \eqdef \begin{cases} \langle f,a\rangle+\langle g,b\rangle,&f\oplus g\leq\C,\\ -\infty,&\text{otherwise}. \end{cases}

Eliminating the source vector gives

LC(a,b)=maxgRmE(g),E(g)=E0(gCˉ,g)=i=1nai(gCˉ)i+j=1mbjgj,\mathcal L_{\C}(a,b) = \max_{g\in\mathbb R^m}\mathcal E(g), \qquad \mathcal E(g) = \mathcal E_0(g^{\bar\C},g) = \sum_{i=1}^n a_i(g^{\bar\C})_i + \sum_{j=1}^m b_jg_j,

where

(gCˉ)i=min1jm(Cijgj).(g^{\bar\C})_i=\min_{1\le j\le m}(\C_{ij}-g_j).

The function E\mathcal E is concave, piecewise affine, and invariant under gg+s1g\mapsto g+s\mathbf 1. If ties are resolved by choosing σg(i)argminj(Cijgj)\sigma_g(i)\in\arg\min_j(\C_{ij}-g_j), then a supergradient is

bb^(g),b^j(g)=i:σg(i)=jai.b-\widehat b(g), \qquad \widehat b_j(g)=\sum_{i:\,\sigma_g(i)=j}a_i.

It is therefore the mismatch between the desired target mass and the mass currently attracted by each target coordinate. At ties, splitting source mass among active targets describes the full superdifferential.

Auction Algorithm

The auction algorithm is derived from coordinate maximization of the semi-dual of the linear assignment problem. Its practical form uses bidder-specific dual-weight updates that cross the selected row’s next indifference threshold by ε\varepsilon; this controlled relaxation prevents jamming at nonsmooth ties. We follow the account of Mérigot and Thibert Mérigot & Thibert, 2020, itself based on Bertsekas’ auction algorithm and its ε\varepsilon-scaling refinement Bertsekas, 1981Bertsekas & Eckstein, 1988Bertsekas, 1992. In this section, CRn×n\C\in\mathbb R^{n\times n} and n2n\ge2. A permutation matrix PP represents the probability coupling P/nP/n.

Coordinate Ascent and Discrete Laguerre Cells

Write gjg_j for the target Kantorovich potential. Specializing the discrete semi-dual to uniform weights gives

E(g)=1ni=1n(gCˉ)i+1nj=1ngj,(gCˉ)i=min1jn(Cijgj).\mathcal E(g) = \frac1n\sum_{i=1}^n(g^{\bar\C})_i+\frac1n\sum_{j=1}^n g_j, \qquad (g^{\bar\C})_i=\min_{1\le j\le n}(\C_{ij}-g_j).

Thus (gCˉ,g)(g^{\bar\C},g) is dual feasible. This is the discrete Cˉ\bar C-transform of Remark Remark: Discrete cc-transform, with the same sign convention as in the general and semi-discrete formulations.

The discrete Laguerre cells are

LagjD(g)={i: CijgjCikgk for every k}.\operatorname{Lag}^{\mathrm D}_j(g) = \left\{i:\ \C_{ij}-g_j\le \C_{ik}-g_k\ \text{for every }k\right\}.

They can overlap at ties. They are the finite counterparts of the general semi-discrete Laguerre cells in Definition Definition: Laguerre Cells and Power Diagrams: the displayed cell is that definition restricted to row indices. If every row has a unique minimizer, then

gjE(g)=1LagjD(g)n.\frac{\partial}{\partial g_j}\mathcal E(g) = \frac{1-|\operatorname{Lag}^{\mathrm D}_j(g)|}{n}.

An overfull cell therefore calls for a decrease of its dual weight. Proposition Proposition: Dual Certificate for an Assignment shows that a perfect matching in the contact graph iLagjD(g)i\in\operatorname{Lag}^{\mathrm D}_j(g) certifies optimality of gg; conversely, assignment duality and complementary slackness produce such a matching at every maximizer.

For iLagjD(g)i\in\operatorname{Lag}^{\mathrm D}_j(g), define

bidj(g,i)=minkj(Cikgk)(Cijgj).\operatorname{bid}_j(g,i) = \min_{k\ne j}(\C_{ik}-g_k)-(\C_{ij}-g_j).

When the cell is nonempty, the largest maximizing decrement along the negative jjth coordinate is the largest such bid Mérigot & Thibert, 2020. At a tie, even this largest maximizing decrement can vanish, so naive coordinate ascent may jam before reaching a dual maximizer.

Bids and Relaxed Contacts

Auction avoids jamming by moving an unassigned row ε\varepsilon beyond its next indifference point. Let j0j_0 and j1j_1 be its best and second-best targets:

j0argminj(Cijgj),j1argminjj0(Cijgj).j_0\in\arg\min_j(\C_{ij}-g_j), \qquad j_1\in\arg\min_{j\ne j_0}(\C_{ij}-g_j).

The winning dual weight is updated by

Δi=bidj0(g,i)+ε=(Ci,j1gj1)(Ci,j0gj0)+ε,gj0gj0Δi.\Delta_i = \operatorname{bid}_{j_0}(g,i)+\varepsilon = (\C_{i,j_1}-g_{j_1})-(\C_{i,j_0}-g_{j_0})+\varepsilon, \qquad g_{j_0}\leftarrow g_{j_0}-\Delta_i.

Unlike exact coordinate maximization, this update uses the selected row’s bid rather than the maximum bid over the whole cell. Afterward, the reduced cost of j0j_0 is exactly ε\varepsilon above that of the unchanged alternative j1j_1. The row nevertheless takes j0j_0; its former owner, if any, becomes unassigned. Because of this overshoot, a bid need not increase the nonsmooth semi-dual. Coordinate ascent motivates the update, but ε\varepsilon-complementary slackness is the invariant used in the convergence proof.

A bid gives the newly assigned row this property. Decreasing gj0g_{j_0} can only make j0j_0 less attractive to rows assigned elsewhere, and the previous owner of j0j_0 is removed. Every iteration therefore preserves the condition.

Figure Div shows actual iterates on the planar point clouds used in Div. For the current target potential, define the auction reduced costs

rij(g)=Cijgj(gCˉ)i0.r_{ij}(g)=\C_{ij}-g_j-(g^{\bar\C})_i\geq 0.

Exact zeros are the discrete Laguerre contacts of row ii, whereas an owned edge only needs to satisfy rij(g)εr_{ij}(g)\leq\varepsilon by ε\varepsilon-complementary slackness.

At an intermediate state, the current ownership matching is M={(i,j):Pij=1}M=\{(i,j):P_{ij}=1\}; the labels in the figure report its cardinality.

<IPython.core.display.Image object>

Geometric progression of the unit-mass transportation auction. Thick violet segments form the current partial ownership matching, while thin translucent segments show the 2n2n unmatched edges with smallest auction reduced costs. The labels report matching cardinality and cumulative bid count. With ε=0.002\varepsilon=0.002, the final assignment is reached after 505 bids and coincides with the exact squared-distance optimum.

Interactive panel. Vary the bid increment and inspect how assignments and target dual weights evolve toward complementary slackness.

Fixed Tolerance

For a prescribed tolerance, relaxed contact gives both an optimality certificate and a finite bound on the number of bids.

Proof

Each bid decreases one target potential by at least ε\varepsilon. Once a target has an owner, later bids may change that owner but never leave the target empty. While the algorithm is incomplete, an unassigned target therefore retains its initial zero potential. A selected target is either unassigned, hence has zero potential, or has value at least RC-R_{\C} by comparison with a zero-potential target. Each target can consequently receive at most RC/ε+1\lfloor R_{\C}/\varepsilon\rfloor+1 bids. At termination every row and column has one active entry.

For the cost certificate, summing ε\varepsilon-complementary slackness over the returned permutation gives the first inequality below. The second is the dual lower bound of Proposition Proposition: Dual Certificate for an Assignment, applied to (gCˉ,g)(g^{\bar\C},g):

1nC,P1ni(gCˉ)i+1njgj+εminP1nC,P+ε.\frac1n\langle\C,P\rangle \le \frac1n\sum_i(g^{\bar\C})_i+\frac1n\sum_jg_j+\varepsilon \le \min_{P'}\frac1n\langle\C,P'\rangle+\varepsilon.

One dense bid scans nn reduced costs, proving the complexity bound. For integer costs, the unnormalized assignment gap is an integer smaller than one and must therefore vanish.

ε\varepsilon-Scaling

The cold-start estimate above exposes the limitation of a single tolerance. A large ε\varepsilon is fast but gives only a coarse certificate, whereas the small ε\varepsilon required for high accuracy can produce a bid count proportional to RC/εR_{\C}/\varepsilon. Continuation first learns a rough dual-potential landscape and then sharpens it instead of restarting from zero.

Algorithm Algorithm: Auction With ε\varepsilon-Scaling starts at the cost scale max{RC,η}\max\{R_{\C},\eta\} and halves the tolerance until it reaches the requested value η\eta. Each phase rebuilds the ownership matrix but retains the target potential from the preceding phase. The previous complete assignment already certifies approximate contact for this potential, so the next auction refines an existing dual landscape.

Proof

The initial tolerance is ε0=max{RC,η}\varepsilon_0=\max\{R_{\C},\eta\}. If it equals η\eta, the fixed-tolerance proposition gives the result in one phase. Otherwise the first phase starts from the zero potential and costs O(n2)O(n^2) because RC/ε0=1R_{\C}/\varepsilon_0=1.

Consider a later ε\varepsilon-phase initialized from a target potential obtained at preceding tolerance λ\lambda. The preceding assignment satisfies λ\lambda-complementary slackness. Lemma 25 of Mérigot and Thibert Mérigot & Thibert, 2020, expressed in the present sign convention, bounds the decrease of each potential component during the new phase by n(λ+ε)n(\lambda+\varepsilon). Since each bid decreases one component by at least ε\varepsilon, the phase uses at most

n2(1+λε)n^2\left(1+\frac{\lambda}{\varepsilon}\right)

bids. Consecutive tolerances satisfy λ/ε2\lambda/\varepsilon\leq2, hence each warm-started phase costs O(n3)O(n^3) dense operations. Halving gives the stated phase count. The last phase enforces η\eta-complementary slackness, so the fixed-tolerance proposition yields the accuracy and integer-cost conclusions.

A cold-started η\eta-auction has bound O(n2(1+RC/η))O(n^2(1+R_{\C}/\eta)), while scaling uses a logarithmic number of O(n3)O(n^3) phases. Thus scaling is a high-accuracy guarantee, not an unconditional speedup: its bound improves the cold-start estimate when RC/ηR_{\C}/\eta is large compared with n(1+log+(RC/η))n(1+\log_+(R_{\C}/\eta)). For integer costs, choosing η<1/n\eta<1/n gives an exact assignment in O(n3(1+log+(nRC)))O(n^3(1+\log_+(nR_{\C}))) operations.

Semi-discrete

The semi-discrete case is the setting where dual potentials become weights of Laguerre cells. This gives both geometry and algorithms for quantization and density fitting.

Discrete Targets and Laguerre Cells

Consider the case where

β=j=1mbjδyj\beta=\sum_{j=1}^m b_j\delta_{y_j}

has distinct atoms and positive weights; zero-weight atoms can be removed. The same construction applies if α\alpha is discrete, after exchanging the roles of α\alpha and β\beta. Restricting the minimization in Definition Definition: cc-Transform to the support of β\beta, equivalently applying that definition with the discrete target space Y={yj}j=1m\Y=\{y_j\}_{j=1}^m and identifying a vector gRmg\in\RR^m with the function g:YRg:\Y\to\RR defined by g(yj)=gjg(y_j)=g_j, gives the discrete cˉ\bar c-transform

gcˉ(x):=min1jmc(x,yj)gj.g^{\bar c}(x) \eqdef \min_{1\le j\le m} c(x,y_j)-g_j.

This maps a vector gg to a continuous function because it is the minimum of finitely many continuous functions. Using this transform when β\beta is discrete yields the finite-dimensional semi-dual

Lc(α,β)=maxgRmE(g):=E0(gcˉ,g)=Xgcˉ(x)dα(x)+j=1mgjbj.\mathcal{L}_c(\alpha,\beta) = \max_{g\in\RR^m} \mathcal{E}(g) \eqdef \mathcal E_0(g^{\bar c},g) = \int_\X g^{\bar c}(x)\,\d\alpha(x) + \sum_{j=1}^m g_j b_j .

The objective is invariant under gg+s1g\mapsto g+s\mathbf 1, so one may impose the gauge jgj=0\sum_j g_j=0.

The geometric object encoded by the dual weights is a weighted nearest-neighbor diagram: each source point is assigned to the target atom that realizes the discrete cˉ\bar c-transform.

For quadratic costs, varying the dual weights moves the walls between adjacent cells while keeping them parallel. This is the geometric mechanism by which the cell masses are adjusted.

Figure Div follows this adjustment from unweighted Voronoi cells to a power diagram whose cell masses match the prescribed discrete target weights.

<IPython.core.display.Image object>

Laguerre cells for semi-discrete quadratic transport. The red contours show a continuous source density α\alpha given by a three-component Gaussian mixture on the right. The twenty-one colored circular sites are the atoms of the discrete target β\beta, sampled from a compact cloud on the left; each site color matches its Laguerre cell. Starting from ordinary Voronoi cells, semi-dual weight updates deform the cells so that the α\alpha-mass captured by each cell approaches the prescribed target mass.

The interactive demo exposes the dual-weight mechanism directly. Increase the number of weight updates to watch cells with too little mass expand and cells with too much mass shrink.

Interactive panel. Use the weight and seed controls to deform Laguerre cells and watch how their areas respond to semi-discrete masses.

Mass Balance

The semi-dual energy can be rewritten as

E(g)=j=1mLj(g)(c(x,yj)gj)dα(x)+g,b.\mathcal{E}(g) = \sum_{j=1}^m \int_{\mathcal{L}_j(g)} \left(c(x,y_j)-g_j\right)\,\d\alpha(x) + \langle g,b\rangle .
Proof

For α\alpha-almost every xx, the minimizing index in minjc(x,yj)gj\min_j c(x,y_j)-g_j is unique. If this index is j(x)j(x), then the directional derivative in direction hRmh\in\RR^m is

ddtt=0minj(c(x,yj)gjthj)=hj(x).\left.\frac{\d}{\d t}\right|_{t=0} \min_j\left(c(x,y_j)-g_j-t h_j\right) = -h_{j(x)}.

The difference quotients are bounded by h\norm{h}_\infty, so dominated convergence gives

dE(g)[h]=jhjLj(g)dα+jhjbj,\d\mathcal{E}(g)[h] = -\sum_j h_j\int_{\mathcal{L}_j(g)}\d\alpha + \sum_j h_j b_j,

which is the announced gradient formula.

The first-order optimality condition says that solving the semi-discrete dual amounts to choosing weights gg so that

Lj(g)dα=bjfor every j.\int_{\mathcal{L}_j(g)}\d\alpha=b_j \qquad\text{for every }j.

The gradient components sum to zero, consistently with the gauge invariance. Conversely, balanced cells define the piecewise-constant map T(x)=yjT(x)=y_j on Lj(g)\mathcal{L}_j(g). Its graph lies in the contact set gcˉ(x)+gj=c(x,yj)g^{\bar c}(x)+g_j=c(x,y_j), so continuous complementary slackness proves that both the map and the weights are optimal. For the quadratic cost, uniqueness follows from Brenier’s theorem when α\alpha has a density.

The sign of the gradient has a direct geometric interpretation. Increasing gjg_j lowers the corresponding power distance and expands Lj(g)\mathcal L_j(g); decreasing gjg_j shrinks it. The dotted outline marks the balanced cell, so semi-dual ascent can be read as a mass-balancing procedure on a power diagram.

Figure Div makes the sign of this gradient geometric.

<IPython.core.display.Image object>

Dual weights control Laguerre cell masses in the semi-discrete quadratic problem. The same blue target sites and red Gaussian source density are used in all panels; only the highlighted violet weight is changed. The dotted violet outline is the balanced cell. If the highlighted cell has too little source mass, then bjα(Lj(g))>0b_j-\alpha(\mathcal L_j(g))>0 and the ascent update increases the weight, expanding the cell outward. If it has too much mass, the update decreases the weight, shrinking it inward. At balance, the cell mass matches the prescribed target mass and the first-order update vanishes.

Interactive panel. Vary the target weights and the number of dual updates to watch Laguerre cells rebalance their masses.

Quadratic power diagrams have polyhedral cells and can be computed efficiently using computational-geometry algorithms Aurenhammer, 1987Aurenhammer et al., 1998Mérigot, 2011. Expanding the cost shows that a cell minimizes x2x,yj+yj2gjx\mapsto-2\langle x,y_j\rangle+\norm{y_j}^2-g_j. The lower envelope of these affine functions gives the power diagram, while the lower hull of the lifted sites (yj,yj2gj)(y_j,\norm{y_j}^2-g_j) gives its dual regular triangulation. For a planar source, this is a three-dimensional hull and Chan’s output-sensitive algorithm costs O(mlogQ)O(m\log Q) for QQ hull vertices Chan, 1996. A three-dimensional source lifts to four dimensions and is not covered by that particular bound.

Stochastic Optimization

The semi-discrete formulation is useful because the objective is an expectation with respect to α\alpha:

E(g)=XE(g,x)dα(x)=EX(E(g,X)),E(g,x):=gcˉ(x)+g,b.\mathcal{E}(g) = \int_\X E(g,x)\,\d\alpha(x) = \EE_X(E(g,X)), \qquad E(g,x)\eqdef g^{\bar c}(x)+\langle g,b\rangle .

Away from cell boundaries, the stochastic gradient of the integrand is

gE(g,x)=(bj1Lj(g)(x))j=1m,\nabla_g E(g,x) = \left(b_j-\mathbf{1}_{\mathcal{L}_j(g)}(x)\right)_{j=1}^m,

an unbiased estimator of E(g)\nabla\mathcal{E}(g) when cell boundaries have α\alpha-measure zero. One can therefore maximize the semi-dual without first discretizing α\alpha: the measure is used as a black box from which independent samples are drawn, a natural setup in high-dimensional statistics and machine learning.

Starting from g(0)=0g^{(0)}=0, stochastic gradient ascent draws xαx_\ell\sim\alpha and performs

g(+1):=g()+τgE(g(),x).g^{(\ell+1)} \eqdef g^{(\ell)} + \tau_\ell\nabla_g E(g^{(\ell)},x_\ell).

The stochastic supergradient has zero coordinate sum and preserves the gauge. For almost-sure stochastic-approximation convergence, one typically imposes

=0τ=,=0τ2<.\sum_{\ell=0}^{\infty}\tau_\ell=\infty, \qquad \sum_{\ell=0}^{\infty}\tau_\ell^2<\infty.

For example, one may use τ=τ0(1+/0)q\tau_\ell=\tau_0(1+\ell/\ell_0)^{-q} with 1/2<q11/2<q\leq1. The standard finite-horizon rate instead concerns averaged iterates.

Proof

Concavity and the squared-distance recursion yield

2τE ⁣[E(g)E(g())]Eg()g22Eg(+1)g22+τ2G2.2\tau\,\EE\!\left[\mathcal E(g^\star)-\mathcal E(g^{(\ell)})\right] \leq \EE\norm{g^{(\ell)}-g^\star}_2^2 - \EE\norm{g^{(\ell+1)}-g^\star}_2^2 + \tau^2G^2.

Summing, discarding the final squared distance, and using concavity at gˉL\bar g_L gives E(g)EE(gˉL)R2/(2τL)+τG2/2\mathcal E(g^\star)-\EE\mathcal E(\bar g_L) \le R^2/(2\tau L)+\tau G^2/2. Substitution of τ=R/(GL)\tau=R/(G\sqrt L) proves the claim.

This stochastic viewpoint is one of the main algorithmic advantages of the semi-discrete formulation Mérigot, 2011Genevay et al., 2016.

Optimal Quantization

Optimal quantization asks for the best discrete approximation of a measure by mm codepoints. It is the geometric core of vector quantization, compression and kk-means clustering.

Free Masses and Prescribed Weights

The classical problem optimizes both codepoint positions and their probabilities. For a measure α\alpha, define

Qm(α):=minY=(yj)j=1m,  bΔmWp(α,j=1mbjδyj).\mathcal{Q}_m(\alpha) \eqdef \min_{Y=(y_j)_{j=1}^m,\;b\in\simplex_m} \Wass_p\left(\alpha,\sum_{j=1}^m b_j\delta_{y_j}\right).

This problem is classical in approximation theory and information theory Graf & Luschgy, 2000Lloyd, 1982.

The equal-weight case, bj=1/mb_j=1/m, prescribes the weights and is treated at the end of this section.

Proof

Enclose Ω\Omega in a cube and subdivide it into kdmk^d\le m congruent cubes, where k=m1/dk=\lfloor m^{1/d}\rfloor. Placing one codepoint in each nonempty cube gives the upper bound.

For the lower bound, fix any set YY of mm codepoints and write dY(x)=minjxyjd_Y(x)=\min_j\norm{x-y_j}. Since the density is bounded above, the mass of the tt-neighborhood of YY has mass at most ρ+mωdtd\rho_+m\omega_dt^d. For t0=(2ρ+mωd)1/dt_0=(2\rho_+m\omega_d)^{-1/d}, one has α({dY>t})1/2\alpha(\{d_Y>t\})\ge1/2 for 0<t<t00<t<t_0. Hence

dY(x)pdα(x)=0+ptp1α({dY>t})dtt0p2cmp/d.\int d_Y(x)^p\,\d\alpha(x) = \int_0^{+\infty} p t^{p-1}\alpha(\{d_Y>t\})\,\d t \ge \frac{t_0^p}{2} \simeq c m^{-p/d}.

Taking the pp-th root and minimizing over YY proves the lower bound.

This deterministic rate mirrors the empirical optimal-transport sample-complexity rate: both are governed by the spacing m1/dm^{-1/d} of points in dimension dd. Quantization is best-case and deterministic, while empirical OT is random, but both display the same curse of dimensionality. Zador’s theorem further identifies the sharp asymptotic constant and limiting codepoint density Graf & Luschgy, 2000.

For fixed codepoints YY, the powered cost bWpp(α,jbjδyj)b\mapsto\Wass_p^p(\alpha,\sum_jb_j\delta_{y_j}) is convex. Its pp-th root Wp\Wass_p need not be convex. The dependence on YY is nonconvex and is generally computationally hard. The rest of this section distinguishes the free-mass Lloyd reduction from the fixed-weight geometry underlying finite-particle W2\mathcal W_2 gradient flows.

Lloyd Algorithm

The computational appeal of quantization comes from splitting the nonconvex search over sites into two elementary operations. For fixed sites, the optimal assignment is purely local: each point is sent to one of its nearest sites, and the resulting cells are Voronoi cells. This is the assignment step behind Lloyd’s algorithm and the kk-means method.

Proof

For any coupling between α\alpha and a measure supported on YY, the conditional destination of a point xx belongs to YY, so its conditional cost is at least minjc(x,yj)\min_j c(x,y_j). Integrating gives the lower bound. Conversely, choose a measurable nearest-codepoint map TY(x)arg minjc(x,yj)T_Y(x)\in\operatorname*{arg\,min}_j c(x,y_j), breaking ties measurably, and set bj=α(TY1(yj))b_j=\alpha(T_Y^{-1}(y_j)). Then (TY)α=jbjδyj(T_Y)_\sharp\alpha=\sum_j b_j\delta_{y_j} and the induced transport reaches the displayed lower bound.

Consequently, the quantization energy can be written in nearest-centroid form:

Qm(α)p=minYF(Y),F(Y):=Xmin1jmc(x,yj)dα(x).\mathcal{Q}_m(\alpha)^p = \min_Y \mathcal{F}(Y), \qquad \mathcal{F}(Y) \eqdef \int_\X \min_{1\le j\le m} c(x,y_j)\,\d\alpha(x).

At a differentiability point of this energy, any local minimizer with nonempty cells satisfies the centroid condition

yjarg minyVj(Y)c(x,y)dα(x).y_j \in \operatorname*{arg\,min}_{y} \int_{\mathcal{V}_j(Y)} c(x,y)\,\d\alpha(x).

For the squared Euclidean cost, this becomes

yj=Vj(Y)xdα(x)Vj(Y)dα.y_j = \frac{\int_{\mathcal{V}_j(Y)} x\,\d\alpha(x)} {\int_{\mathcal{V}_j(Y)} \d\alpha}.

Lloyd’s algorithm, also known as the kk-means algorithm, iterates this fixed point: assign points to nearest sites, then replace each site by the centroid of its cell Lloyd, 1982. The assignment and centroid steps each minimize the appropriate block, so the objective cannot increase. Nonconvexity means this does not guarantee a global minimizer. For a finite data set with squared Euclidean loss, kk-means++ gives an expected logarithmic approximation guarantee Arthur & Vassilvitskii, 2007.

Continuous Lloyd Flow

There is also an infinitesimal version of Lloyd’s fixed point, but it should first be understood on finite labelled configurations. Assume that c(x,y)=xy2c(x,y)=\norm{x-y}^2 and that α\alpha does not charge Voronoi boundaries. For a configuration YY, define, on nonempty cells,

aj(Y)=α(Vj(Y)),bj(Y)=1aj(Y)Vj(Y)xdα(x)a_j(Y)=\alpha(\mathcal V_j(Y)), \qquad b_j(Y)=\frac{1}{a_j(Y)} \int_{\mathcal V_j(Y)}x\,\d\alpha(x)

as the cell mass and centroid. Empty cells are singular points of the vector field; one either freezes them, as in the algorithm below, or reseeds them. The relaxed step

yj(k+1)=yj(k)+τ(bj(Y(k))yj(k)),0<τ1,y_j^{(k+1)} = y_j^{(k)}+\tau\big(b_j(Y^{(k)})-y_j^{(k)}\big), \qquad 0<\tau\le 1,

is an explicit-Euler step for the cell-mass preconditioned gradient flow of the quantization energy F\mathcal F,

y˙j(t)=bj(Yt)yj(t).\dot y_j(t)=b_j(Y_t)-y_j(t).

Indeed, at differentiability points of F\mathcal F, the envelope theorem gives

yjF(Y)=2Vj(Y)(yjx)dα(x)=2aj(Y)(yjbj(Y)),\nabla_{y_j}\mathcal F(Y) = 2\int_{\mathcal V_j(Y)}(y_j-x)\d\alpha(x) = 2a_j(Y)(y_j-b_j(Y)),

so that

y˙j(t)=12aj(Yt)yjF(Yt).\dot y_j(t) = -\frac{1}{2a_j(Y_t)}\nabla_{y_j}\mathcal F(Y_t).

Equivalently, this is the gradient flow of F\mathcal F for the site metric gY(U,V)=2jaj(Y)uj,vjg_Y(U,V)=2\sum_j a_j(Y)\langle u_j,v_j\rangle; it is not the unweighted Euclidean gradient flow unless the masses are absorbed into the time step. Along smooth portions of the flow,

ddtF(Yt)=2jaj(Yt)bj(Yt)yj(t)20.\frac{\d}{\d t}\mathcal F(Y_t) = -2\sum_j a_j(Y_t)\|b_j(Y_t)-y_j(t)\|^2 \le 0.

If ηt=jwjδyj(t)\eta_t=\sum_j w_j\delta_{y_j(t)} carries fixed positive weights, independent of the Voronoi masses aj(Yt)a_j(Y_t), this labelled particle ODE is equivalently a weak continuity equation,

tηt+div(vtηt)=0,vt(yj(t))=bj(Yt)yj(t),\partial_t\eta_t+\operatorname{div}(v_t\eta_t)=0, \qquad v_t(y_j(t))=b_j(Y_t)-y_j(t),

in the sense of the measure evolutions introduced in Chapter Paragraph. The weights wjw_j in this transport equation are auxiliary weights for the moving labelled particles; they are not the Voronoi masses used to define the quantization energy. If one records instead the free-weight projection

νYt=jaj(Yt)δyj(t),\nu_{Y_t}=\sum_j a_j(Y_t)\delta_{y_j(t)},

then, formally,

tνYt+div(vtνYt)=ja˙j(Yt)δyj(t),vt(yj(t))=y˙j(t).\partial_t\nu_{Y_t}+\operatorname{div}(v_t\nu_{Y_t}) = \sum_j\dot a_j(Y_t)\delta_{y_j(t)}, \qquad v_t(y_j(t))=\dot y_j(t).

Thus the free-weight quantizer evolves by a balance equation, not by pure transport. This is why the construction is intrinsically finite-dimensional: Voronoi cells, centroids and labels define the velocity, and a canonical extension to arbitrary measures is not obtained by replacing YY with the support of a measure. Indeed, any measure with dense support would have zero support-distance quantization error.

Mean-Field Limit and Ultrafast Diffusion

There is nevertheless a precise high-resolution continuum theory when the number mm of codepoints tends to infinity. If α=ρdx\alpha=\rho\,\d x, the limiting Eulerian variable is the density σ\sigma of sites, meaning heuristically that mσ(x)dxm\sigma(x)\,\d x codepoints lie in dx\d x. Thus the limit is m+m\to+\infty, not a limit in the exponent of the PDE. In one dimension, Caglioti, Golse and Iacobelli embed the ordered particle configuration in L2(0,1)L^2(0,1) and prove quantitative convergence of the discrete gradient flow toward a limiting flow Caglioti et al., 2015. A perturbative two-dimensional analysis around the optimal hexagonal lattice is developed in Caglioti et al., 2018. For pp-quantization in dimension dd, set r=p/dr=p/d, so r=2/dr=2/d for the quadratic cost used in this section, and write Fp(Y)=minjxyjpdα(x)\mathcal F_p(Y)=\int\min_j\norm{x-y_j}^p\,\d\alpha(x). For well-prepared configurations whose empirical site distributions converge to σdx\sigma\,\d x, the rescaled energy is described, up to a universal cell-shape constant, by

Gρ(σ):=Ωρ(x)σ(x)rdx,Ωσdx=1,\mathcal G_\rho(\sigma) \eqdef \int_\Omega \rho(x) \sigma(x)^{-r}\,\d x, \qquad \int_\Omega \sigma\,\d x=1,

Formally,

mrFp(Y(m))Cp,dGρ(σ),mrQm(α)pCp,dminσGρ(σ).m^r\mathcal F_p(Y^{(m)})\simeq C_{p,d}\mathcal G_\rho(\sigma), \qquad m^r\mathcal Q_m(\alpha)^p \longrightarrow C_{p,d}\min_\sigma\mathcal G_\rho(\sigma).

Since the first variation is rρσr1-r\rho\sigma^{-r-1}, the formal W2\mathcal W_2-gradient flow is the weighted ultrafast diffusion equation

tσ=rdiv ⁣(σ ⁣(ρσr+1)),\partial_t \sigma = -r\,\operatorname{div}\!\left( \sigma\nabla\!\left(\frac{\rho}{\sigma^{r+1}}\right) \right),

with periodic or no-flux boundary conditions. Iacobelli studies the associated one-dimensional very-fast-diffusion equation and its convergence to equilibrium Iacobelli, 2019; Iacobelli, Patacchini and Santambrogio then use the JKO scheme and Wasserstein-gradient-flow tools to prove well-posedness, regularity estimates and convergence for a multidimensional weighted version Iacobelli et al., 2019. When ρ>0\rho>0, set ω=ρ1/(r+1)\omega=\rho^{1/(r+1)} and u=σ/ωu=\sigma/\omega. The same equation becomes

tu=r+1ωdiv ⁣(ω(ur)),\partial_t u = -\frac{r+1}{\omega}\operatorname{div}\!\left(\omega\nabla(u^{-r})\right),

which makes the negative exponent, hence the ultrafast-diffusion character, explicit. Its stationary site density is proportional to ρd/(d+p)\rho^{d/(d+p)}.

Figure Div shows the relaxed Lloyd flow in a two-dimensional toy problem.

<IPython.core.display.Image object>

Relaxed Lloyd flow from a source Gaussian-mixture initialization toward a different target Gaussian-mixture density. The blue contours and shading show the target density α\alpha, while the colored disks are the moving codepoints initialized from the source mixture. The faint curves trace the labelled sites under the explicit-Euler Lloyd ODE. The right panel displays the relative quantization energy, illustrating the monotone decay of the objective along the relaxed iterations.

Figure Div follows the associated Voronoi cells and generators through Lloyd iterations, making the decrease of the quantization energy visible.

<IPython.core.display.Image object>

Lloyd quantization for the same continuous density and twenty-one initial sites as the Laguerre-cell figure. The red contours show the density α\alpha, while the colored disks are the current codepoints and have the same colors as their Voronoi cells. The iterations move the initially left-located sites toward the high-density region and reshape the cells according to centroidal Voronoi geometry.

The interactive demo separates the nonconvex geometry from the fixed-point update: increase the iteration counter and watch sites migrate toward the density before settling into a local centroidal configuration.

Interactive panel. Use the iteration and site controls to compare Lloyd-style quantization steps with the semi-discrete geometry.

Quantization with Fixed Equal Weights

The free-mass formulation above optimizes the positions and the weights of the atoms. A different problem is obtained by prescribing the weights. In the equal-weight case, set

νY:=1mj=1mδyj,Feq(Y):=12W22(α,νY),\nu_Y\eqdef \frac1m\sum_{j=1}^m\delta_{y_j}, \qquad \mathcal F_{\rm eq}(Y) \eqdef \frac12\mathcal W_2^2(\alpha,\nu_Y),

and minimize only over the positions Y=(yj)jY=(y_j)_j. Assume that the sites are distinct, that α\alpha has a density, and that cell boundaries have zero α\alpha-mass. Let Cj(Y)C_j(Y) be the Laguerre cell transported to yjy_j, so that α(Cj(Y))=1/m\alpha(C_j(Y))=1/m, and define its centroid

xˉj(Y):=mCj(Y)xdα(x).\bar x_j(Y) \eqdef m\int_{C_j(Y)} x\,\d\alpha(x).

At differentiability points, the envelope theorem gives

yjFeq(Y)=1m(yjxˉj(Y)).\nabla_{y_j}\mathcal F_{\rm eq}(Y) = \frac1m\bigl(y_j-\bar x_j(Y)\bigr).

Locally, while labels remain optimally matched, the W2\mathcal W_2 metric on equal-weight empirical measures induces the particle metric gY(U,V)=m1juj,vjg_Y(U,V)=m^{-1}\sum_j\langle u_j,v_j\rangle. Hence the associated W2\mathcal W_2 gradient flow is the coupled system

y˙j(t)=xˉj(Yt)yj(t),j=1,,m.\dot y_j(t) = \bar x_j(Y_t)-y_j(t), \qquad j=1,\ldots,m.

Equivalently, νYt\nu_{Y_t} satisfies a continuity equation with velocity vt(yj(t))=xˉj(Yt)yj(t)v_t(y_j(t))=\bar x_j(Y_t)-y_j(t). This is the so-called finite-particle W2\mathcal W_2 gradient-flow viewpoint developed more systematically in Chapter Paragraph; the fixed-weight cells are Laguerre cells rather than the free-mass Voronoi cells used by Lloyd’s method.

Equal-Weight Quantization on the Line

The following classical scalar quantization result gives the precise form of the inverse-CDF rule for equal-weight quadratic quantization Graf & Luschgy, 2000. The atoms are not exactly the midpoint quantiles in general; they are the averages of the quantile function over equal mass bins. Midpoint inverse-CDF samples are nevertheless asymptotically equivalent and are often the most convenient rule in numerical examples.

Proof

After sorting the atoms, the quantile formula for W2\mathcal W_2 gives

W22(α,1mi=1mδyi)=i=1mIiQ(u)yi2du.\mathcal W_2^2 \left(\alpha,\frac1m\sum_{i=1}^m\delta_{y_i}\right) = \sum_{i=1}^m \int_{I_i}|Q(u)-y_i|^2\,\d u.

The minimization decouples over the intervals IiI_i, and the best constant approximation of QQ on IiI_i is its average. These averages are nondecreasing because QQ is nondecreasing, so they satisfy the sorting constraint. Strict convexity gives uniqueness.

Denote by QˉIi=mIiQ(u)du\bar Q_{I_i}=m\int_{I_i}Q(u)\,\d u the interval average. If QQ is C1C^1, set h=1/mh=1/m and write Ii=(ai,ai+h]I_i=(a_i,a_i+h]. Uniform Taylor expansion gives, for v[0,1]v\in[0,1],

Q(ai+hv)=Q(ai)+hvQ(ai)+hri(v),maxisupv[0,1]ri(v)0.Q(a_i+hv) = Q(a_i)+hvQ'(a_i)+h\,r_i(v), \qquad \max_i\sup_{v\in[0,1]} |r_i(v)|\to0.

Subtracting the average over v[0,1]v\in[0,1] and integrating gives

IiQ(u)QˉIi2du=h312Q(ai)2+o(h3),\int_{I_i}|Q(u)-\bar Q_{I_i}|^2\,\d u = \frac{h^3}{12}|Q'(a_i)|^2+o(h^3),

uniformly in ii. Summing over ii yields a Riemann sum for 11201Q(u)2du\frac1{12}\int_0^1 |Q'(u)|^2\,\d u.

Thus the common deterministic rule m1iδQ((i1/2)/m)m^{-1}\sum_i\delta_{Q((i-1/2)/m)} should be read as a midpoint approximation of the optimal bin-average formula. Orthogonal projection onto constants shows that it has the same leading squared error under the same smoothness assumptions; for the uniform law on [0,1][0,1], both rules coincide and give the regular grid yi=(i1/2)/my_i=(i-1/2)/m. Random sampling has a different asymptotic regime.

Proof

Let Q^m\widehat Q_m be the empirical quantile function. The one-dimensional formula gives

W22(α,α^m)=01Q^m(u)Q(u)2du.\mathcal W_2^2(\alpha,\widehat\alpha_m) = \int_0^1|\widehat Q_m(u)-Q(u)|^2\,\d u.

Write Xi=Q(Ui)X_i=Q(U_i) with UiU_i i.i.d. uniform on [0,1][0,1], and let U^m1\widehat U_m^{-1} be the empirical quantile function of the UiU_i. Then Q^m=QU^m1\widehat Q_m=Q\circ \widehat U_m^{-1}. The classical uniform quantile-process theorem Vaart & Wellner, 1996Bobkov & Ledoux, 2019 gives

m(U^m1Id)lawBin L2(0,1).\sqrt m\,(\widehat U_m^{-1}-\operatorname{Id}) \overset{\mathrm{law}}{\longrightarrow} -B \quad\text{in }L^2(0,1).

Uniform continuity of QQ' and the functional delta method give

m(Q^mQ)lawBQin L2(0,1).\sqrt m\,(\widehat Q_m-Q) \overset{\mathrm{law}}{\longrightarrow} -BQ' \quad\text{in }L^2(0,1).

Since BB and B-B have the same law, the sign disappears in the squared L2L^2 norm. The continuous mapping theorem gives the distributional convergence. Standard fourth-moment bounds for the uniform quantile process give uniform integrability, hence convergence of expectations. Since E[B(u)2]=u(1u)\mathbb E[B(u)^2]=u(1-u), Fubini’s theorem gives the displayed expectation limit.

Combining these propositions gives a sharp contrast between optimal placement and random placement on the line. Deterministic equal-weight quantization has squared error of order m2m^{-2}, hence W2\mathcal W_2 error of order m1m^{-1}, while i.i.d. empirical sampling has expected squared error of order m1m^{-1}, hence root-mean-square W2\mathcal W_2 error of order m1/2m^{-1/2}. This is consistent with broader empirical OT sample-complexity theory Dereich et al., 2013Fournier & Guillin, 2015Weed & Bach, 2019.

Figure Div illustrates both parts of this comparison: optimal atoms are uniform in quantile coordinates, and their error decays one power of mm faster than the root-mean-square empirical error.

<IPython.core.display.Image object>

One-dimensional equal-weight quantization in quantile coordinates. Left: for a smooth positive density on [0,1][0,1], the colored atoms are bin averages of the inverse CDF over equal quantile intervals, while the gray atoms show one i.i.d. empirical draw with the same number of particles. Right: expected squared W2\mathcal W_2 errors. The deterministic bin averages and midpoint quantiles follow the m2m^{-2} squared-error law, whereas i.i.d. empirical measures follow the slower m1m^{-1} expected squared-error law.

Interactive panel. Change the one-dimensional law, the number of atoms and the Monte Carlo seed to compare optimal equal-weight quantization with random empirical sampling. The right panel recomputes the squared W2\Wass_2 error curves from the quantile formula.

Wasserstein-1 Norm

The W1\Wass_1 distance has an especially transparent dual: the admissible potentials are exactly 1-Lipschitz test functions. This makes W1\Wass_1 the meeting point between transport, PDE formulations and weak norms on signed measures.

c-Transform for Wasserstein-1

Assume that dd is a distance on X=Y\X=\Y and take the ground cost c(x,y)=d(x,y)c(x,y)=d(x,y).

Proof

First suppose f=gcf=g^c for some gg. For x,yXx,y\in\X,

f(x)f(y)=infz[d(x,z)g(z)]infz[d(y,z)g(z)]supzd(x,z)d(y,z)d(x,y),|f(x)-f(y)| = \left| \inf_z [d(x,z)-g(z)] - \inf_z [d(y,z)-g(z)] \right| \le \sup_z |d(x,z)-d(y,z)| \le d(x,y),

where the last inequality is the reverse triangle inequality. Thus Lip(f)1\Lip(f)\le1.

If Lip(f)1\Lip(f)\le1, then f(x)f(y)+d(x,y)f(x)\le f(y)+d(x,y), so d(x,y)f(x)f(y)d(x,y)-f(x)\ge -f(y) for all xx, hence fc(y)f(y)f^c(y)\ge -f(y). Taking x=yx=y gives fc(y)f(y)f^c(y)\le -f(y). Therefore fc=ff^c=-f. Applying the same property to f-f gives (f)c=f(-f)^c=f, so every 1-Lipschitz function is cc-concave.

By the preceding proposition, a closed dual pair has the form (f,f)(f,-f) with Lip(f)1\Lip(f)\le1. The Kantorovich dual therefore becomes the Kantorovich--Rubinstein formula

W1(α,β)=maxf{Xfd(αβ):Lip(f)1}=:αβW1.\Wass_1(\alpha,\beta) = \max_f \left\{ \int_\X f\,\d(\alpha-\beta) : \Lip(f)\le1 \right\} =: \norm{\alpha-\beta}_{W_1}.

This expression depends only on the signed measure ξ=αβ\xi=\alpha-\beta. On compact X\X, the same supremum defines the Kantorovich--Rubinstein norm on finite signed measures with zero mass Kantorovich & Rubinstein, 1958. Homogeneity and the triangle inequality are immediate, while definiteness follows because Lipschitz functions separate finite Radon measures. On a noncompact pointed space, one uses normalized Lipschitz functions and measures with finite first moment.

For a discrete signed measure αβ=krkδzk\alpha-\beta=\sum_k r_k\delta_{z_k} with krk=0\sum_k r_k=0,

W1(α,β)=max(fk)k{kfkrk:fkfd(zk,z)for all k,}.\Wass_1(\alpha,\beta) = \max_{(f_k)_k} \left\{ \sum_k f_k r_k : |f_k-f_\ell|\le d(z_k,z_\ell) \quad\text{for all }k,\ell \right\}.

This finite-dimensional linear program can be solved by generic interior-point or first-order methods. If NN support points are involved, however, it still contains O(N2)O(N^2) Lipschitz constraints, mirroring the O(nm)O(nm) coupling variables of the original discrete Kantorovich LP; the dual formulation alone does not remove the all-pairs structure. The gain comes on structured metric spaces where the distance is generated locally: it is then enough to impose Lipschitz inequalities on neighboring pairs, because summing along paths recovers the constraints between arbitrary points. The one-dimensional ordered case is the first example; the graph-geodesic case is described later in Proposition Proposition: W1\Wass_1 and Beckmann Flow on a Graph.

When d(x,y)=xyd(x,y)=|x-y| on R\RR, ordering the support points z1z2z_1\le z_2\le\cdots reduces the constraints to neighboring pairs:

W1(α,β)=max(fk)k{kfkrk:fk+1fkzk+1zkfor all k}.\Wass_1(\alpha,\beta) = \max_{(f_k)_k} \left\{ \sum_k f_k r_k : |f_{k+1}-f_k|\le z_{k+1}-z_k \quad\text{for all }k \right\}.

In one dimension this is equivalent to the cumulative formula given in the one-dimensional transport section.

Wasserstein-1 on Euclidean Spaces

In Euclidean space, the Lipschitz constraint has a local differential form and its dual variable is a flux. Let α,β\alpha,\beta have finite first moments and set ξ=αβ\xi=\alpha-\beta. Rademacher’s theorem gives

W1(α,β)=supfWloc1,(Rd){Rdfdξ:fL1}.\Wass_1(\alpha,\beta) = \sup_{f\in W_{\mathrm{loc}}^{1,\infty}(\RR^d)} \left\{ \int_{\RR^d} f\,\d\xi : \norm{\nabla f}_{L^\infty}\le1 \right\}.

The flux need not have a Lebesgue density: Dirac-to-Dirac transport already produces a measure concentrated on a segment. Let mM(Rd;Rd)m\in\mathcal M(\RR^d;\RR^d) be a vector-valued Radon measure, let m|m| denote its total variation, and define divm,φ=φ,dm\langle\operatorname{div}m,\varphi\rangle=-\int\langle\nabla\varphi,\d m\rangle.

Proof

For every feasible mm and smooth 1-Lipschitz ff, fd(αβ)=f,dmm(Rd)\int f\,\d(\alpha-\beta)=-\int\langle\nabla f,\d m\rangle\le|m|(\RR^d). The Lipschitz dual gives one inequality. Conversely, if π\pi is an optimal plan, define

ζ,dm= ⁣01ζ((1t)x+ty),yxdtdπ(x,y).\int\langle\zeta,\d m\rangle = \int\!\int_0^1 \left\langle\zeta((1-t)x+ty),y-x\right\rangle \d t\,\d\pi(x,y).

The fundamental theorem of calculus gives divm=αβ\operatorname{div}m=\alpha-\beta, and m(Rd)xydπ=W1(α,β)|m|(\RR^d)\le\int\norm{x-y}\,\d\pi=\Wass_1(\alpha,\beta).

This is the Beckmann formulation Beckmann, 1952Santambrogio, 2015. If m=wdxm=w\,\d x, its cost is w(x)dx\int\norm{w(x)}\,\d x. Outside the source and target mass, divm=0\operatorname{div}m=0, expressing local conservation.

Once discretized with finite elements, the dual Lipschitz problem and the Beckmann problem become nonsmooth convex optimization problems. The same formulation extends to complete Riemannian manifolds by replacing straight segments with minimizing geodesics and using tangent-valued Radon measures.

Graph Distances and Beckmann Flows

Finite graphs give a simple discrete instance where a metric is generated by local moves, so the all-pairs Lipschitz constraints collapse to edge constraints.

This graph distance turns W1\Wass_1 into a finite-dimensional flow problem.

Proof

The edge constraints imply the all-pairs bound by summing along paths and minimizing over paths. Conversely, a 1-Lipschitz function for dGd_G satisfies fifjdG(i,j)e|f_i-f_j|\le d_G(i,j)\le\ell_e on every edge. The first equality is therefore the Kantorovich--Rubinstein formula on the metric space (V,dG)(V,d_G).

For the second equality, write the graph Beckmann problem and dualize its equality constraint with a potential ff:

infmeeme+supfifi(ri(divGm)i).\inf_m \sum_e \ell_e|m_e| + \sup_f \sum_i f_i \left(r_i-(\operatorname{div}_G m)_i\right).

Using divG=G\operatorname{div}_G=-\nabla_G^*, the coupling term is eme(Gf)e\sum_e m_e(\nabla_G f)_e. The minimization over each scalar flow mem_e is finite exactly when (Gf)ee|(\nabla_G f)_e|\le\ell_e, and is then equal to zero. The dual problem is the graph Lipschitz dual above. Strong duality holds because this is a finite-dimensional linear program with a nonempty feasible set: connectedness and iri=0\sum_i r_i=0 allow the signed surplus to be routed along paths.

Figure Div shows the optimal edge flux on both a quasi-regular and a nonuniform Delaunay graph, emphasizing that the Beckmann variables live only on graph edges.

<IPython.core.display.Image object>

Graph Beckmann formulation of W1\Wass_1 on a Delaunay graph. Red and blue disks encode the positive and negative parts of r=αβr=\alpha-\beta. Violet arrows display the signed edge flow mm: orientation gives the sign, width is proportional to me\sqrt{|m_e|}, and the flow satisfies the conservation constraint divGm=r\operatorname{div}_G m=r.

The interactive graph view lets the source and sink clusters move and changes the graph resolution. It makes the transshipment interpretation of W1\Wass_1 visible: signed mass is routed through local edges rather than matched only by straight source-to-target segments.

Interactive panel. Use the graph and demand controls to inspect how Wasserstein-1 transport becomes a flow problem on edges.

This graph formulation is the transshipment version of W1\Wass_1. It is the natural discrete analogue of the Beckmann formulation: gradients are edge differences, divergences are incidence-matrix balances, and geodesic distance is shortest-path length. It can be solved by min-cost flow methods on sparse graphs, while entropic or KL-projection variants lead to flow-Sinkhorn algorithms for graph W1\Wass_1 Beckmann, 1952Peyré, 2026.

References
  1. Bertsekas, D. P. (1992). Auction algorithms for network flow problems: a tutorial introduction. Computational Optimization and Applications, 1(1), 7–66.
  2. Bertsekas, D. P., & Eckstein, J. (1988). Dual coordinate step methods for linear network flow problems. Mathematical Programming, 42(1), 203–243.
  3. Aurenhammer, F., Hoffmann, F., & Aronov, B. (1998). Minkowski-type theorems and least-squares clustering. Algorithmica, 20(1), 61–76.
  4. Mérigot, Q. (2011). A multiscale approach to optimal transport. Computer Graphics Forum, 30(5), 1583–1592.
  5. Mérigot, Q. (2013). A comparison of two dual methods for discrete optimal transport. In Geometric science of information (pp. 389–396). Springer.
  6. Kantorovich, L., & Rubinstein, G. S. (1958). On a space of totally additive functions. Vestn Leningrad Universitet, 13, 52–59.
  7. Beckmann, M. (1952). A continuous model of transportation. Econometrica, 20, 643–660.
  8. Mérigot, Q., & Thibert, B. (2020). Optimal Transport: Discretization and Algorithms. arXiv Preprint arXiv:2003.00855. 10.48550/arXiv.2003.00855
  9. Bertsekas, D. P. (1981). A new algorithm for the assignment problem. Mathematical Programming, 21(1), 152–171.
  10. Aurenhammer, F. (1987). Power diagrams: properties, algorithms and applications. SIAM Journal on Computing, 16(1), 78–96.
  11. Chan, T. M. (1996). Optimal output-sensitive convex hull algorithms in two and three dimensions. Discrete & Computational Geometry, 16(4), 361–368.
  12. Genevay, A., Cuturi, M., Peyré, G., & Bach, F. (2016). Stochastic optimization for large-scale optimal transport. Advances in Neural Information Processing Systems, 3440–3448.
  13. Graf, S., & Luschgy, H. (2000). Foundations of Quantization for Probability Distributions (Vol. 1730). Springer.
  14. Lloyd, S. (1982). Least Squares Quantization in PCM. IEEE Transactions on Information Theory, 28(2), 129–137.
  15. Arthur, D., & Vassilvitskii, S. (2007). k-means++: The Advantages of Careful Seeding. Proceedings of the Eighteenth Annual ACM-SIAM Symposium on Discrete Algorithms, 1027–1035.