Kantorovich relaxation turns OT into a linear program. Its dual exposes functions rather than couplings.
This is useful because dual potentials:
Discrete Kantorovich primal. For a\in\Sigma_n, b\in\Sigma_m and C\in\mathbb R^{n\times m}, \mathcal L_C(\textcolor{#c7372f}{a},\textcolor{#226db4}{b})= \min_{\textcolor{#7c5bbd}{P}\geq0} \langle C,\textcolor{#7c5bbd}{P}\rangle \quad\text{s.t.}\quad \textcolor{#7c5bbd}{P}\mathbb 1_m=\textcolor{#c7372f}{a}, \quad \textcolor{#7c5bbd}{P}^\top\mathbb 1_n=\textcolor{#226db4}{b}.
Discrete dual. \mathcal L_C(\textcolor{#c7372f}{a},\textcolor{#226db4}{b})= \max_{f\in\mathbb R^n,\ g\in\mathbb R^m} \langle f,\textcolor{#c7372f}{a}\rangle+\langle g,\textcolor{#226db4}{b}\rangle \quad\text{s.t.}\quad f_i+g_j\leq C_{i,j}.
The Lagrangian of the primal is \langle C,\textcolor{#7c5bbd}{P}\rangle+ \langle f,\textcolor{#c7372f}{a}-\textcolor{#7c5bbd}{P}\mathbb 1_m\rangle+ \langle g,\textcolor{#226db4}{b}-\textcolor{#7c5bbd}{P}^\top\mathbb 1_n\rangle.
Minimizing over P\geq0 gives a finite value if and only if C_{i,j}-f_i-g_j\geq0\quad\forall i,j.
This yields the dual constraints f_i+g_j\leq C_{i,j}.
Primal-dual contact. If P and (f,g) are optimal, then \textcolor{#7c5bbd}{P}_{i,j}>0\quad\Longrightarrow\quad f_i+g_j=C_{i,j}.
Dual variables are not just algebraic multipliers: they are certificates explaining which transport edges can be active.

Dual certificates identify the active transport pairs.
Kantorovich duality. On Polish spaces, for a lower-semicontinuous cost c bounded from below, \mathcal L_c(\textcolor{#c7372f}{\alpha},\textcolor{#226db4}{\beta}) = \sup_{f,g} \int f\,d\textcolor{#c7372f}{\alpha}+ \int g\,d\textcolor{#226db4}{\beta} \quad\text{s.t.}\quad f(\textcolor{#c7372f}{x})+g(\textcolor{#226db4}{y})\leq c(\textcolor{#c7372f}{x},\textcolor{#226db4}{y}).
Here “Polish” means complete and separable after choosing a compatible metric. This is the infinite-dimensional analogue of the finite LP dual.
For quadratic cost in one dimension, optimal potentials encode the monotone transport map through their derivatives.

In one dimension, the contact condition can be read directly from the potential curves.
c-transform. For a function f on the source space X, define f^c(\textcolor{#226db4}{y}) = \inf_{\textcolor{#c7372f}{x}\in \textcolor{#c7372f}{X}} \big(c(\textcolor{#c7372f}{x},\textcolor{#226db4}{y})-f(\textcolor{#c7372f}{x})\big). Similarly, for g on the target space Y, g^{\bar c}(\textcolor{#c7372f}{x}) = \inf_{\textcolor{#226db4}{y}\in \textcolor{#226db4}{Y}} \big(c(\textcolor{#c7372f}{x},\textcolor{#226db4}{y})-g(\textcolor{#226db4}{y})\big).
The dual can be optimized by replacing one potential by the largest admissible companion.
The c-transform removes one dual variable: \mathcal L_c(\textcolor{#c7372f}{\alpha},\textcolor{#226db4}{\beta}) = \sup_f \left\{ \int f\,d\textcolor{#c7372f}{\alpha}+\int f^c\,d\textcolor{#226db4}{\beta} \right\}.
In the discrete case this is \mathcal L_C(\textcolor{#c7372f}{a},\textcolor{#226db4}{b})= \max_{f\in\mathbb R^n} \left\{ \langle f,\textcolor{#c7372f}{a}\rangle+\langle f^C,\textcolor{#226db4}{b}\rangle \right\}, \qquad f^C_j=\min_i(C_{i,j}-f_i).
This is the formula behind alternating c-transform updates.
Reduction to one potential. At optimum one can impose g=f^c, \qquad f=g^{\bar c}. Thus dual potentials are fixed points of alternating c-transforms, up to non-uniqueness.

The identity f^{ccc}=f^c explains why alternating c-transforms stabilize.
Closure identity. For the c-transform, one always has f^{ccc}=f^c, with the appropriate alternation between X and Y.
Proof idea: the inequality f^{cc}\geq f implies f^{ccc}\leq f^c, while applying the defining inequality of the c-transform in the reverse direction gives f^{ccc}\geq f^c.
The c-transform closes a potential under the constraint f(\textcolor{#c7372f}{x})+g(\textcolor{#226db4}{y})\leq c(\textcolor{#c7372f}{x},\textcolor{#226db4}{y}). Changing the cost exponent changes the envelope selected by the dual constraint.
Here c_p(\textcolor{#c7372f}{x},\textcolor{#226db4}{y})=|\textcolor{#c7372f}{x}-\textcolor{#226db4}{y}|^p and the slider controls p.
Alternating minimization in the dual repeatedly closes potentials by c-transforms:
Alternating c-transform closure. Input: initial source potential f.
Output: dual feasible potentials (f,g) after stabilization.
Useful warning: this reveals the dual structure, but it is not by itself a fast generic OT solver.
Alternating envelopes implement the coordinate ascent geometry of the dual.
The source and target closures can be viewed as envelopes of admissible potentials.


The envelope picture explains why c-concave potentials are the stable objects.
Lipschitz compactness principle. When the cost is Lipschitz on compact supports, optimal potentials can be chosen uniformly Lipschitz. Arzela-Ascoli compactness then yields an optimizer.
This proof idea is important because the dual problem is over functions, not finite-dimensional vectors.
For c(\textcolor{#c7372f}{x},\textcolor{#226db4}{y})=d(\textcolor{#c7372f}{x},\textcolor{#226db4}{y}), the dual simplifies dramatically.
Wasserstein-1 duality. W_1(\textcolor{#c7372f}{\alpha},\textcolor{#226db4}{\beta})= \sup_{\operatorname{Lip}(f)\leq1} \int f\,d(\textcolor{#c7372f}{\alpha}-\textcolor{#226db4}{\beta}). Here \operatorname{Lip}(f)=\sup_{\textcolor{#c7372f}{x}\neq \textcolor{#226db4}{y}}\frac{|f(\textcolor{#c7372f}{x})-f(\textcolor{#226db4}{y})|}{d(\textcolor{#c7372f}{x},\textcolor{#226db4}{y})}.
The witness f is a 1-Lipschitz discriminator between the two measures.
Norm viewpoint. On signed measures with zero total mass, \|\textcolor{#c7372f}{\alpha}-\textcolor{#226db4}{\beta}\|_{W_1}:=W_1(\textcolor{#c7372f}{\alpha},\textcolor{#226db4}{\beta}) is a norm whenever the ground metric is fixed.
This places W_1 among dual norms defined by classes of test functions.
Integral probability metric. Given a symmetric class of test functions \mathcal F, D_\mathcal F(\textcolor{#c7372f}{\alpha},\textcolor{#226db4}{\beta})= \sup_{f\in\mathcal F}\int f\,d(\textcolor{#c7372f}{\alpha}-\textcolor{#226db4}{\beta}).
Examples include total variation, Wasserstein-1, bounded-Lipschitz distances, and MMDs.
Changing the witness class changes the geometry of the discrepancy.

Different function classes produce different witnesses and therefore different notions of discrepancy.
The same signed mass can be tested by very different admissible witnesses.
For smooth f on Euclidean domains, \operatorname{Lip}(f)\leq1 is equivalent to \|\nabla f(x)\|\leq1.
This connects W_1 to Beckmann’s continuous flux formulation: W_1(\textcolor{#c7372f}{\alpha},\textcolor{#226db4}{\beta})= \min_{\textcolor{#7c5bbd}{m}}\int \|\textcolor{#7c5bbd}{m}(\textcolor{#c7372f}{x})\|\,d\textcolor{#c7372f}{x} \quad\text{s.t.}\quad \operatorname{div}\textcolor{#7c5bbd}{m}=\textcolor{#c7372f}{\alpha}-\textcolor{#226db4}{\beta}.
The same Beckmann idea extends beyond flat Euclidean grids by replacing gradients and divergence with their geometric counterparts.
Geometric message. On meshes, surfaces, or subdomains, W_1 can be computed as a flow constrained by the geometry. Graph discretizations are the simplest finite-dimensional version of this idea.
This is the setting of surface and subdomain W_1 solvers used in geometry processing, including the Solomon-Rustamov-Guibas-Butscher line of work. Graph flows are the simplest discrete proxy for this geometric formulation.
On a graph, the Beckmann formulation becomes a sparse network-flow problem over edges: \min_{\textcolor{#7c5bbd}{q}}\sum_{e} w_e|\textcolor{#7c5bbd}{q_e}| \quad\text{s.t.}\quad D\textcolor{#7c5bbd}{q}=\textcolor{#c7372f}{a}-\textcolor{#226db4}{b}. Here D is the signed vertex-edge incidence matrix and \textcolor{#7c5bbd}{q_e} is the oriented mass flux on edge e.
This can be much smaller than a full pairwise Kantorovich LP.
The graph formulation turns W1 into a network flow problem.
The edge flow is the sparse object that transports positive mass to negative mass through the graph geometry.
Example: Wasserstein GAN. A generator g_\theta can be trained by minimizing \min_\theta W_1(\textcolor{#c7372f}{(g_\theta)_\#\zeta},\textcolor{#226db4}{\beta}) = \min_\theta\sup_{\operatorname{Lip}(f)\leq1} \mathbb E f(\textcolor{#c7372f}{g_\theta(Z)})-\mathbb E f(\textcolor{#226db4}{Y}). The discriminator is a parametrized approximation of a 1-Lipschitz Kantorovich potential.
This is the machine-learning face of Kantorovich-Rubinstein duality.

Semi-discrete OT. Let \alpha be a continuous probability measure on \mathbb R^d and \textcolor{#226db4}{\beta}=\sum_{j=1}^m b_j\delta_{\textcolor{#226db4}{y_j}} be discrete. For quadratic cost, one seeks a partition of the source domain whose cells have masses b_j.
The unknown is not a full coupling matrix but a weighted spatial partition.
Laguerre cell. For target sites y_j and weights g_j, the cell associated with j is L_j(g)=\{\textcolor{#c7372f}{x}: \|\textcolor{#c7372f}{x}-\textcolor{#226db4}{y_j}\|^2-g_j\leq \|\textcolor{#c7372f}{x}-\textcolor{#226db4}{y_k}\|^2-g_k\quad\forall k\}.
The semi-discrete map sends every x\in L_j(g) to y_j. Optimal weights are characterized by the mass constraints \textcolor{#c7372f}{\alpha}(L_j(g))=\textcolor{#226db4}{b_j},\qquad j=1,\ldots,m.
Changing a target weight geometrically expands or shrinks its cell.

Voronoi cells become Laguerre cells when weights are introduced. The weights tune cell masses.
Changing g_j shifts the additive power distance \|\textcolor{#c7372f}{x}-\textcolor{#226db4}{y_j}\|^2-g_j. Increasing g_j makes site j more attractive and expands its Laguerre cell.
For quadratic cost, the dual can be written as a concave maximization over weights: \max_{g\in\mathbb R^m} \int \min_j\big(\|\textcolor{#c7372f}{x}-\textcolor{#226db4}{y_j}\|^2-g_j\big)\,d\textcolor{#c7372f}{\alpha}(\textcolor{#c7372f}{x}) + \sum_{j=1}^m \textcolor{#226db4}{b_j} g_j.
Gradient. The gradient component is \frac{\partial}{\partial g_j}=\textcolor{#226db4}{b_j}-\textcolor{#c7372f}{\alpha}(L_j(g)). Thus dual ascent balances Laguerre cell masses.
The reference semi-discrete solver uses the fact that the dual has an explicit sparse Hessian. If \textcolor{#c7372f}{\alpha}=\rho(x)\,dx and cells L_i(g) and L_j(g) share a facet F_{i,j}=L_i(g)\cap L_j(g), then for i\neq j, \frac{\partial\,\textcolor{#c7372f}{\alpha}(L_i(g))}{\partial g_j} = -\frac{1}{2\|\textcolor{#226db4}{y_i}-\textcolor{#226db4}{y_j}\|} \int_{F_{i,j}}\rho(x)\,d\mathcal H^{d-1}(x), and the diagonal is chosen so rows sum to zero: \frac{\partial\,\textcolor{#c7372f}{\alpha}(L_i(g))}{\partial g_i} =-\sum_{j\neq i} \frac{\partial\,\textcolor{#c7372f}{\alpha}(L_i(g))}{\partial g_j}. Thus the Hessian of the concave dual has positive off-diagonal entries and negative diagonal row sums. Newton or quasi-Newton methods exploit the adjacency graph of the Laguerre diagram rather than a dense coupling matrix.

The algorithm updates the weights until every cell has the prescribed mass.


Coloring makes the spatial map visible: each source cell is sent to one target atom.
Semi-discrete dual ascent. Input: source density \alpha, target sites y_j, target masses b_j.
Initialize weights g.
Repeat:
L_j(g)=\{\textcolor{#c7372f}{x}: \|\textcolor{#c7372f}{x}-\textcolor{#226db4}{y_j}\|^2-g_j\leq \|\textcolor{#c7372f}{x}-\textcolor{#226db4}{y_k}\|^2-g_k\},
g_j\leftarrow g_j+\tau\big(\textcolor{#226db4}{b_j}-\textcolor{#c7372f}{\alpha}(L_j(g))\big).
Output: the Laguerre partition and map \textcolor{#7c5bbd}{T}(\textcolor{#c7372f}{x})=\textcolor{#226db4}{y_j} for \textcolor{#c7372f}{x}\in L_j(g).
Newton and quasi-Newton methods, especially L-BFGS variants, are typically used in high-quality implementations because the semi-discrete dual is a smooth concave objective away from cell degeneracies.
Optimal quantization. For a source measure \alpha and m target sites Y=(y_1,\ldots,y_m), Q_m(\textcolor{#c7372f}{\alpha})= \min_{\textcolor{#226db4}{Y},\textcolor{#226db4}{b}\in\Sigma_m} W_2^2\left(\textcolor{#c7372f}{\alpha},\sum_{j=1}^m \textcolor{#226db4}{b_j}\delta_{\textcolor{#226db4}{y_j}}\right). For fixed sites Y, this equals \int \min_j\|\textcolor{#c7372f}{x}-\textcolor{#226db4}{y_j}\|^2\,d\textcolor{#c7372f}{\alpha}(\textcolor{#c7372f}{x}) when the masses are free.
The goal is to approximate a continuous measure by a small discrete measure.
If the masses b_j are fixed, semi-discrete OT gives the optimal cells for fixed sites. If the masses are free, the optimal cells are Voronoi cells.
Centroid condition. At an unconstrained local optimum for quadratic cost, \textcolor{#226db4}{y_j}=\frac{\int_{V_j(Y)} \textcolor{#c7372f}{x}\,d\textcolor{#c7372f}{\alpha}(\textcolor{#c7372f}{x})}{\textcolor{#c7372f}{\alpha}(V_j(Y))}, where V_j(\textcolor{#226db4}{Y}) is the Voronoi cell of \textcolor{#226db4}{y_j}.
For fixed sites Y and free masses, the semi-discrete dual collapses to the closest-site formula \min_{\textcolor{#226db4}{b}\in\Sigma_m} \mathcal L_c\!\left(\textcolor{#c7372f}{\alpha}, \sum_j\textcolor{#226db4}{b_j}\delta_{\textcolor{#226db4}{y_j}}\right) = \int \min_j c(\textcolor{#c7372f}{x},\textcolor{#226db4}{y_j})\,d\textcolor{#c7372f}{\alpha}(\textcolor{#c7372f}{x}).
If the cells V_j(Y)=\{x:c(x,y_j)\leq c(x,y_k)\ \forall k\} are stable and c is differentiable in y, a local minimizer satisfies \int_{V_j(Y)}\nabla_y c(\textcolor{#c7372f}{x},\textcolor{#226db4}{y_j})\,d\textcolor{#c7372f}{\alpha}(\textcolor{#c7372f}{x})=0. For c(x,y)=\|x-y\|^2, this is exactly the centroid condition.
Lloyd iteration. Input: source measure \alpha, initial sites Y.
Repeat:
Output: a centroidal Voronoi tessellation.
The iterations alternate cell assignment and centroid update.

Lloyd descent is simple and robust, but it is nonconvex and can converge to local minima.
In one dimension, quantiles give explicit optimal placements for equal masses. This is much better than random sampling for W_2 approximation. For \alpha with quantile \textcolor{#c7372f}{F_\alpha^{-1}}, \textcolor{#226db4}{y_j}=\textcolor{#c7372f}{F_\alpha^{-1}}\!\left(\frac{j-\frac12}{m}\right) is the canonical equal-mass placement.

Optimal quantiles and random samples have visibly different convergence behavior.
A slowed-down Lloyd update can be viewed as a continuous-time descent on the quantization energy in configuration space. For small relaxation parameter \eta, \textcolor{#226db4}{y_j^{k+1}}=(1-\eta)\textcolor{#226db4}{y_j^k}+\eta\,\operatorname{centroid}(V_j(\textcolor{#226db4}{Y^k})).

The energy need not be globally convex, but standard Lloyd updates decrease it at each alternating minimization step.

The W_1 dual is the mathematical core of Wasserstein GANs, while other IPMs replace the Lipschitz ball by another function class.
Semi-discrete OT appears when a continuous distribution is represented by a finite set of atoms:
The computational object is a partition, not a dense coupling.
Dual and semi-discrete ideas also feed linearized OT: fix a reference measure and embed nearby measures by displacement fields.

Linear OT turns transport maps into Euclidean coordinates for downstream analysis.
What this deck establishes. Duality turns transport into potentials. For W_1, these are Lipschitz witnesses. In the semi-discrete quadratic case, they are Laguerre weights defining a power diagram. Quantization and Lloyd algorithms reuse this geometry.
Dualitycertificates and gradients
Wasserstein-1Lipschitz witnesses
Laguerrecells and quantization
The next presentation focuses on dynamic optimal transport and flows over probability measures.
OT4ML - Duality and Semi-discrete OT