Papers
Topics
Authors
Recent
Search
2000 character limit reached

Computing All Optimal Partial pp-Wasserstein Matchings on the Line

Published 19 Aug 2026 in cs.CG and cs.DS | (2608.18875v1)

Abstract: For p1p \ge 1, the pp-Wasserstein distance measures the minimum cost of transporting probability mass between distributions, where moving unit mass between two points costs the ppth power of their distance. For discrete distributions in one dimension, full transport is especially simple: after sorting, mass is matched in order along the line. By contrast, partial and unbalanced transport on the line remains much less understood. Recently, Chapel and Tavenard [ICLR'25] showed that, for p=1p=1, all optimal partial transport plans between distributions supported on nn points, with uniform mass at each point, can be computed in O(nlogn)O(n\log n) time by exploiting the metric structure of the cost. For $p&gt;1$, this structure no longer applies, and existing approaches require Ω(n<sup>2)Ω(n<sup>2) time. Our main contribution is an FFT-based data structure for balanced-interval transport queries, which bypasses this quadratic bottleneck and yields an O(pnlog<sup>2</sup>n)O(p\,n\log<sup>2</sup> n)-time algorithm for computing all optimal partial transports on the line for every finite p1p\ge 1. We also provide an open-source C++ implementation that outperforms the state-of-the-art baseline on a range of synthetic instances. Finally, we establish a conditional lower bound for p=p=\infty: any subquadratic-time algorithm for computing all optimal partial transport plan costs on the line would violate the (min,+)(\min,+)-Convolution Hypothesis. This separates the problem from full optimal transport, which is solvable in O(nlogn)O(n\log n).

Summary

  • The paper presents an O(p n log² n)-time, O(n log n)-space algorithm for computing every partial p-Wasserstein cost on the line when p is a finite integer, improving the previous quadratic-time bound.
  • The method combines compact balanced-interval representations with an FFT-preprocessed range tree that answers interval-matching cost queries in O(log n) time, avoiding explicit storage of the Θ(n²) matching edges.
  • The paper proves a conditional near-quadratic barrier for p=∞ and stronger hardness results for two-interval queries, while experiments show orders-of-magnitude speedups over prior methods on large synthetic datasets.

Problem and context

The pp-Wasserstein distance between two probability measures is the ppth root of the minimum cost of transporting one measure into the other, where moving mass δ\delta between points at distance dd costs δdp\delta\, d^p. For discrete distributions supported on nn points with uniform mass, the optimal transport profile (OT-profile) maps each α[0,1]\alpha \in [0,1] to the minimum cost of a plan transporting mass α\alpha; equivalently, it is the sequence C1,,CnC_1,\dots,C_n, where CkC_k is the minimum cost of any pp0-matching between the two point sets. OT-profiles are used in noise filtering, positive-unlabeled learning, and the robust partial Wasserstein metric.

Full optimal transport on the line is trivial: after sorting, matching in order along the line is optimal for all pp1. The partial case is not. Chapel and Tavenard [ICLR'25] showed that for pp2 the entire OT-profile on the line can be computed in pp3 time; their approach exploits the metric structure of the cost. For every pp4, however, their method requires pp5 time. The quadratic barrier has a structural cause: for pp6, consecutive optimal partial matchings share edges (only pp7 distinct edges appear across all pp8), whereas for pp9 convexity makes each optimal δ\delta0-matching unique, so that δ\delta1 and δ\delta2 share no edges and the sequence of matchings contains δ\delta3 distinct edges. Any algorithm that explicitly materializes all partial matchings therefore incurs quadratic work.

Main result

The paper resolves this question for all finite integer δ\delta4: given point sets δ\delta5 of size δ\delta6, the δ\delta7-partial δ\delta8-Wasserstein distances for all δ\delta9 are computable in dd0 time using dd1 space. This matches, up to a logarithmic factor, the complexity of full one-dimensional transport, and improves the prior state of the art from dd2 to near-linear for every finite dd3.

The algorithm follows the successive-shortest-path structure of the Hungarian algorithm specialized to the line, as in Chapel–Tavenard, but replaces the quadratic interval-cost computation with a new data structure. Two ingredients matter:

  • Compact interval representation. A minimum-cost dd4-matching is represented by a set of at most dd5 disjoint balanced intervals (intervals containing equal numbers of red and blue points). Although the union of all partial matchings contains dd6 edges, this representation uses only dd7 space, and the minimum-cost dd8-matching differs from the dd9-matching by modifying only a constant number of intervals.
  • Balanced-interval queries. Identifying which intervals to modify reduces to evaluating the minimum matching cost inside balanced intervals. The paper's main technical contribution is a data structure built in δdp\delta\, d^p0 time and δdp\delta\, d^p1 space that answers such queries in δdp\delta\, d^p2 time.

The net-cost of an augmenting step then takes a simple closed form: for an adjacent free pair δdp\delta\, d^p3, it equals δdp\delta\, d^p4 if no stored interval lies inside δdp\delta\, d^p5, and otherwise δdp\delta\, d^p6 for the unique stored interval δdp\delta\, d^p7 inside δdp\delta\, d^p8. Each iteration performs a constant number of heap operations and δdp\delta\, d^p9 queries, so the nn0 iterations take nn1 total; preprocessing dominates.

The FFT-based range tree

Inside any balanced interval, the optimal matching pairs points in order, so if the leftmost red point has index nn2 and the leftmost blue point index nn3, every matched pair has shift nn4. The data structure is a binary range tree over the merged sorted order of all nn5 points. Each node nn6 stores, for every relevant shift nn7, three quantities: the total cost of shift-nn8 pairs crossing from its left child to its right child, symmetrically from right to left, and the total cost nn9 of all shift-α[0,1]\alpha \in [0,1]0 pairs contained in α[0,1]\alpha \in [0,1]1. Since relevant shifts number α[0,1]\alpha \in [0,1]2 per node, total space is α[0,1]\alpha \in [0,1]3.

A query determines the shift α[0,1]\alpha \in [0,1]4 of the input interval from its leftmost red and blue points, then aggregates precomputed values over the α[0,1]\alpha \in [0,1]5 maximal nodes covering the interval. Correctness rests on a non-obvious decomposability property: when a node's children both intersect the query interval, every shift-α[0,1]\alpha \in [0,1]6 pair crossing the node's midline lies entirely within the query interval — a consequence of balancedness combined with the order structure. Matching costs are not decomposable in general, so this property is what makes the aggregation valid.

Preprocessing avoids the naive α[0,1]\alpha \in [0,1]7 enumeration of shift values via FFT: since all red points in a left child lie left of all blue points in the right child, cross-term costs expand through the binomial identity α[0,1]\alpha \in [0,1]8, and each family of sums is a coefficient of a polynomial product computable by convolution. One FFT per binomial term per node yields α[0,1]\alpha \in [0,1]9 per node and α\alpha0 overall; the α\alpha1 values follow bottom-up in α\alpha2.

A practical caveat: the running time carries a factor α\alpha3, and the construction relies on expanding α\alpha4, so the approach is specific to integer α\alpha5; nothing in the upper bound extends to non-integer or infinite α\alpha6.

Implementation and experiments

The authors provide an open-source C++ implementation (FFTHungarian) that computes interval costs naively below a threshold of 2048 points and queries the data structure above it. Against PAWL, the optimized numba-based implementation of Chapel–Tavenard, on synthetic instances (α\alpha7) spanning normal distributions with differing means or standard deviations and unimodal-versus-bimodal mixtures, FFTHungarian is never substantially slower and becomes orders of magnitude faster once α\alpha8 and the distributions differ. Notably, even a 10% difference in mean or standard deviation drives PAWL toward its quadratic worst case while FFTHungarian scales near-linearly. The experimental regime deliberately favors the baseline (substantial distributional overlap), strengthening the comparison; the evaluation covers synthetic data only, and hardware was a single laptop-class machine.

Conditional lower bound for α\alpha9

For C1,,CnC_1,\dots,C_n0, the picture changes sharply. Assuming the C1,,CnC_1,\dots,C_n1-Convolution Conjecture, no algorithm computes all C1,,CnC_1,\dots,C_n2-partial C1,,CnC_1,\dots,C_n3-Wasserstein matching costs for C1,,CnC_1,\dots,C_n4 integer points in C1,,CnC_1,\dots,C_n5 in C1,,CnC_1,\dots,C_n6 time for any C1,,CnC_1,\dots,C_n7. The reduction first maps arbitrary C1,,CnC_1,\dots,C_n8-convolution instances to monotone C1,,CnC_1,\dots,C_n9-convolution instances via the transformation CkC_k0, CkC_k1, then observes that for increasing CkC_k2 and decreasing CkC_k3 with CkC_k4, the CkC_k5-partial CkC_k6-Wasserstein cost equals exactly the CkC_k7-convolution entry CkC_k8.

This yields a clean separation: full CkC_k9-Wasserstein transport admits subquadratic exact algorithms even in two dimensions, whereas computing the entire partial profile is conditionally quadratic-hard already on the line. The lower bound also indicates that the dependence on pp00 cannot be removed by refining the upper-bound techniques, since the same framework applied at pp01 would require pp02-convolutions.

Two further lower bounds address a strictly more general data-structure problem, the Two Intervals Matching Problem, where queries specify separate intervals for each color. Via a gadget reduction from the Hamming Distance Oracle problem (encoding bits as four-point gadgets whose Wasserstein distances distinguish equal from unequal gadgets), the paper shows: (i) unless the Combinatorial Matrix Multiplication Conjecture fails, no combinatorial data structure achieves pp03 for any pp04; and (ii) unconditionally up to the matrix multiplication exponent, pp05. The contrast with the single-interval setting — where near-linear preprocessing and pp06 queries are achieved — shows that allowing two independent query intervals provably increases the problem's difficulty.

Limitations and open questions

Several restrictions bound the applicability of the results. The upper bound requires pp07 to be a positive integer, since both the running-time dependence and the binomial-expansion technique presuppose it; whether near-linear algorithms exist for fractional pp08 remains open. The lower bound for pp09 is conditional on the pp10-Convolution Conjecture, and the Two Intervals bounds rest on matrix-multiplication conjectures, so unconditional hardness is not established anywhere in the paper. The experimental validation is confined to synthetic one-dimensional distributions with substantial overlap; behavior on real data or on distributions with little overlap is not reported. Finally, the paper leaves open whether the extra pp11 factor can be removed — the authors note that an attempted unpacking of the FFT did not yield an improvement — and whether the imbalanced (unbalanced-mass) variant admits comparable guarantees; a sketch of a persistent-tree approach for imbalanced single-interval queries appears only in preliminary form without complete proofs.

Conclusion

This paper establishes that the entire OT-profile under the pp12-Wasserstein cost on the line is computable in pp13 time for every finite integer pp14, removing the quadratic barrier that previously applied for all pp15. The key enabler is an FFT-preprocessed range tree supporting balanced-interval matching queries in logarithmic time, exploiting a decomposability property special to balanced one-dimensional intervals. Together with the conditional quadratic hardness at pp16 and the stronger hardness for two-interval queries, the results delineate precisely where partial optimal transport on the line retains the computational simplicity of full transport and where it does not.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.