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.

Beyond Comparing Measures

This chapter leaves the setting of scalar measures on a common ambient space. Vector- and matrix-valued OT transports mass with internal degrees of freedom, Gromov--Wasserstein compares metric-measure spaces without a prescribed correspondence, and quantum OT replaces scalar couplings by positive operators. In each case, the transport plan must also encode structure carried by the support, the fibers, or the non-commutative state space.

Vector and Matrix-Valued Measures

Scalar OT transports a nonnegative density. In imaging, color processing, spectral analysis, diffusion tensor imaging and quantum-inspired models, the object attached to a point can instead have several nonnegative components or a positive semidefinite matrix. The first step beyond scalar OT is the positive vector-valued case: the fiber remains linear and commutative, but the transport cost may couple its channels.

Positive Vector-Valued Measures

The simplest way to keep internal structure in transport is to attach several nonnegative masses to each spatial point and to decide whether these channels move independently or interact through the cost.

This models multi-channel densities such as color histograms, spectral bins or several species transported on the same domain. In a conservative model the mass of each channel is preserved, so one assumes α0k(X)=α1k(X)\al_0^k(\X)=\al_1^k(\X) for every kk. The natural vector-valued extension therefore starts from the positive cone R+m\RR_+^m.

For the dynamic formulas below, assume that X\X is either Rd\RR^d, the flat torus, or a bounded convex domain in Rd\RR^d equipped with no-flux boundary conditions. First suppose that the endpoints and the curve have densities. The direct analogue of Benamou--Brenier fixes a vector density ut(x)R+mu_t(x)\in\RR_+^m and a spatial flux Vt(x)=(Vt,1,,Vt,d)(Rm)dV_t(x)=(V_{t,1},\ldots,V_{t,d})\in(\RR^m)^d, where Vt,kV_{t,\ell}^k is the momentum of channel kk in spatial direction \ell. The conservative vector transport cost associated with an action density Φ\Phi is

WΦ2(α0,α1):=infu,V01 ⁣XΦ(ut(x),Vt(x))dxdt\mathcal W_{\Phi}^2(\al_0,\al_1) \eqdef \inf_{u,V} \int_0^1\!\int_\X \Phi(u_t(x),V_t(x))\,\d x\,\d t

subject to the endpoint constraints u0dx=α0u_0\d x=\al_0, u1dx=α1u_1\d x=\al_1 and the componentwise continuity equation

tut+xVt=0,(xVt)k==1dxVt,k.\partial_t u_t+\nabla_x\cdot V_t=0, \qquad (\nabla_x\cdot V_t)^k = \sum_{\ell=1}^d\partial_{x_\ell}V_{t,\ell}^k.

Thus each component satisfies its own continuity equation, but the cost may still couple the components. Singular curves are handled as in scalar dynamic OT by replacing densities and fluxes by measures and using the lower semicontinuous perspective recession convention.

A simple quadratic family is obtained from a mobility matrix M(u)S+m\mathsf M(u)\in\mathbb S_+^m:

ΦM(u,V)==1dVM(u)V,\Phi_{\mathsf M}(u,V) = \sum_{\ell=1}^d V_\ell^\top \mathsf M(u)^\dagger V_\ell,

with the usual convention that the value is finite only when each VV_\ell belongs to the range of M(u)\mathsf M(u). If uM(u)u\mapsto\mathsf M(u) is linear and takes values in S+m\mathbb S_+^m, this action is jointly convex and positively one-homogeneous in (u,V)(u,V). Indeed, the matrix fractional map (M,z)zMz(M,z)\mapsto z^\top M^\dagger z is jointly convex on its effective domain, and M(su)=sM(u)\mathsf M(su)=s\mathsf M(u) for s>0s>0. For m=1m=1 and M(u)=u\mathsf M(u)=u, one recovers exactly the scalar Benamou--Brenier action. For

Mdiag(u)=diag(u1,,um),\mathsf M_{\mathrm{diag}}(u)=\operatorname{diag}(u_1,\ldots,u_m),

the channels move independently. Non-diagonal mobilities are the simplest way to couple the coordinates while keeping the same componentwise conservation law. For instance, with q=m1/2(1,,1)q=m^{-1/2}(1,\ldots,1) and κ0\kappa\geq0,

Mκ(u)=diag(u)+κ(k=1muk)qq\mathsf M_\kappa(u) = \operatorname{diag}(u) + \kappa\left(\sum_{k=1}^m u_k\right)qq^\top

increases the mobility in the common channel direction qq while leaving transverse directions controlled by the diagonal part. The local cost of moving one component can therefore depend on the densities and momenta of the other components, even though each component mass remains conserved.

Proof

For Mdiag(u)=diag(u1,,um)\mathsf M_{\mathrm{diag}}(u)=\operatorname{diag}(u_1,\ldots,u_m), the action separates as

=1dVMdiag(u)V=k=1mVk2uk,\sum_{\ell=1}^d V_\ell^\top\mathsf M_{\mathrm{diag}}(u)^\dagger V_\ell = \sum_{k=1}^m\frac{|V^k|^2}{u^k},

where Vk=(V1k,,Vdk)V^k=(V_1^k,\ldots,V_d^k) is the spatial momentum of channel kk. The constraint (3) also separates into tuk+Vk=0\partial_t u^k+\nabla\cdot V^k=0. The minimization therefore splits into mm independent scalar Benamou--Brenier problems. If mk>0m_k>0, normalizing ρtk=utk/mk\rho_t^k=u_t^k/m_k and ptk=Vtk/mkp_t^k=V_t^k/m_k factors the channel action as mkptk2/ρtkm_k\int |p_t^k|^2/\rho_t^k, hence the scalar value is the displayed mkW22m_k\Wass_2^2 term. If mk=0m_k=0, nonnegativity and conservation force the whole channel to vanish. Summing over all channels proves the claim.

The conservative positive-cone model above is the basic extension of Benamou--Brenier. Adding a source term tu+V=S\partial_t u+\nabla\cdot V=S and a convex perspective penalty in SS gives unbalanced or reaction--transport variants Maas et al., 2015Maas et al., 2016Dolbeault et al., 2009Mielke, 2013. These generalized transport models include dissipation and density modulation. The figure below contrasts the exact diagonal case κ=0\kappa=0, where each positive channel is transported by its quantile map, with a large-κ\kappa illustrative common-mode interpolation in which the channels move more coherently. The endpoints are two-mode mixtures: at each spatial mode the two channels have Gaussian profiles with the same center but different amplitudes.

Figure Div contrasts the exact diagonal case κ=0\kappa=0, where each positive channel is transported by its quantile map, with a large-κ\kappa illustrative common-mode interpolation in which the channels move more coherently.

<IPython.core.display.Image object>

One-dimensional positive R+2\RR_+^2-valued transport displayed by arrow glyphs at eight time levels. Each endpoint is a mixture of two localized Gaussian modes, and, inside each mode, both channel profiles have the same center. Each arrow is proportional to the local fiber value (ut1(x),ut2(x))(u_t^1(x),u_t^2(x)), and time runs vertically from the red source to the blue target. Left: for κ=0\kappa=0, the diagonal mobility gives two independent scalar quantile geodesics. Right: a large-κ\kappa common-mode interpolation bends the display toward q=21/2(1,1)q=2^{-1/2}(1,1), illustrating the effect of a mobility that favors coherent channel motion while keeping the same componentwise continuity equation.

The interactive demo keeps the same glyph idea and lets the coupling strength bend the fibers toward a common channel direction.

Interactive panel. Use the coupling and mixture controls to see how vector-valued mass transports both location and channel composition.

Positive Matrix-Valued Measures

The next simplest fiber is the positive matrix cone. This is the simplest tensor-valued model beyond vectors: the diagonal entries behave like positive channels, while the eigenvectors encode local orientations.

Equivalently, A\mathcal A is a symmetric matrix of finite signed measures such that A(E)0\mathcal A(E)\succeq0 for every Borel set EE. If A\mathcal A has density A(x)0A(x)\succeq0, then trA(x)\operatorname{tr}A(x) is the scalar amount of mass at xx, while, wherever trA(x)>0\operatorname{tr}A(x)>0, the normalized matrix A(x)/trA(x)A(x)/\operatorname{tr}A(x) records an internal covariance or orientation. This is the matrix analogue of the positive vector case: diagonal matrices encode nonnegative vector components, and non-diagonal matrices add a local eigenbasis.

The conservative Benamou--Brenier model fixes a matrix density At(x)S+mA_t(x)\in\mathbb S_+^m and symmetric matrix fluxes Pt(x)=(Pt,1,,Pt,d)(Sm)dP_t(x)=(P_{t,1},\ldots,P_{t,d})\in(\mathbb S^m)^d. With no flux through the boundary of X\X, the full matrix mass XAt(x)dx\int_\X A_t(x)\d x is conserved, so the endpoints must have the same total matrix. The model minimizes the matrix-perspective action

Wmat2(A0,A1):=infA,P01 ⁣X=1dtr ⁣(Pt,AtPt,)dxdt\mathcal W_{\mathrm{mat}}^2(\mathcal A_0,\mathcal A_1) \eqdef \inf_{A,P} \int_0^1\!\int_\X \sum_{\ell=1}^d \operatorname{tr}\!\left(P_{t,\ell}^{\top} A_t^\dagger P_{t,\ell}\right) \d x\,\d t

subject to A0dx=A0A_0\d x=\mathcal A_0, A1dx=A1A_1\d x=\mathcal A_1 and to the matrix-valued continuity equation

tAt+xPt=0,xPt==1dxPt,.\partial_t A_t+\nabla_x\cdot P_t=0, \qquad \nabla_x\cdot P_t = \sum_{\ell=1}^d\partial_{x_\ell}P_{t,\ell}.

Here AA^\dagger denotes the Moore--Penrose inverse, with the usual lower-semicontinuous perspective convention: the action is finite only when the columns of each Pt,P_{t,\ell} belong to the range of AtA_t. The matrix fractional map (A,P)tr(PAP)(A,P)\mapsto\operatorname{tr}(P^\top A^\dagger P) is jointly convex on this effective domain and positively one-homogeneous in (A,P)(A,P). This gives the simplest non-trivial matrix-valued transport model: spatial motion is conservative, but the fiber carries orientation through the eigenvectors of At(x)A_t(x).

Proof

The continuity equation (11) is diagonal entry by diagonal entry and gives tuk+Vk=0\partial_t u^k+\nabla\cdot V^k=0. Moreover,

=1dtr ⁣(Pt,AtPt,)=k=1mVtk2utk,\sum_{\ell=1}^d \operatorname{tr}\!\left(P_{t,\ell}^{\top}A_t^\dagger P_{t,\ell}\right) = \sum_{k=1}^m\frac{|V_t^k|^2}{u_t^k},

with the same scalar perspective convention as before. The admissible set and the action are therefore exactly those of the diagonal vector model.

The restriction to a fixed diagonal basis gives eigenvalue transport; it should be read as a commuting submodel, not as a claim that non-diagonal excursions can never change the unrestricted value. The genuinely matrix-valued case starts when the eigenspaces vary with xx or along the interpolation, so that the transported object carries both mass and orientation. Static matrix-valued Monge--Kantorovich problems and dual test-function metrics were developed in Ning & Georgiou, 2014Jiang et al., 2012Ning et al., 2015; dynamic versions and related non-commutative geometries appear in Chen et al., 2016Chen et al., 2020Carlen & Maas, 2014Peyré et al., 2019. The figure below shows the analogous independent/coupled contrast for positive 2×22\times2 matrix fibers, using two localized matrix modes whose eigenvalue profiles share a common center at each mode.

Figure Div shows the analogous independent/coupled contrast for positive 2×22\times2 matrix fibers, using two localized matrix modes whose eigenvalue profiles share a common center at each mode.

<IPython.core.display.Image object>

Positive 2×22\times2 matrix-valued transport on a one-dimensional base. Each endpoint is a mixture of two localized matrix modes; within one mode, both eigenvalue profiles are Gaussian bumps with the same center. Each ellipse is the glyph of a positive semidefinite matrix At(x)A_t(x), with axes given by eigenvectors and eigenvalues. Left: the matrices are diagonal in a fixed basis, giving the commuting tensor analogue of independent vector channels. Right: a coupled illustrative interpolation bends packet motion toward the trace-density transport and uses non-commuting eigendirections; the superposition remains positive semidefinite and produces spatially varying orientations.

Interactive panel. Use the coupling and rotation controls to compare matrix-valued transport of anisotropic local structure.

Wasserstein Over Wasserstein

The construction can be iterated. Once (X,d)(\X,d) is a metric space, the set of probability measures on X\X becomes a metric space through Wp\Wass_p. It can therefore serve as a new ground space. This is useful whenever the objects to compare are themselves random probability measures, or mixtures whose components are meaningful objects rather than only a collapsed density.

The standard setting is that of Polish spaces, introduced in Definition: Polish Metric Space. These assumptions provide separability, completeness, tightness criteria and regular conditional probabilities. The next proposition shows that Wasserstein spaces preserve this well-behaved structure.

Proof

From a Wp\Wass_p-Cauchy sequence, extract a subsequence (αk)k(\alpha_k)_k such that kWp(αk,αk+1)<\sum_k\Wass_p(\alpha_k,\alpha_{k+1})<\infty. Gluing optimal couplings of consecutive terms produces random variables (Xk)k(X_k)_k with laws αk\alpha_k and kd(Xk,Xk+1)Lp<\sum_k\|d(X_k,X_{k+1})\|_{L^p}<\infty. Hence (Xk)k(X_k)_k converges almost surely and in LpL^p to an X\X-valued random variable, whose law is the Wp\Wass_p limit. Separability follows by approximating measures with finitely supported measures on a countable dense subset and rational weights. If X\X is compact, Prokhorov compactness and Wasserstein metrization of weak convergence give compactness.

Fix 1p<1\leq p<\infty. Elements of Pp(Pp(X))\Pp_p(\Pp_p(\X)) are probability laws over probability measures, or random probability measures. A measurable parametric family gives

A=(ζαζ)γ.\mathfrak A=(\zeta\mapsto\alpha_\zeta)_\sharp\gamma.

This law belongs to Pp(Pp(X))\Pp_p(\Pp_p(\X)) precisely when, for one and hence every x0Xx_0\in\X,

Wp(αζ,δx0)pdγ(ζ)<.\int \Wass_p(\alpha_\zeta,\delta_{x_0})^p\,\d\gamma(\zeta)<\infty.

If APp(Pp(X))\mathfrak A\in\Pp_p(\Pp_p(\X)), then αˉAPp(X)\bar\alpha_{\mathfrak A}\in\Pp_p(\X) because

Xd(x,x0)pdαˉA(x)=Pp(X)Wp(α,δx0)pdA(α).\int_\X d(x,x_0)^p\,\d\bar\alpha_{\mathfrak A}(x) = \int_{\Pp_p(\X)}\Wass_p(\alpha,\delta_{x_0})^p\,\d\mathfrak A(\alpha).

The Wasserstein distance on the Wasserstein space is

Wpp(A,B):=infΠΠ(A,B)Pp(X)×Pp(X)Wpp(α,β)dΠ(α,β),A,BPp(Pp(X)).\mathbb W_p^p(\mathfrak A,\mathfrak B) \eqdef \inf_{\Pi\in\Couplings(\mathfrak A,\mathfrak B)} \int_{\Pp_p(\X)\times\Pp_p(\X)} \Wass_p^p(\alpha,\beta)\d\Pi(\alpha,\beta), \qquad \mathfrak A,\mathfrak B\in\Pp_p(\Pp_p(\X)).

For p=2p=2, Gaussian mixtures provide an explicit example with two geometries. A mixture can be viewed as a collapsed density on X\X, or as a component law over Gaussian atoms in the Bures--Wasserstein space. For two component laws

A=iaiδN(mi,Σi),B=jbjδN(nj,Λj),\mathfrak A=\sum_i a_i\delta_{\Gaussian(m_i,\Sigma_i)}, \qquad \mathfrak B=\sum_j b_j\delta_{\Gaussian(n_j,\Lambda_j)},

the component-level problem uses the cost

Cij=minj2+B(Σi,Λj)2.C_{ij}=\norm{m_i-n_j}^2+\Bb(\Sigma_i,\Lambda_j)^2.

If P\P^\star is an optimal coupling between the weights aa and bb, and if AijA_{ij} is the Brenier linear part from Σi\Sigma_i to Λj\Lambda_j, each active pair follows the Gaussian geodesic

mij,t=(1t)mi+tnj,Σij,t=((1t)Id+tAij)Σi((1t)Id+tAij).m_{ij,t}=(1-t)m_i+t n_j, \qquad \Sigma_{ij,t} = \big((1-t)\Id+tA_{ij}\big)\Sigma_i \big((1-t)\Id+tA_{ij}\big)^\top.

Collapsing these component geodesics gives

αˉt=i,jPijN(mij,t,Σij,t).\bar\alpha_t= \sum_{i,j}\P^\star_{ij}\Gaussian(m_{ij,t},\Sigma_{ij,t}).

This component-level interpolation generally differs from the true W2\Wass_2 interpolation between the collapsed mixture densities.

Figure Div contrasts this component-level geodesic with the true one-dimensional Wasserstein interpolation of the collapsed mixtures, making the internal mass splitting absent from the former visible.

<IPython.core.display.Image object>

Two interpolations between the same asymmetric three-component one-dimensional Gaussian mixtures. The red endpoint has a broad central component carrying most of the mass, while the blue endpoint has two dominant sharp side modes. Left: Gaussian components are transported as atoms using their Bures--Wasserstein distance. Right: the collapsed densities are interpolated by the true one-dimensional quantile formula for W2\Wass_2. The central mass is split and recombined in the collapsed geometry, making the two paths visibly distinct.

The interactive comparison keeps both geometries side by side: component-level transport moves Gaussian atoms, while collapsed transport rearranges the full density.

Interactive panel. Use the mixture and blur controls to compare transport between ordinary measures with transport between distributions of measures.

Proof

Fix a coupling Π\Pi between A\mathfrak A and B\mathfrak B and η>0\eta>0. A measurable-selection theorem gives a measurable kernel πα,βΠ(α,β)\pi_{\alpha,\beta}\in\Couplings(\alpha,\beta) whose cost is at most Wp(α,β)p+η\Wass_p(\alpha,\beta)^p+\eta. Integrating this kernel against Π\Pi gives a coupling between the collapsed mixtures. Its cost is at most the Π\Pi-average of Wpp(α,β)\Wass_p^p(\alpha,\beta) plus η\eta. Letting η0\eta\downarrow0, taking the infimum over Π\Pi, and then taking the pp-th root proves the claim.

This viewpoint also clarifies lower bounds for Gromov--Wasserstein distances: a metric-measure space can be mapped to a law of local distance profiles, and these laws can be compared by Wasserstein-over-Wasserstein.

Gromov--Wasserstein

Gromov--Wasserstein compares spaces through their internal distance structures rather than through a fixed ambient ground cost. This is the right extension for graphs, shapes and point clouds whose points are not pre-aligned.

Discrete Formulation

Optimal transport needs a ground cost C\C to compare histograms (a,b)(a,b), and thus cannot be used directly if the histograms are not defined on the same underlying space, or if one cannot pre-register these spaces to define a ground cost. Instead, assume that two matrices DRn×nD\in\RR^{n\times n} and DRm×mD'\in\RR^{m\times m} represent relationships between points. A typical scenario is when these matrices are powers of distance matrices. Define the quadratic distortion and its minimum by

ED,D(P):=i,j,i,jΔ(Di,i,Dj,j)pPi,jPi,j,GW((a,D),(b,D))p:=minPU(a,b)ED,D(P).\begin{aligned} \mathcal E_{D,D'}(\P) &\eqdef \sum_{i,j,i',j'} \Delta(D_{i,i'},D'_{j,j'})^pP_{i,j}\P_{i',j'}, \\ \operatorname{GW}((a,D),(b,D'))^p &\eqdef \min_{\P\in\mathbf U(a,b)}\mathcal E_{D,D'}(\P). \end{aligned}

where p1p\geq1 and Δ\Delta is usually Δ(u,v)=uv\Delta(u,v)=|u-v|. This is a non-convex quadratic problem over the transport polytope. In the uniform case with m=nm=n and P\P constrained to be a permutation matrix, it becomes a Quadratic Assignment Problem, already NP-hard in full generality Loiola et al., 2007. The relaxed coupling formulation can therefore be read as a soft graph-matching model Lyzinski et al., 2016.

Figure Div shows this intrinsic matching principle under progressively stronger deformations: correspondences are selected from within-space distance patterns rather than an ambient cross-space cost.

<IPython.core.display.Image object>

Gromov--Wasserstein correspondences under increasing deformation. The red and blue point clouds are not compared through an ambient Euclidean cross-cost; instead, the GW coupling compares their internal pairwise distances. A perfectly isometric copy admits a clean structural match, while mild and deliberately stronger deformations progressively bend the correspondence.

The interactive demo uses a fixed structural correspondence and lets the deformation change the pairwise-distance residual. This isolates the quantity minimized by the GW objective.

Interactive panel. Use the deformation and point controls to inspect correspondences when only within-space distances are meaningful.

When D,DD,D' are genuine distance matrices, the construction below defines a distance between metric spaces equipped with a probability distribution, up to measure-preserving isometries Mémoli, 2011Sturm, 2012Schmitzer & Schnörr, 2013. The same construction also explains why GW satisfies the triangle inequality after quotienting by isometries, and its relation to Hausdorff and Gromov--Hausdorff distances is discussed at the end of the section.

General Setting

The continuous formulation abstracts the discrete distance matrices into metric-measure spaces, so that GW compares intrinsic geometries independently of labels, parametrizations or ambient coordinates.

Compactness is often assumed below to avoid additional tightness and integrability arguments.

For metric-measure spaces X=(X,dX,α)\mathbb X=(\X,d_\X,\alpha) and Y=(Y,dY,β)\mathbb Y=(\Y,d_\Y,\beta), define

GW(X,Y)p:=minπΠ(α,β)X2×Y2Δ(dX(x,x),dY(y,y))pdπ(x,y)dπ(x,y).\operatorname{GW}(\mathbb X,\mathbb Y)^p \eqdef \min_{\pi\in\Couplings(\alpha,\beta)} \int_{\X^2\times\Y^2} \Delta(d_\X(x,x'),d_\Y(y,y'))^p \d\pi(x,y)\d\pi(x',y').
Proof

Let π\pi be any coupling between α\alpha and β\beta. For two independent pairs (X,Y),(X,Y)π(X,Y),(X',Y')\sim\pi, the reverse triangle inequality gives

dX(X,X)dX(Y,Y)dX(X,Y)+dX(X,Y).\left|d_\X(X,X')-d_\X(Y,Y')\right| \leq d_\X(X,Y)+d_\X(X',Y').

Taking the LpL^p norm and using Minkowski gives a bound by 2(dX(x,y)pdπ)1/p2(\int d_\X(x,y)^p\d\pi)^{1/p}. Optimizing over π\pi proves the claim.

Proof

Compactness makes the coupling set compact and the distortion continuous, so an optimal coupling exists. A measure-preserving isometry induces a graph coupling with zero distortion; symmetry and non-negativity are immediate.

If GW(X,Y)=0\operatorname{GW}(\mathbb X,\mathbb Y)=0 and π\pi is optimal, then dX(x,x)=dY(y,y)d_\X(x,x')=d_\Y(y,y') holds ππ\pi\otimes\pi-almost everywhere. By continuity, this equality holds on supp(π)2\operatorname{supp}(\pi)^2. Both X\mathbb X and Y\mathbb Y are isometric to the support space (supp(π),dπ,π)(\operatorname{supp}(\pi),d_\pi,\pi), where

dπ((x,y),(x,y)):=12dX(x,x)+12dY(y,y).d_\pi((x,y),(x',y')) \eqdef \frac12d_\X(x,x')+\frac12d_\Y(y,y').

The first projection is measure-preserving and distance-preserving on supp(π)\operatorname{supp}(\pi), and compactness gives surjectivity onto supp(α)\operatorname{supp}(\alpha); the same argument applies to the second projection.

For the triangle inequality, glue optimal couplings between X,Y\mathbb X,\mathbb Y and between Y,Z\mathbb Y,\mathbb Z. The projected X×Z\X\times\Z marginal is feasible, and the pointwise triangle inequality together with Minkowski gives

GW(X,Z)GW(X,Y)+GW(Y,Z).\operatorname{GW}(\mathbb X,\mathbb Z) \leq \operatorname{GW}(\mathbb X,\mathbb Y) + \operatorname{GW}(\mathbb Y,\mathbb Z).

This proves the triangle inequality and completes the metric proof.

Proof

Apply the GW triangle inequality in both directions. Each error term compares the same underlying metric space equipped with two different measures, so Proposition: Fixed-Space GW Is Controlled by Wasserstein bounds it by twice the corresponding ordinary Wasserstein distance. Taking expectations yields the empirical bound; the rates are therefore those developed in Sample Complexity.

The metric structure also gives geodesics. Sturm’s construction allows one to speak about interpolation, barycenters and gradient flows directly on the space of metric-measure spaces, even though the intermediate space lives on a product support and is therefore expensive numerically Sturm, 2012.

Proof

For s<ts<t, couple Xs\mathbb X_s and Xt\mathbb X_t by the diagonal coupling on Z\mathcal Z. The distance difference is exactly

dt(z,z)ds(z,z)=(ts)(dX1(x1,x1)dX0(x0,x0)),d_t(z,z')-d_s(z,z') = (t-s)\big(d_{\X_1}(x_1,x'_1)-d_{\X_0}(x_0,x'_0)\big),

so GW(Xs,Xt)(ts)D\operatorname{GW}(\mathbb X_s,\mathbb X_t)\leq(t-s)D, where D=GW(X0,X1)D=\operatorname{GW}(\mathbb X_0,\mathbb X_1). Applying the triangle inequality to X0,Xs,Xt,X1\mathbb X_0,\mathbb X_s,\mathbb X_t,\mathbb X_1 gives the reverse bound.

Figure Div complements the global GW objective with local diagnostics, displaying where a mildly non-isometric correspondence creates the largest pairwise-distance residuals.

<IPython.core.display.Image object>

Local distortion in a mildly non-isometric GW match. The left panel colors transport segments by the average residual induced by the displayed hard correspondence. The right panel shows the pairwise-distance residual matrix dX(xi,xi)dY(yσ(i),yσ(i))|d_\X(x_i,x_{i'})-d_\Y(y_{\sigma(i)},y_{\sigma(i')})|, with darker entries marking larger local distortion. This matrix is the local contribution minimized by the discrete GW objective for the displayed correspondence.

Interactive panel. Use the deformation and shift controls to see where a Gromov-Wasserstein correspondence preserves or distorts pairwise distances.

Proof

Fix any πΠ(α,β)\pi\in\Couplings(\alpha,\beta). It induces a coupling (x,y)(αx,βy)(x,y)\mapsto(\alpha_x,\beta_y) between the profile laws, hence

Wp(DX,DY)pX×YWp(αx,βy)pdπ(x,y).\mathbb W_p(\mathfrak D_\mathbb X,\mathfrak D_\mathbb Y)^p \leq \int_{\X\times\Y} \Wass_p(\alpha_x,\beta_y)^p\,\d\pi(x,y).

For fixed (x,y)(x,y), the map (x,y)(dX(x,x),dY(y,y))(x',y')\mapsto(d_\X(x,x'),d_\Y(y,y')) pushes the same coupling π\pi to a coupling between αx\alpha_x and βy\beta_y. Integrating the resulting one-dimensional OT bound over (x,y)(x,y) gives the GW objective for π\pi. Taking the infimum over π\pi proves the claim.

The next figure exposes the two nested transport problems for the planar shapes X\mathbb X and Y\mathbb Y: sorting each distance profile computes the one-dimensional costs, then an outer assignment couples the resulting profile laws.

Figure Div makes the two transport levels explicit for the planar shapes X\XX and Y\YY: sorting each distance profile computes the one-dimensional costs, then an outer assignment couples the resulting profile laws.

<IPython.core.display.Image object>

Mémoli distance profiles expose a computable lower bound for intrinsic GW comparison. The planar shapes X\mathbb X and Y\mathbb Y are represented by cat and bunny silhouettes, centered and normalized to unit diameter. Matching colors identify representative anchor pairs selected by the optimal profile assignment with Cij=W22(αxi,βyj)C_{ij}=\Wass_2^2(\alpha_{x_i},\beta_{y_j}), their connecting segments and their two side histograms. The histograms are display summaries only: every profile cost is computed by sorting the complete distance profiles. The resulting outer assignment realizes the Mémoli profile lower bound.

This lower bound is useful computationally because the profile cost matrix Cij=Wp(αxi,βyj)p\C_{ij}=\Wass_p(\alpha_{x_i},\beta_{y_j})^p is an ordinary OT cost between points. Solving this easier OT problem gives a geometry-aware initialization for the non-convex GW iterations.

Relation With Wasserstein-Procrustes

The profile lower bound is intrinsic. In Euclidean applications, it is naturally paired with an extrinsic upper certificate obtained by registering the two measures before applying the ordinary Wasserstein distance. Proposition Proposition: Wasserstein-Procrustes Upper Certificate, proved in Quotient Wasserstein and Wasserstein-Procrustes, supplies exactly this certificate. The converse need not hold, because a small GW value may be achieved by an intrinsic correspondence that is not induced by any ambient rigid motion. Combining the profile lower bound with the Procrustes upper certificate gives the sandwich

Wp(DX,DY)GW(X,Y)2Wp,E(d)([α],[β]),\mathbb W_p(\mathfrak D_\mathbb X,\mathfrak D_\mathbb Y) \leq \operatorname{GW}(\mathbb X,\mathbb Y) \leq 2\,\Wass_{p,\mathrm E(d)}([\alpha],[\beta]),

where X=(Rd,,α)\mathbb X=(\RR^d,\norm{\cdot},\alpha) and Y=(Rd,,β)\mathbb Y=(\RR^d,\norm{\cdot},\beta). The left term is intrinsic and inexpensive; the right term is an ambient rigid-registration certificate.

Entropic Regularization and Fused GW

For the common squared distortion Δ(u,v)2=(uv)2\Delta(u,v)^2=(u-v)^2, one often seeks a stationary point of the entropic relaxation

minPU(a,b)ED,D(P)ϵH(P).\min_{P\in\mathbf U(a,b)} \mathcal E_{D,D'}(P)-\epsilon H(P).

For symmetric distance matrices, define the half-gradient

C(P):=D2a1m+1n(D2b)2DPD,ED,D(P)=2C(P).\C(P) \eqdef D^{\odot2}a\,\mathbf 1_m^\top + \mathbf 1_n(D'^{\odot2}b)^\top - 2D\,P\,D'^\top, \qquad \nabla\mathcal E_{D,D'}(P)=2\C(P).

A standard fixed-point linearization Peyré et al., 2016 computes

P(+1)=argminPU(a,b)P,C(P())ϵ2H(P).P^{(\ell+1)} = \operatorname*{argmin}_{P\in\mathbf U(a,b)} \langle P,\C(P^{(\ell)})\rangle -\frac{\epsilon}{2}H(P).

The factor ϵ/2\epsilon/2 is essential because C(P)\C(P) is one half of the quadratic gradient. Each update is an ordinary entropic OT problem and can therefore be solved with Sinkhorn iterations. If the iterates converge to a positive fixed point, it satisfies the stationarity conditions of the regularized GW objective. The basic fixed-point iteration is not a descent method in general and has no global guarantee for this non-convex problem; line searches or proximal variants are needed when monotone decrease is required.

Fused Gromov--Wasserstein augments the structural term with a feature transport cost Vayer et al., 2019. In the discrete case, given a cross-feature cost MRn×mM\in\RR^{n\times m} and a parameter λ[0,1]\lambda\in[0,1], one minimizes

FGWλ,p((a,D),(b,D))p:=minPU(a,b)(1λ)i,jMijPij+λi,j,i,jΔ(Dii,Djj)pPijPij.\operatorname{FGW}_{\lambda,p}((a,D),(b,D'))^p \eqdef \min_{P\in\mathbf U(a,b)} (1-\lambda)\sum_{i,j}M_{ij}P_{ij} + \lambda \sum_{i,j,i',j'} \Delta(D_{ii'},D'_{jj'})^pP_{ij}P_{i'j'}.

The endpoints λ=0\lambda=0 and λ=1\lambda=1 recover feature-only OT and pure GW respectively; intermediate values trade attribute matching against structural matching. The first term compares node attributes in the usual OT sense, and the second compares intrinsic geometry; this is useful when two spaces have both distances and features, and the two sources of information may disagree.

Figure Div isolates this tradeoff on a small graph pair by comparing feature-only, structure-only and fused correspondences.

<IPython.core.display.Image object>

Feature information and intrinsic geometry in fused Gromov--Wasserstein. Small inner disks encode binary node features. Feature-only OT follows the attributes even when this crosses the shape structure, pure GW follows the intrinsic ordering, and fused GW balances the feature term with the pairwise-distance distortion.

Interactive panel. Use the geometry-weight and feature-conflict controls to balance structural matching against feature agreement.

Hausdorff and Gromov--Hausdorff Viewpoints

If A,BA,B are compact subsets of a common metric space (Z,dZ)(\mathcal Z,d_\mathcal Z), their Hausdorff distance is

dHZ(A,B)=max{supaAinfbBdZ(a,b),supbBinfaAdZ(a,b)}.d_{\mathrm H}^{\mathcal Z}(A,B) = \max\left\{ \sup_{a\in A}\inf_{b\in B}d_\mathcal Z(a,b), \sup_{b\in B}\inf_{a\in A}d_\mathcal Z(a,b) \right\}.

The Gromov--Hausdorff distance removes the common ambient space by minimizing this quantity over all isometric embeddings into a third space:

dGH(X,Y)=infZ,ϕ,ψdHZ(ϕ(X),ψ(Y)).d_{\mathrm{GH}}(\X,\Y) = \inf_{\mathcal Z,\phi,\psi} d_{\mathrm H}^{\mathcal Z}(\phi(\X),\psi(\Y)).

Equivalently, it is half the minimal distortion of a correspondence between X\X and Y\Y Gromov, 2001Mémoli, 2007. This is a worst-case set distance: every point must be matched with small distortion. Gromov--Wasserstein replaces correspondences by probability couplings and worst-case distortion by averaged distortion. It is therefore better adapted to noisy sampled shapes and weighted graphs, but it can ignore small sets of mass that would dominate the Hausdorff distance.

Quantum Optimal Transport

Quantum optimal transport replaces probability vectors by density matrices and scalar couplings by positive operators on a tensor product space. This is the right language when the transported objects are matrix-valued signals, covariance-like descriptors or quantum states, and it exposes a precise bridge between OT, non-commutative entropy and operator scaling Ning & Georgiou, 2014Chen et al., 2016Chen et al., 2020Peyré et al., 2019Caglioti et al., 2020Chakrabarti et al., 2019.

Finite-Dimensional States and Couplings

A joint quantum state between Cn\mathbb C^n and Cm\mathbb C^m is a matrix THnm+T\in\mathbb H_{nm}^+ acting on CnCm\mathbb C^n\otimes\mathbb C^m. Its marginals are the partial traces, defined by duality through

tr(FTrBT)=tr((FIm)T),tr(GTrAT)=tr((InG)T).\operatorname{tr}(F\,\operatorname{Tr}_B T) = \operatorname{tr}((F\otimes I_m)T), \qquad \operatorname{tr}(G\,\operatorname{Tr}_A T) = \operatorname{tr}((I_n\otimes G)T).

for all FHnF\in\mathbb H_n and GHmG\in\mathbb H_m. Thus TrB(T)Hn+\operatorname{Tr}_B(T)\in\mathbb H_n^+ and TrA(T)Hm+\operatorname{Tr}_A(T)\in\mathbb H_m^+ play exactly the role of the two marginals of a classical coupling.

The feasible set is never empty, since ABA\otimes B has marginals AA and BB.

Proof

Introduce Hermitian Lagrange multipliers FF and GG for the two marginal constraints. Using (55), the Lagrangian is

tr(FA)+tr(GB)+tr ⁣((CFImInG)T).\operatorname{tr}(FA)+\operatorname{tr}(GB) + \operatorname{tr}\!\left((C-F\otimes I_m-I_n\otimes G)T\right).

Minimizing over T0T\succeq0 gives a finite lower bound if and only if CFImInG0C-F\otimes I_m-I_n\otimes G\succeq0, in which case the infimum in TT is 0. When A,B0A,B\succ0, the coupling ABA\otimes B is strictly feasible, so Slater’s theorem gives equality of primal and dual values and dual attainment.

For singular marginals, let PA,PBP_A,P_B be their support projections. Positivity and

tr ⁣(((InPA)Im)T)=tr((InPA)A)=0\operatorname{tr}\!\left(((I_n-P_A)\otimes I_m)T\right) = \operatorname{tr}((I_n-P_A)A)=0

imply T=(PAPB)T(PAPB)T=(P_A\otimes P_B)T(P_A\otimes P_B). Thus the primal is exactly the problem compressed to supp(A)supp(B)\operatorname{supp}(A)\otimes\operatorname{supp}(B), where both reduced marginals are positive definite and Slater applies. The unreduced dual values approach this reduced maximum by choosing sufficiently negative potentials on the orthogonal complements.

The dual potentials have the usual scalar gauge freedom: replacing (F,G)(F,G) by (F+tIn,GtIm)(F+tI_n,G-tI_m) leaves both the constraint and the value unchanged because tr(A)=tr(B)=1\operatorname{tr}(A)=\operatorname{tr}(B)=1.

Entropic Regularization and Bregman Iterations

For ϵ>0\epsilon>0 define

QOTCϵ(A,B)=minT0{tr(CT)+ϵH(T):TrB(T)=A, TrA(T)=B}.\operatorname{QOT}_C^\epsilon(A,B) = \min_{T\succeq0} \left\{ \operatorname{tr}(CT)+\epsilon H(T): \operatorname{Tr}_B(T)=A,\ \operatorname{Tr}_A(T)=B \right\}.

This is the non-commutative analogue of entropic OT: the Shannon entropy of a coupling is replaced by the trace entropy of a density matrix Peyré et al., 2019Chakrabarti et al., 2019.

Proof

The feasible set is compact and nonempty, and it contains the positive definite point ABA\otimes B. The trace entropy is strictly convex on positive semidefinite matrices, hence the regularized primal has a unique minimizer. The minimizer is positive definite: otherwise, moving toward the positive feasible point ABA\otimes B would have entropy directional derivative -\infty at the boundary while changing the linear cost at finite rate. Slater’s condition justifies the Lagrange dual computation. The Fenchel identity

supT0tr(YT)ϵH(T)=ϵtrexp(Y/ϵ)\sup_{T\succeq0} \operatorname{tr}(YT)-\epsilon H(T) = \epsilon\,\operatorname{tr}\exp(Y/\epsilon)

is the matrix analogue of the scalar exponential conjugacy. Applying it to the Lagrangian with Y=FIm+InGCY=F\otimes I_m+I_n\otimes G-C gives (62), and the stationarity condition gives (63); differentiating the dual objective with respect to FF and GG yields the two marginal equations.

Writing K=exp(C/ϵ)K=\exp(-C/\epsilon), the objective differs by a constant from ϵ\epsilon times the quantum KL divergence

DH(TK)=tr ⁣(T(logTlogK)T+K).D_H(T\mid K) = \operatorname{tr}\!\left( T(\log T-\log K)-T+K \right).

The exact quantum analogue of Sinkhorn is an implicit alternating Bregman projection scheme onto the affine marginal sets

MA={T0:TrB(T)=A},MB={T0:TrA(T)=B}.\mathcal M_A=\{T\succeq0:\operatorname{Tr}_B(T)=A\}, \qquad \mathcal M_B=\{T\succeq0:\operatorname{Tr}_A(T)=B\}.
Proof

Since logK=C/ϵ\log K=-C/\epsilon,

tr(CT)+ϵH(T)=ϵDH(TK)ϵtr(K).\operatorname{tr}(CT)+\epsilon H(T) = \epsilon D_H(T\mid K)-\epsilon\operatorname{tr}(K).

For the projection of a positive definite matrix SS onto MA\mathcal M_A, the affine set contains the positive definite point AIm/mA\otimes I_m/m. The entropy derivative is singular at the boundary, so the projection lies in the interior of the positive cone and the first variation has the form

logTlogSΛIm=0,\log T-\log S-\Lambda\otimes I_m=0,

for a Hermitian multiplier Λ\Lambda. Hence T=exp(logS+ΛIm)T=\exp(\log S+\Lambda\otimes I_m). If S=Te(F,G)S=T_e(F,G), this is again Te(F+ϵΛ,G)T_e(F+\epsilon\Lambda,G); the multiplier is fixed by the marginal equation. The same argument applies to MB\mathcal M_B. Finally, the first-order optimality condition for maximizing (62) over one block is exactly the corresponding marginal equation, so the Bregman and block-dual views coincide.

In the diagonal case this proposition gives the usual multiplicative Sinkhorn updates. In the non-commutative case, however, the exact block equations

TrBTe(F,G)=A,TrATe(F,G)=B\operatorname{Tr}_B T_e(F,G)=A, \qquad \operatorname{Tr}_A T_e(F,G)=B

do not admit scalar division formulas, because the exponential of FIm+InGCF\otimes I_m+I_n\otimes G-C cannot be separated unless the local potential commutes with the cost.

Gurvits Scaling and Quantum Sinkhorn

The algorithm often called quantum Sinkhorn comes from the operator-scaling literature of Gurvits and subsequent developments Gurvits, 2003Gurvits, 2004Georgiou & Pavon, 2015Garg & Oliveira, 2018. It replaces the true Gibbs coupling (63) by the symmetric factorization

Ts(F,G)=exp ⁣(Z2ϵ)exp(C/ϵ)exp ⁣(Z2ϵ)=(UV)K(UV),Z=FIm+InG,T_s(F,G) = \exp\!\left(\frac{Z}{2\epsilon}\right) \exp(-C/\epsilon) \exp\!\left(\frac{Z}{2\epsilon}\right) = (U\otimes V)K(U\otimes V), \qquad Z=F\otimes I_m+I_n\otimes G,

where U=exp(F/(2ϵ))U=\exp(F/(2\epsilon)), V=exp(G/(2ϵ))V=\exp(G/(2\epsilon)) and K=exp(C/ϵ)K=\exp(-C/\epsilon). If [Z,C]=0[Z,C]=0, then Ts(F,G)=Te(F,G)T_s(F,G)=T_e(F,G); otherwise this is a Strang-type symmetric surrogate.

Fix a Choi convention and let K:HmHn\mathcal K:\mathbb H_m\to\mathbb H_n be the completely positive map represented by the positive Choi matrix KK; let K\mathcal K^\star be its Hilbert--Schmidt adjoint. Up to the transpose dictated by the chosen Choi convention, the marginal equations for the symmetric coupling take the operator-scaling form

UK(V2)U=A,VK(U2)V=B,U\,\mathcal K(V^2)\,U=A, \qquad V\,\mathcal K^\star(U^2)\,V=B,

and can be enforced by the congruence normalizations

RV=K(V2),URV1/2(RV1/2ARV1/2)1/2RV1/2,SU=K(U2),VSU1/2(SU1/2BSU1/2)1/2SU1/2.\begin{aligned} R_V&=\mathcal K(V^2), & U&\leftarrow R_V^{-1/2} \left(R_V^{1/2} A R_V^{1/2}\right)^{1/2} R_V^{-1/2}, \\ S_U&=\mathcal K^\star(U^2), & V&\leftarrow S_U^{-1/2} \left(S_U^{1/2} B S_U^{1/2}\right)^{1/2} S_U^{-1/2}. \end{aligned}

These inverse square roots are well-defined when K0K\succ0 and U,V,A,B0U,V,A,B\succ0. Under the standard strict-positivity and scalability hypotheses, the alternating normalizations converge to the prescribed marginals Georgiou & Pavon, 2015Garg & Oliveira, 2018. At finite tolerance they return an approximate coupling. When all matrices are diagonal, the updates reduce to classical Sinkhorn scaling; when the targets are proportional to identities, they match the usual bistochastic operator-scaling normalization up to trace convention.

Dynamic Time Warping

Dynamic time warping (DTW) compares ordered feature sequences when the same phenomenon may be observed under different clocks. It is historically rooted in speech recognition Vintsyuk, 1968Sakoe & Chiba, 1978, and is now a standard tool for time-series alignment, retrieval and classification Berndt & Clifford, 1994Müller, 2007. Like OT, it minimizes an aggregate feature mismatch over correspondences; unlike OT, those correspondences must respect chronology.

Ordered Alignments Versus Transport Couplings

For two empirical measures, Kantorovich OT minimizes a linear cost over the convex polytope of nonnegative matrices with prescribed row and column sums. DTW instead minimizes over the finite, non-convex set of connected monotone paths through the pairwise cost matrix. Every time index must be visited, but it may be visited repeatedly; the row and column sums therefore record endogenous visit counts rather than prescribed masses. Normalizing a path matrix produces a coupling only for these path-dependent marginals, not for fixed input histograms. Conversely, ordinary OT between the unordered empirical feature measures forgets chronology and may match indices in a crossing order. Temporal penalties, causal constraints, and joint OT--DTW models interpolate between the two viewpoints; spatio-temporal alignment, for example, combines regularized OT for spatial comparison with soft-DTW for chronological alignment Janati et al., 2020. Here “dynamic” refers to Bellman’s dynamic programming on the index grid, not to the transport PDEs of Paragraph.

Discrete Variational Problem

Let x=(xi)i=1nx=(x_i)_{i=1}^n and y=(yj)j=1my=(y_j)_{j=1}^m be two sequences in a feature space Z\mathcal Z, and set Cij=c(xi,yj)\C_{ij}=c(x_i,y_j) for a nonnegative cost c:Z×ZR+c:\mathcal Z\times\mathcal Z\to\RR_+. A warping path is a sequence

ω=((i,j))=1L\omega=((i_\ell,j_\ell))_{\ell=1}^L

that starts at (1,1)(1,1), ends at (n,m)(n,m), and has increments

(i+1i,j+1j){(1,0),(0,1),(1,1)}.(i_{\ell+1}-i_\ell,j_{\ell+1}-j_\ell) \in\{(1,0),(0,1),(1,1)\}.

Denote the set of such paths by Ωn,m\Omega_{n,m} and the corresponding incidence matrix by (Aω)ij=1{(i,j)ω}(A_\omega)_{ij}=\mathbf1_{\{(i,j)\in\omega\}}. Its length satisfies max{n,m}Ln+m1\max\{n,m\}\leq L\leq n+m-1, its total mass is ij(Aω)ij=L\sum_{ij}(A_\omega)_{ij}=L, and its two marginals are precisely the row and column visit counts.

The definition is symmetric when cc is symmetric, but it is generally not a metric: repetitions can give zero cost to distinct sequences, and the triangle inequality can fail. Step weights, slope constraints and a Sakoe-Chiba band are common variants that penalize excessive repetition or restrict the admissible temporal distortion Sakoe & Chiba, 1978Müller, 2007.

Dynamic Programming

The monotone path structure converts the exponentially large variational problem (76) into a shortest-path computation on an acyclic grid.

Proof

Every admissible path reaching (i,j)(i,j) enters it from exactly one of (i1,j)(i-1,j), (i,j1)(i,j-1) or (i1,j1)(i-1,j-1). Removing the last cell therefore leaves an admissible path to one of these predecessors, while appending (i,j)(i,j) to any predecessor path gives an admissible path to (i,j)(i,j). Minimizing over the three mutually exhaustive last steps proves (77) by induction on i+ji+j. Each of the nmnm cells performs constant work.

Continuous Time Warping

Discrete DTW depends on the sampling density because every visited cell contributes once. A direct continuous registration minimizes 01c(x(t),y(γ(t)))dt\int_0^1 c(x(t),y(\gamma(t)))\d t over nondecreasing endpoint-fixing maps γ\gamma, but this one-clock formulation is asymmetric and privileges the parameterization of xx. Continuous DTW instead traverses both clocks and measures mismatch per unit length in the parameter square Buchin et al., 2022.

For simplicity, let x,y:[0,1]Zx,y:[0,1]\to\mathcal Z use normalized clocks, and let Γ\Gamma_\uparrow contain pairs (ϕ,ψ)(\phi,\psi) of absolutely continuous, nondecreasing surjections of [0,1][0,1] onto itself. Equivalently, the endpoint conditions are ϕ(0)=ψ(0)=0\phi(0)=\psi(0)=0 and ϕ(1)=ψ(1)=1\phi(1)=\psi(1)=1. The continuous DTW functional is

CDTWc(x,y):=inf(ϕ,ψ)Γ01c(x(ϕ(s)),y(ψ(s)))(ϕ˙(s)+ψ˙(s))ds.\mathrm{CDTW}_c(x,y) \eqdef \inf_{(\phi,\psi)\in\Gamma_\uparrow} \int_0^1 c\bigl(x(\phi(s)),y(\psi(s))\bigr) \bigl(\dot\phi(s)+\dot\psi(s)\bigr)\d s.

Because ϕ˙,ψ˙0\dot\phi,\dot\psi\geq0 almost everywhere, the last factor is the 1\ell^1 line element of the monotone path s(ϕ(s),ψ(s))s\mapsto(\phi(s),\psi(s)). Formula (78) is invariant under increasing reparameterizations of the auxiliary variable ss and does not privilege either clock; when cc is symmetric, the resulting functional is also symmetric in xx and yy. After parameterization by 1\ell^1 arc length, it is simply the line integral of the feature mismatch along a monotone path. For physical clock intervals [0,p][0,p] and [0,q][0,q], the same formula uses ϕ:[0,1][0,p]\phi:[0,1]\to[0,p] and ψ:[0,1][0,q]\psi:[0,1]\to[0,q]. Exact computation is substantially harder than the discrete recurrence: for arc-length-parametrized one-dimensional polygonal curves and the standard cost c(u,v)=uvc(u,v)=|u-v|, Buchin, Nusser and Wong propagate piecewise-quadratic boundary costs in O((n+m)5)O((n+m)^5) time Buchin et al., 2022. This complexity statement does not apply to an arbitrary feature cost cc.

Soft-DTW and the Sinkhorn Analogy

The hard minimum in (77) is nonsmooth when several paths tie. Soft-DTW replaces it with the log-sum-exp soft minimum Cuturi & Blondel, 2017,

softminϵ(r1,,rq)=ϵlog ⁣(k=1qerk/ϵ),\operatorname{softmin}_\epsilon(r_1,\ldots,r_q) = -\epsilon\log\!\left(\sum_{k=1}^q e^{-r_k/\epsilon}\right),

and defines D00ϵ=0D_{00}^\epsilon=0, Di0ϵ=D0jϵ=+D_{i0}^\epsilon=D_{0j}^\epsilon=+\infty for i,j>0i,j>0, together with

Dijϵ=Cij+softminϵ(Di1,jϵ,Di,j1ϵ,Di1,j1ϵ),sDTWc,ϵ(x,y)=Dnmϵ.D_{ij}^\epsilon = \C_{ij} +\operatorname{softmin}_\epsilon \bigl(D_{i-1,j}^\epsilon,D_{i,j-1}^\epsilon,D_{i-1,j-1}^\epsilon\bigr), \qquad \mathrm{sDTW}_{c,\epsilon}(x,y)=D_{nm}^\epsilon.

Equivalently, it is the free energy of all monotone paths,

sDTWc,ϵ(x,y)=ϵlogωΩn,mexp ⁣(Aω,Cϵ).\mathrm{sDTW}_{c,\epsilon}(x,y) = -\epsilon\log \sum_{\omega\in\Omega_{n,m}} \exp\!\left(-\frac{\dotp{A_\omega}{\C}}{\epsilon}\right).

To make the regularization explicit, let Δ(Ωn,m)\Delta(\Omega_{n,m}) be the simplex of probability laws q=(qω)ωq=(q_\omega)_\omega over paths and let H(q)=ωqωlogqωH(q)=-\sum_\omega q_\omega\log q_\omega be their Shannon entropy, with 0log0=00\log0=0. The Gibbs variational identity gives

sDTWc,ϵ(x,y)=minqΔ(Ωn,m){ωqωAω,CϵH(q)}.\mathrm{sDTW}_{c,\epsilon}(x,y) = \min_{q\in\Delta(\Omega_{n,m})} \left\{ \sum_{\omega}q_\omega\dotp{A_\omega}{\C} -\epsilon H(q) \right\}.

Its unique minimizer is the Gibbs law

Pϵ(ω)=exp(Aω,C/ϵ)ωexp(Aω,C/ϵ),Eϵ:=CsDTWc,ϵ(x,y),\PP_\epsilon(\omega) = \frac{\exp(-\dotp{A_\omega}{\C}/\epsilon)} {\sum_{\omega'}\exp(-\dotp{A_{\omega'}}{\C}/\epsilon)}, \qquad E_\epsilon \eqdef \nabla_\C\mathrm{sDTW}_{c,\epsilon}(x,y),

Indeed, subtracting the value in (81) from the objective in (82) gives ϵKL(qPϵ)0\epsilon\KL(q|\PP_\epsilon)\geq0. Moreover,

DTWc(x,y)ϵlogΩn,msDTWc,ϵ(x,y)DTWc(x,y),\mathrm{DTW}_c(x,y)-\epsilon\log|\Omega_{n,m}| \leq \mathrm{sDTW}_{c,\epsilon}(x,y) \leq \mathrm{DTW}_c(x,y),

because the partition sum is bounded below by its largest term and above by Ωn,m|\Omega_{n,m}| times that term. Hence sDTWc,ϵDTWc\mathrm{sDTW}_{c,\epsilon}\to\mathrm{DTW}_c as ϵ0\epsilon\to0. Forward and backward dynamic programs compute its value and gradient in O(nm)O(nm) time and O(nm)O(nm) memory Cuturi & Blondel, 2017. Differentiating the finite log-partition function gives

Eϵ=EωPϵ[Aω].E_\epsilon = \EE_{\omega\sim\PP_\epsilon}[A_\omega].

Thus (Eϵ)ij(E_\epsilon)_{ij} is the probability that a Gibbs path visits cell (i,j)(i,j). The matrix EϵE_\epsilon is a diffuse expected alignment and converges, when the hard optimum is unique, to its path-incidence matrix.

The analogy with entropic OT is now exact at the level of free energies, but not at the level of feasible variables. Sinkhorn regularizes a coupling with prescribed marginals, whereas soft-DTW regularizes the path law qq in (82). Its mean EϵE_\epsilon generally has neither prescribed row sums nor prescribed column sums, and the path entropy H(q)H(q) cannot in general be recovered from EϵE_\epsilon alone. Algorithmically, Sinkhorn uses alternating matrix scaling, while soft-DTW uses forward--backward dynamic programming on an acyclic grid. Global-alignment kernels sum the same Gibbs weights over all paths Cuturi et al., 2007Cuturi, 2011.

Raw soft-DTW also has an entropic self-bias and can be negative. In direct analogy with the Sinkhorn divergence of Sinkhorn Divergences, define

sDTWc,ϵ(x,y)=sDTWc,ϵ(x,y)12sDTWc,ϵ(x,x)12sDTWc,ϵ(y,y).\overline{\mathrm{sDTW}}_{c,\epsilon}(x,y) = \mathrm{sDTW}_{c,\epsilon}(x,y) -\frac12\mathrm{sDTW}_{c,\epsilon}(x,x) -\frac12\mathrm{sDTW}_{c,\epsilon}(y,y).

The correction always vanishes on the diagonal, but positivity requires care.

<IPython.core.display.Image object>

Hard and soft monotone alignments recover a nonlinear time warp. Left: an oscillatory signal xx and the warped observation y(t)=x(γ(t))y(t)=x(\gamma(t)) for a smooth increasing map γ\gamma; thin gray segments mark exact corresponding times. Middle: the pairwise squared feature-cost matrix Cij=xiyj2\C_{ij}=|x_i-y_j|^2, with the optimal DTW path shown in red. Right: the same matrix overlaid with the soft-DTW expected alignment EϵE_\epsilon from (85) at ϵ=.200\epsilon=.200; red intensity gives cell-visit probability and the dark red curve is its row-wise barycentric summary.

References
  1. Maas, J., Rumpf, M., Schönlieb, C., & Simon, S. (2015). A generalized model for optimal transport of images including dissipation and density modulation. ESAIM: Mathematical Modelling and Numerical Analysis, 49(6), 1745–1769.
  2. Maas, J., Rumpf, M., & Simon, S. (2016). Generalized optimal transport with singular sources. arXiv Preprint arXiv:1607.01186.
  3. Dolbeault, J., Nazaret, B., & Savaré, G. (2009). A new class of transport distances between measures. Calculus of Variations and Partial Differential Equations, 34(2), 193–231.
  4. Mielke, A. (2013). Geodesic convexity of the relative entropy in reversible Markov chains. Calculus of Variations and Partial Differential Equations, 48(1–2), 1–31.
  5. Ning, L., & Georgiou, T. T. (2014). Metrics for matrix-valued measures via test functions. 53rd IEEE Conference on Decision and Control, 2642–2647.
  6. Jiang, X., Ning, L., & Georgiou, T. T. (2012). Distances and Riemannian metrics for multivariate spectral densities. IEEE Transactions on Automatic Control, 57(7), 1723–1735.
  7. Ning, L., Georgiou, T. T., & Tannenbaum, A. (2015). On matrix-valued Monge–Kantorovich optimal mass transport. IEEE Transactions on Automatic Control, 60(2), 373–382. 10.1109/TAC.2014.2350171
  8. Chen, Y., Georgiou, T. T., & Tannenbaum, A. (2016). Matrix optimal mass transport: a quantum mechanical approach. arXiv Preprint arXiv:1610.03041.
  9. Chen, Y., Gangbo, W., Georgiou, T. T., & Tannenbaum, A. (2020). On the matrix Monge-Kantorovich problem. European Journal of Applied Mathematics, 31(4), 574–600. 10.1017/S0956792519000172
  10. Carlen, E. A., & Maas, J. (2014). An analog of the 2-Wasserstein metric in non-commutative probability under which the fermionic Fokker–Planck equation is gradient flow for the entropy. Communications in Mathematical Physics, 331(3), 887–926.
  11. Peyré, G., Chizat, L., Vialard, F.-X., & Solomon, J. (2019). Quantum entropic regularization of matrix-valued optimal transport. European Journal of Applied Mathematics, 30(6), 1079–1102. 10.1017/S0956792517000274
  12. Loiola, E. M., de Abreu, N. M. M., Boaventura-Netto, P. O., Hahn, P., & Querido, T. (2007). A survey for the quadratic assignment problem. European Journal of Operational Research, 176(2), 657–690. 10.1016/j.ejor.2005.09.032
  13. Lyzinski, V., Fishkind, D. E., Fiori, M., Vogelstein, J. T., Priebe, C. E., & Sapiro, G. (2016). Graph matching: relax at your own risk. IEEE Transactions on Pattern Analysis and Machine Intelligence, 38(1), 60–73.
  14. Mémoli, F. (2011). Gromov–Wasserstein distances and the metric approach to object matching. Foundations of Computational Mathematics, 11(4), 417–487.
  15. Sturm, K.-T. (2012). The space of spaces: curvature bounds and gradient flows on the space of metric measure spaces (Preprint 1208.0434). arXiv.