---
title: Approximate Earth Mover’s Distance (EMD)
url: https://www.emergentmind.com/topics/approximate-earth-mover-s-distance-emd
type: topic
---

# Approximate Earth Mover’s Distance (EMD)

Searching arXiv for the provided papers to ground the article.
Approximate Earth Mover’s Distance (EMD) comprises algorithmic, geometric, streaming, indexing, and learned methods for estimating the transportation cost between two distributions without solving the full optimal transport problem exactly. In its standard form, EMD is the minimum cost of moving mass from one distribution to another under a ground distance, and exact computation is often computationally intensive or memory intensive. Approximation results therefore target different regimes: $(1+\varepsilon)$-approximation for discrete or geometric inputs, additive approximation in truly-subquadratic time for arbitrary cost matrices, lower-bound relaxations for search and indexing, and differentiable surrogates for learning pipelines [2104.08136; 2310.19514].

## 1. Formal definition and approximation regimes

For two distributions of equal total mass, the Earth Mover’s Distance measures the cost of transforming one distribution into the other, where the cost of moving a unit of mass is equal to the distance over which it is moved. In the continuous geometric setting, a transport plan is a nonnegative measurable function $\lambda(p,s)$ describing how much infinitesimal mass at $p$ is sent to $s$, and the EMD is
\[
d_e(P,S)\;=\;\inf_{\lambda\in H}\;\int_{P}\int_{S}d(p,s)\;d\lambda(p,s),
\]
where $H$ is the set of all joint measures on $P\times S$ whose marginals match the given distributions [2104.08136].

In the discrete setting, EMD is the standard minimum-cost flow or matching problem. For weighted points one recovers
\[
d_e(P,S)\;=\;\min_{f_{i,j}\ge0}\;
\sum_{i=1}^n\sum_{j=1}^m f_{i,j}\,d(p_i,s_j)
\]
subject to the supply and demand constraints. For histograms $P,Q$ with cost matrix $(c_{i,j})$, the EMD formulation used in additive-approximation work is
\[
\mathrm{EMD}(P,Q)
=\min_{\pi\in\mathbb R_+^{n\times n}}
\sum_{i,j}c_{i,j}\,\pi_{i,j}
\]
with the usual row and column marginal constraints [2310.19514].

Approximation objectives differ substantially across problem classes. The geometric-object algorithms give a $(1+\varepsilon)$-approximation when one side is a set of weighted points and the other side is a set of line segments, triangles or $d$-dimensional simplices, and a $(1+\varepsilon)$-approximation with a small additive term when both sides are continuous objects such as segments, triangles, or simplices [2104.08136]. For arbitrary $n\times n$ cost matrices, an additive approximation scheme estimates EMD up to a $\gamma$-additive approximation in truly-subquadratic time $O(n^{2-\delta(\gamma)})$ and makes no assumptions about triangle inequality [2310.19514]. In data streams, approximation guarantees include a $(1+\epsilon)$-approximation in the insertion-only model and an $O(\min(k^3,\log\Delta))$-approximation in the turnstile model under a small-support assumption [1404.6287].

These regimes are not interchangeable. When neither side is a point set in the continuous geometric setting, the optimal transport cost can be arbitrarily small, so purely multiplicative approximation is impossible [2104.08136]. In high-dimensional point-set settings, fine-grained hardness results show that significant improvements in exact and approximate algorithms would contradict the Orthogonal Vectors Conjecture or the Hitting Set Conjecture [1909.11068]. This suggests that “approximate EMD” is not a single algorithmic notion but a family of problem-specific compromises between multiplicative error, additive error, dimensional dependence, and output format.

## 2. Approximation for continuous geometric objects

For weighted geometric objects, approximation proceeds by reducing continuous transport to discrete transport through subdivision and discretization. When $P$ is a set of weighted points and $S$ is a set of line segments, the algorithm sets $\delta\leftarrow \varepsilon/17$, subdivides each segment so that distances from any fixed point vary by at most a $(1+\delta)$ factor on each subsegment unless the subsegment lies within $\delta/(nm)$ of the point, replaces each subsegment by a representative point of equal weight, invokes a black-box $(1+\delta)$-approximation for discrete EMD, and then spreads the resulting flow evenly over the original subsegments [2104.08136].

The key analytical structure is a lower bound by discrete flow plus a bounded discretization loss. In the plane with $L_2$ distance, the minimum-cost flow on the bipartite graph between points and subdivided subsegments has cost $W^*\le d_e(P,S)$, and the final transport plan satisfies
\[
\mathrm{cost}(\lambda)\le (1+17\delta)\,d_e(P,S).
\]
Setting $\delta=\varepsilon/17$ yields a $(1+\varepsilon)$-approximation. The overall running time is $O((nm/\varepsilon)\cdot \mathrm{polylog}(nm/\varepsilon))$ [2104.08136].

The same scheme extends to triangles and $d$-simplices by replacing segment subdivisions with square-/cube-quadtree subdivisions. In 2D one shows $|Q|=O((nm)/\delta^2\cdot \log(nm\Delta/\delta))$, and in $d$ dimensions
\[
|Q|=O(d^{O(d)} (n m)/\delta^d\cdot\log((n m)^{1/d}\Delta/\delta)).
\]
The same lemmas yield $\mathrm{cost}(\lambda)\le (1+21\delta)d_e(P,S)$, so setting $\delta=\varepsilon/21$ gives a $(1+\varepsilon)$-approximation for points to triangles or simplices [2104.08136].

When both sides are continuous, the main obstacle is that the optimum can be arbitrarily small. The algorithms therefore introduce a small-distance greedy match that removes parts of $P$ and $S$ lying within a radius threshold, incurring only a controlled additive cost, and then apply the same subdivision-to-discretization reduction to the remainder [2104.08136]. For segments↔segments in the plane, Theorem 3.5 gives
\[
\mathrm{cost}(\lambda)\le (1+3\delta)\,d_e(P,S)+5\delta/(nm),
\]
so setting $\delta=\varepsilon/3$ yields $(1+\varepsilon)$ multiplicative plus $O(\varepsilon/(nm))$ additive, with running time $O((nm/\varepsilon^2)\cdot \mathrm{polylog}(nm/\varepsilon))$ [2104.08136]. For triangles↔triangles, the additive term is $O(\delta/\sqrt{nm})$, and for $d$-simplices↔$d$-simplices the final plan has cost at most $(1+O(\varepsilon))\,d_e + O(\varepsilon/(nm)^{1/d})$ [2104.08136].

A central feature of these results is that the algorithms actually calculate the transport plan, rather than just the cost, and the paper states that these are the first combinatorial algorithms with a provable approximation ratio for the Earth Mover’s Distance when the objects are continuous rather than discrete points [2104.08136].

## 3. Discrete algorithmic paradigms

Approximation algorithms for discrete EMD span several distinct paradigms: subquadratic additive schemes, primal-dual regularization, streaming sketches, nearest-neighbor heuristics with analysis, and lower-bound relaxations for massively parallel search.

A concise comparison of representative guarantees is given below.

| Setting | Guarantee | Running time / space |
|---|---|---|
| Arbitrary $n\times n$ cost matrix | $\mathrm{EMD}\le \widehat{\mathrm{EMD}}\le \mathrm{EMD}+\gamma$ | $O(n^{2-\delta(\gamma)})$ [2310.19514] |
| Insertion-only stream, one side has $k$ distinct points | $(1+\epsilon)$-approximation | $O(k\epsilon^{-2}\log^{4}n)$ space [1404.6287] |
| Turnstile stream, one side has $k$ distinct points | $O(\min(k^3,\log\Delta))$-approximation | $O(\log^{3}\Delta\cdot\log\log\Delta\cdot\log n)$ space [1404.6287] |
| Flux formulation with $L_1$ type regularization | approximate EMD via primal-dual updates | per iteration $O(N)$, memory $O(N)$ [1609.07092] |
| NNS-EMD | practical approximation with theoretical error bound | memory $O(n)$ [2401.07378] |
| OMR / ICT / ACT-$k$ | lower bounds with $RWMD\le OMR\le ACT\text{-}k\le ICT\le EMD$ | linear-complexity GPU variants for constant $k$ [1812.02091] |

For arbitrary costs, the truly-subquadratic additive scheme adapts a classical primal–dual algorithm for minimum-weight bipartite matching and implements its main steps in sublinear time via the oracles **LargeMatchingForward** and **AugmentEligible**. After $T=O(1/\gamma^3)$ outer iterations, there are at most $\gamma n$ unmatched vertices on each side, and discarding these as outliers yields the additive approximation guarantee [2310.19514]. The method works even when the costs do not satisfy triangle inequality, and it extends to max-cardinality bipartite matching with a knapsack constraint [2310.19514].

A different route reformulates EMD as an $L_1$ type minimization over a flux field:
\[
\inf_{m}\;
\int_{\Omega}\|m(x)\|_{1}\,dx
+\frac{\varepsilon}{2}\!\int_{\Omega}\|m(x)\|_{2}^{2}\,dx
\quad\text{s.t.}\quad
\nabla\!\cdot m(x)+\rho^1(x)-\rho^0(x)=0.
\]
The quadratic perturbation restores uniqueness for any $\varepsilon>0$, and a Chambolle–Pock primal–dual iteration yields closed-form local updates based on shrinkage. Per iteration cost is $O(N)$, memory scales like $O(N)$, and the overall method is described as typically near-linear in problem size [1609.07092]. This is an approximation in the sense that the regularized problem converges to a particular solution of the original $L_1$ problem as $\varepsilon\to 0$ [1609.07092].

In streaming models, the insertion-only $(1+\epsilon)$ algorithm uses a $(k,\epsilon)$-coreset for $k$-median on one multiset and stores the other multiset when the number of distinct points is at most $k$; the final answer computes EMD between the coreset and the stored set [1404.6287]. The turnstile algorithm instead combines multiple random grid shifts, turnstile $\ell_1$-sketches, and an $\ell_0$-sketch, and returns an $O(\min(k^3,\log\Delta))$-approximation [1404.6287].

For large-scale discrete histograms, NNS-EMD repeatedly matches each active consumer to its nearest active supplier, assigns flow by a Random Protocol or Greedy Protocol, and peels off exhausted weights. The constructed flow is feasible, and the paper states the error bound
\[
0\le \mathrm{Cost}(F^*)-\mathrm{Cost}(F^{opt})\le \sum_{i=1}^m D_{i,j_i^*}.
\]
Memory is $O(n)$, and GPU vectorization reduces the per-iteration nearest-neighbor step in practice [2401.07378]. Lower-bound relaxations such as OMR, ICT, and ACT-$k$ instead impose weakened in-flow constraints; the ordering
\[
RWMD\le OMR\le ACT\text{-}k\le ICT\le EMD
\]
is explicit, and the linear-complexity GPU implementation LC-ACT-$k$ has overall time $O(vhm+nhk)$ for constant $k$ [1812.02091].

## 4. High-dimensional, search, and sketch-based approximation

High-dimensional EMD has motivated reductions, embeddings, and hashing schemes that trade exact transport for subquadratic time or efficient nearest-neighbor search. A recent reduction shows that if a $(1+\varepsilon)$-approximate Closest Pair can be computed in time $n^{2-\phi}$, then a $1+O(\varepsilon)$ approximation to EMD can be computed in time $n^{2-\Omega(\phi)}$. Plugging in the fastest known Closest Pair algorithm yields a randomized $(1+\varepsilon)$-approximation for EMD on high-dimensional point sets in time
\[
\tilde O\!\left(nd+n^{2-\tilde\Omega(\varepsilon^{1/3})}\right),
\]
improving over the prior fastest running time of $n^{2-\Omega(\varepsilon^2)}$ [2508.06774].

The technical core of that reduction is a sublinear implementation of the Multiplicative Weights Update framework for EMD. The weights are never explicitly stored; instead, the algorithm stores only the current dual variables $(\alpha,\beta)\in\mathbb R^{2n}$ and samples implicitly from the induced constraint distribution using a Closest Pair oracle plus rejection sampling [2508.06774]. This suggests that geometric structure can replace explicit quadratic-sized flow representations in high dimension.

For nearest-neighbor search under $\mathsf{EMD}_s(\mathbb R^d,\ell_p)$, data-dependent locality sensitive hashing improves the approximation from the data-independent $O(\log^2 s)$ of Andoni–Indyk–Krauthgamer to $\tilde O(\log s)$. The final theorem states that for any distribution $\mu$ on $\mathsf{EMD}_s(\mathbb R^d,\ell_p)$, there is a random hash with approximation factor
\[
c=\widetilde O\!\Bigl(\tfrac{\log s}{1-p_1}\Bigr)\cdot \log\tfrac1{p_2}
=\tilde O(\log s)
\]
for constant $p_1,p_2$, computable in $\mathrm{poly}(sd)$ time [2403.05041]. The same paper states that the resulting data-dependent LSH also gives optimal (distributional) sketches for the Earth Mover’s Distance, and that the approximation is optimal up to $\mathrm{poly}(\log\log s)$ factors among schemes that collide close points with constant probability [2403.05041].

In bounded-doubling metrics, approximation can be shifted to preprocessing and query data structures. With $\tilde O(n^2)$ preprocessing time, one can build a data structure of size $\tilde O(n^{1+\varepsilon})$ that returns an $O(\alpha_X/\varepsilon)$-approximation in $\tilde O(n)$ query time, where $\alpha_X$ is the doubling dimension [1002.4034]. A weaker “encoding scheme” computes an encoding $F(\mu)$ in $\tilde O(n^{1+\varepsilon})$ time so that from $F(\mu)$ and $F(\nu)$, EMD can be $O(\alpha_X/\varepsilon)$-approximated in $\tilde O(n^\varepsilon)$ time [1002.4034].

Several indexing methods are lower-bound based rather than approximation-scheme based. A Hilbert-curve method maps bins to one dimension, computes the 1D cumulative-difference EMD, and repeats with multiple random shifts; overall complexity is $O(Rn)$, and the paper states a theorem giving $(1\pm\varepsilon)$ approximation with probability at least $1-\exp(-\Omega(R))$ when $R=O(1/\varepsilon^2)$ [1106.1521]. For uncertain databases, another approach projects distributions onto a vector, approximates each projected distribution by a normal distribution plus error terms, represents each normal as a point in a Hough transformed space, and uses stochastic dominance for indexing. The resulting lower bound $L_{\mathrm{EMD}}$ satisfies
\[
L_{\mathrm{EMD}}(P,Q)\le EMD_1(P,Q)\le EMD(P,Q),
\]
and empirical speed-ups are reported for $K$-NN query processing [1111.7168].

## 5. Learned and differentiable approximations

Approximate EMD is also used as a differentiable or fast surrogate in machine learning, especially when exact optimal transport is too slow to serve as a training loss.

DeepEMD approximates EMD between point clouds by predicting the matching itself rather than regressing the scalar distance. The input is the concatenation of two point clouds with a learned group-ID embedding and a small positional embedding, processed by a Transformer encoder with $L=8$ multi-head self-attention layers, $H=6$ heads, and model dimension $d_{\mathrm{model}}\approx 78$. A matching head produces an attention matrix, from which directional matchings are extracted; the training loss is the average of two directional cross-entropies against the Hungarian one-hot matching [2311.09998]. The approximate EMD is then computed from the predicted assignments, and the paper reports that on point clouds of size $1024$, DeepEMD is approximately $100\times$ faster than Hungarian and approximately $40\times$ faster than $100$-iteration Sinkhorn, with Pearson $r>0.999$, Spearman $\rho>0.999$, and Kendall $\tau>0.98$ on held-out pairs [2311.09998].

A CNN-based differentiable approximation is used for detector-image comparisons in high-luminosity LHC data compression. The surrogate network takes a pair of $4\times4\times3$ tensors, applies four 2D-convolutional layers with $32$ filters and kernel size $5\times5$, one dense layer with $256$ neurons, and a final linear output, with symmetrization
\[
f(x_1,x_2)=\tfrac12\bigl(g(x_1,x_2)+g(x_2,x_1)\bigr).
\]
Ground-truth labels are computed offline via `ot.emd2(...)`, and the surrogate is trained with mean-squared error on EMD [2306.04712]. On the validation set, the reported mean relative error is approximately $-1.3\%$ and $\sigma_{\mathrm{rel}}\approx 5.3\%$, while a single forward pass on a GPU takes $\mathcal O(0.1\text{--}1)$ ms versus $\mathcal O(10\text{--}100)$ ms for a standard linear-program EMD solver, giving an approximately $10^2\times$ speed-up in inference [2306.04712].

These methods do not provide the same type of guarantee as a provable $(1+\varepsilon)$-approximation algorithm. DeepEMD emphasizes accurate estimation of the EMD and its gradient, explicit matching prediction, and strong out-of-distribution behavior on point clouds several times larger than those seen during training [2311.09998]. The LHC surrogate emphasizes differentiability and downstream utility as a training loss for an autoencoder-inspired neural network, where training with the EMD CNN loss improves median EMD and cluster $p_T$ resolution relative to MSE-based losses [2306.04712]. A plausible implication is that learned approximations are most useful when gradient fidelity or end-to-end optimization is more important than worst-case approximation guarantees.

## 6. Guarantees, lower bounds, and limitations

Approximate EMD methods are constrained not only by implementation trade-offs but also by negative results in fine-grained complexity. Under the Orthogonal Vectors Conjecture, there is a constant $c>0$ such that exact EMD in dimension $\Omega(c^{\log^* n})$ cannot be computed in truly subquadratic time [1909.11068]. Under the Hitting Set Conjecture, for every constant $\delta>0$ and any $d(n)=\omega(\log n)$, there is no truly subquadratic-time algorithm that outputs a bijection with cost at most $(1+1/n^\delta)\cdot EMD(A,B)$ [1909.11068]. The paper also shows that asymmetric EMD matching cannot be approximated in truly subquadratic time for $\eta=1/\omega(\log n)$ in $\omega(\log n)$ dimensions [1909.11068].

These hardness statements matter because many nearly-linear-time or subquadratic approximation schemes exhibit exponential dependence on dimension or weaken the problem in some other way. The conditional lower bounds explicitly note that all known nearly-linear-time approximation schemes for EMD have a factor $d^{O(d)}$ or $\varepsilon^{-O(d)}$ dependence, and that improving the dependence on $d$ or beating quadratic in $n$ for nontrivial approximation would refute standard conjectures in fine-grained complexity [1909.11068].

Limitations also arise within individual approximation paradigms. In the continuous-object setting, when neither side is a point set, purely multiplicative approximation is impossible because the optimal transport cost can be arbitrarily small [2104.08136]. In ACT-$k$ and related lower-bound relaxations, approximation quality depends on histogram overlap pattern, and there are no strict additive or multiplicative error bounds in high dimensions [1812.02091]. In NNS-EMD, the method is presented as achieving high accuracy, low time complexity, and high memory efficiency, but it remains an iterative approximation whose practical behavior depends on the number of active-set reductions and on the choice between the Random Protocol and Greedy Protocol [2401.07378]. In learned surrogates, DeepEMD still has quadratic attention cost, and hard argmax assignments break gradient flow; the LHC surrogate gives no formal proof of convergence to the true EMD [2311.09998; 2306.04712].

Taken together, these results delineate the current meaning of approximate EMD. Provable $(1+\varepsilon)$ schemes exist for several geometric and discrete settings, additive approximation breaks the quadratic barrier for arbitrary costs, sketching and LSH support search and indexing, and differentiable surrogates enable gradient-based optimization. At the same time, dimensional dependence, additive terms, support assumptions, and hardness results impose clear limits on what approximation can achieve in general [2104.08136; 2310.19514; 1909.11068].

Source: https://www.emergentmind.com/topics/approximate-earth-mover-s-distance-emd