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 spectral bins or several species transported on the same domain. In a conservative model the mass of each channel is preserved, so one assumes for every . The natural vector-valued extension therefore starts from the positive cone .
For the dynamic formulas below, assume that is either , the flat torus, or a bounded convex domain in 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 and a spatial flux , where is the velocity of channel in spatial direction . The conservative vector transport cost associated with an action density is
subject to the endpoint constraints , and the componentwise continuity equation
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.
The notation does not by itself imply a distance for an arbitrary action . Sufficient structural conditions are reversibility and quadratic time scaling for , together with lower semicontinuity and coercive nondegeneracy. The latter means that curves with vanishing action cannot join two distinct endpoints. Time reversal then gives symmetry, while concatenation with an optimal allocation of time gives the triangle inequality for the square root of (2). Thus is an extended distance on each finite-action component. Equality of all channel masses is necessary for finiteness; without these assumptions, the formula is only a dynamic transport cost and may be asymmetric or degenerate.
A simple quadratic family is obtained from a mobility matrix :
with the usual convention that the value is finite only when each belongs to the range of . If is linear and takes values in , this action is jointly convex and positively one-homogeneous in . Indeed, the matrix fractional map is jointly convex on its effective domain, and for . For and , one recovers exactly the scalar Benamou--Brenier action. For
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 and ,
increases the mobility in the common channel direction while leaving transverse directions controlled by the diagonal part. The local cost of moving one component can therefore depend on the densities and velocities of the other components, even though each component mass remains conserved.
For the linear mobility actions above, these requirements hold: the action is even and quadratic in , while the range convention and finite-dimensional coercivity make it separating on its effective domain. Their lower-semicontinuous measure extensions therefore define extended distances on the finite-action components with prescribed channel masses. The diagonal choice, writing , gives the weighted product metric whose squared value is .
The conservative positive-cone model above is the basic extension of Benamou--Brenier. Adding a source term and a convex perspective penalty in 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 , where each positive channel is transported by its quantile map, with a large- 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 , where each positive channel is transported by its quantile map, with a large- illustrative common-mode interpolation in which the channels move more coherently.

One-dimensional positive -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 , and time runs vertically from the red source to the blue target. Left: for , the diagonal mobility gives two independent scalar quantile geodesics. Right: a large- common-mode interpolation bends the display toward , 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, is a symmetric matrix of finite signed measures such that for every Borel set . If has density , then is the scalar amount of mass at , while, wherever , the normalized matrix 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 and symmetric matrix fluxes . With no flux through the boundary of , the full matrix mass is conserved, so the endpoints must have the same total matrix. The model minimizes the matrix-perspective action
subject to , and to the matrix-valued continuity equation
Here denotes the Moore--Penrose inverse, with the usual lower-semicontinuous perspective convention: the action is finite only when the columns of each belong to the range of . The matrix fractional map is jointly convex on this effective domain and positively one-homogeneous in . This gives the simplest non-trivial matrix-valued transport model: spatial motion is conservative, but the fiber carries orientation through the eigenvectors of .
Here is an extended distance. The action is invariant under , quadratic under time rescaling, and zero only for on its effective domain. These properties give symmetry, the triangle inequality, and definiteness. The value is finite only between endpoints joined by a finite-action curve; equality of their total matrices is necessary but need not by itself guarantee finiteness. Consequently, is a genuine distance on each finite-action component and is between distinct components.
Proof
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 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 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 matrix fibers, using two localized matrix modes whose eigenvalue profiles share a common center at each mode.

Positive 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 , 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 Wasserstein construction can itself be iterated: once is a metric space, is again a metric space and can serve as the ground space for another Wasserstein distance. This is useful when the objects to compare are random probability measures, or mixtures whose components are meaningful objects rather than only a collapsed density. We first record the structure of this new ground space, then distinguish a law of measures from its collapsed mixture, and finally transport such laws.
Wasserstein Spaces as Ground Spaces¶
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 -Cauchy sequence, extract a subsequence such that . Gluing optimal couplings of consecutive terms produces random variables with laws and . Hence converges almost surely and in to an -valued random variable, whose law is the limit. Separability follows by approximating measures with finitely supported measures on a countable dense subset and rational weights. If is compact, Prokhorov compactness and Wasserstein metrization of weak convergence give compactness.
Random Measures and Collapsed Mixtures¶
Fix . Elements of are probability laws over probability measures, or random probability measures. A measurable parametric family gives
This law belongs to precisely when, for one and hence every ,
The term “barycentric mixture” should not be confused with the Wasserstein barycenter of Definition Definition: Optimal-Transport Barycenter in Section OT Barycenters. The collapse (19) is linear in , whereas a Wasserstein barycenter gives a nonlinear way to reduce a law over measures to one measure by minimizing its average transport cost.
If , then because
Transport Between Random Measures¶
Having equipped with the ground distance , one applies the ordinary Kantorovich construction to probability laws on this space:
For , Gaussian mixtures provide an explicit example with two geometries. A mixture can be viewed as a collapsed density on , or as a component law over Gaussian atoms in the Bures--Wasserstein space. For two component laws
the component-level problem uses the cost
If is an optimal coupling between the weights and , and if is the Brenier linear part from to , each active pair follows the Gaussian geodesic
Collapsing these component geodesics gives
This component-level interpolation generally differs from the true 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.

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 . 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 between and and . A measurable-selection theorem gives a measurable kernel whose cost is at most . Integrating this kernel against gives a coupling between the collapsed mixtures. Its cost is at most the -average of plus . Letting , taking the infimum over , and then taking the -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 to compare histograms , 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 and represent relationships between points. A typical scenario is when these matrices are powers of distance matrices. Define the quadratic distortion and its minimum by
where and is usually . This is a non-convex quadratic problem over the transport polytope. In the uniform case with and 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.

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 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 and , define
Proof
Let be any coupling between and . For two independent pairs , the reverse triangle inequality gives
Taking the norm and using Minkowski gives a bound by . Optimizing over 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 and is optimal, then holds -almost everywhere. By continuity, this equality holds on . Both and are isometric to the support space , where
The first projection is measure-preserving and distance-preserving on , and compactness gives surjectivity onto ; the same argument applies to the second projection.
For the triangle inequality, glue optimal couplings between and between . The projected marginal is feasible, and the pointwise triangle inequality together with Minkowski gives
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 , couple and by the diagonal coupling on . The distance difference is exactly
so , where . Applying the triangle inequality to 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.

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 , 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.
Mapping each point to its distance-profile distribution and pushing forward the ambient measure produces a distribution over distributions. This is a direct instance of the Wasserstein-over-Wasserstein geometry defined in (21) and developed in Section Wasserstein Over Wasserstein.
Proof
Fix any . It induces a coupling between the profile laws, hence
For fixed , the map pushes the same coupling to a coupling between and . Integrating the resulting one-dimensional OT bound over gives the GW objective for . Taking the infimum over proves the claim.
The next figure exposes the two nested transport problems for the planar shapes and : 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 and : sorting each distance profile computes the one-dimensional costs, then an outer assignment couples the resulting profile laws.

Mémoli distance profiles expose a computable lower bound for intrinsic GW comparison. The planar shapes and 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 , 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 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
where and . 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 , one often seeks a stationary point of the entropic relaxation
For symmetric distance matrices, define the half-gradient
A standard fixed-point linearization Peyré et al., 2016 computes
The factor is essential because 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 and a parameter , one minimizes
The endpoints and 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.

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 are compact subsets of a common metric space , their Hausdorff distance is
The Gromov--Hausdorff distance removes the common ambient space by minimizing this quantity over all isometric embeddings into a third space:
Equivalently, it is half the minimal distortion of a correspondence between and 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¶
For and , the tensor product is the linear operator determined by
In product bases and , the operator can equivalently be viewed as the four-index tensor
The full and partial traces then read
In particular, . The feasible set below is never empty, since has partial traces and whenever and are density matrices.
The feasible set is never empty, since has marginals and .
Proof
Introduce Hermitian Lagrange multipliers and for the two marginal constraints. Using (54), the Lagrangian is
Minimizing over gives a finite lower bound if and only if , in which case the infimum in is 0. When , the coupling is strictly feasible, so Slater’s theorem gives equality of primal and dual values and dual attainment.
For singular marginals, let be their support projections. Positivity and
imply . Thus the primal is exactly the problem compressed to , 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 by leaves both the constraint and the value unchanged because .
Entropic Regularization and Bregman Iterations¶
For define
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 . 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 would have entropy directional derivative at the boundary while changing the linear cost at finite rate. Slater’s condition justifies the Lagrange dual computation. The Fenchel identity
is the matrix analogue of the scalar exponential conjugacy. Applying it to the Lagrangian with gives (63), and the stationarity condition gives (64); differentiating the dual objective with respect to and yields the two marginal equations.
Writing , the objective differs by a constant from times the quantum KL divergence
The exact quantum analogue of Sinkhorn is an implicit alternating Bregman projection scheme onto the affine marginal sets
Proof
Since ,
For the projection of a positive definite matrix onto , the affine set contains the positive definite point . 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
for a Hermitian multiplier . Hence . If , this is again ; the multiplier is fixed by the marginal equation. The same argument applies to . Finally, the first-order optimality condition for maximizing (63) 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
do not admit scalar division formulas, because the exponential of cannot be separated unless the local potential commutes with the cost.
Gurvits Scaling and Quantum Sinkhorn¶
The exact Bregman scheme above has a major computational obstruction: unlike classical marginal rescaling, projection onto either non-commutative marginal constraint requires solving a nonlinear matrix equation and has no closed form in general. Gurvits scaling instead provides an explicit fixed-point construction of a feasible quantum coupling, used as a surrogate for entropic QOT. Its iterates do not minimize the entropic QOT objective and, outside special commuting settings, do not generally arise as block minimizations of a global energy. In the diagonal case, however, the construction coincides with classical Sinkhorn and hence recovers its variational interpretation.
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 (64) by the symmetric factorization
where , and . For two matrices , their commutator is . Thus means that and commute; in this case , whereas otherwise is a Strang-type symmetric surrogate.
To make the Choi identification unambiguous, use the product bases fixed above and associate with the positive linear map and its Hilbert--Schmidt adjoint through
Equivalently,
The adjoint relation is . In the standard Choi convention, the completely positive map with Choi matrix is ; convention (72) merely places this basis-dependent transpose in the Choi identification rather than in the marginal equations. With this convention, the marginal equations for the symmetric coupling are exactly
and can be enforced by the congruence normalizations
These inverse square roots are well-defined when and . 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 and be two sequences in a feature space , and set for a nonnegative cost . A warping path is a sequence
that starts at , ends at , and has increments
Denote the set of such paths by and the corresponding incidence matrix by . Its length satisfies , its total mass is , and its two marginals are precisely the row and column visit counts.
The definition is symmetric when 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 (79) into a shortest-path computation on an acyclic grid.
Proof
Every admissible path reaching enters it from exactly one of , or . Removing the last cell therefore leaves an admissible path to one of these predecessors, while appending to any predecessor path gives an admissible path to . Minimizing over the three mutually exhaustive last steps proves (80) by induction on . Each of the 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 over nondecreasing endpoint-fixing maps , but this one-clock formulation is asymmetric and privileges the parameterization of . Continuous DTW instead traverses both clocks and measures mismatch per unit length in the parameter square Buchin et al., 2022.
For simplicity, let use normalized clocks, and let contain pairs of absolutely continuous, nondecreasing surjections of onto itself. Equivalently, the endpoint conditions are and . The continuous DTW functional is
Because almost everywhere, the last factor is the line element of the monotone path . Formula (81) is invariant under increasing reparameterizations of the auxiliary variable and does not privilege either clock; when is symmetric, the resulting functional is also symmetric in and . After parameterization by arc length, it is simply the line integral of the feature mismatch along a monotone path. For physical clock intervals and , the same formula uses and . Exact computation is substantially harder than the discrete recurrence: for arc-length-parametrized one-dimensional polygonal curves and the standard cost , Buchin, Nusser and Wong propagate piecewise-quadratic boundary costs in time Buchin et al., 2022. This complexity statement does not apply to an arbitrary feature cost .
Soft-DTW and the Sinkhorn Analogy¶
The hard minimum in (80) is nonsmooth when several paths tie. Soft-DTW replaces it with the log-sum-exp soft minimum Cuturi & Blondel, 2017,
and defines , for , together with
Equivalently, it is the free energy of all monotone paths,
To make the regularization explicit, let be the simplex of probability laws over paths and let be their Shannon entropy, with . The Gibbs variational identity gives
Its unique minimizer is the Gibbs law
Indeed, subtracting the value in (84) from the objective in (85) gives . Moreover,
because the partition sum is bounded below by its largest term and above by times that term. Hence as . Forward and backward dynamic programs compute its value and gradient in time and memory Cuturi & Blondel, 2017. Differentiating the finite log-partition function gives
Thus is the probability that a Gibbs path visits cell . The matrix 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 in (85). Its mean generally has neither prescribed row sums nor prescribed column sums, and the path entropy cannot in general be recovered from 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
The correction always vanishes on the diagonal, but positivity requires care.

Hard and soft monotone alignments recover a nonlinear time warp. Left: an oscillatory signal and the warped observation for a smooth increasing map ; thin gray segments mark exact corresponding times. Middle: the pairwise squared feature-cost matrix , with the optimal DTW path shown in red. Right: the same matrix overlaid with the soft-DTW expected alignment from (88) at ; red intensity gives cell-visit probability and the dark red curve is its row-wise barycentric summary.
- 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.
- Maas, J., Rumpf, M., & Simon, S. (2016). Generalized optimal transport with singular sources. arXiv Preprint arXiv:1607.01186.
- 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.
- 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.
- Ning, L., & Georgiou, T. T. (2014). Metrics for matrix-valued measures via test functions. 53rd IEEE Conference on Decision and Control, 2642–2647.
- 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.
- 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
- Chen, Y., Georgiou, T. T., & Tannenbaum, A. (2016). Matrix optimal mass transport: a quantum mechanical approach. arXiv Preprint arXiv:1610.03041.
- 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
- 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.
- 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
- 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
- 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.
- Mémoli, F. (2011). Gromov–Wasserstein distances and the metric approach to object matching. Foundations of Computational Mathematics, 11(4), 417–487.
- Sturm, K.-T. (2012). The space of spaces: curvature bounds and gradient flows on the space of metric measure spaces (Preprint 1208.0434). arXiv.