Computing All Optimal Partial $p$-Wasserstein Matchings on the Line
Sebastian Angrick, Jacobus Conradi, Mónika Csikós, Niko Hastrich, Danny Mittal, André Nusser, Krzysztof Onak, Sharath Raghvendra
TL;DR. For one-dimensional partial optimal transport with cost d(a,b)^p, we give an O(p n log^2n)-time algorithm for all p, which underlies our implementation outperforming the state of the art, and a conditional lower bound for p=∞.
Abstract. For , the -Wasserstein distance measures the minimum cost of transporting probability mass between distributions, where moving unit mass between two points costs the th 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 , all optimal partial transport plans between distributions supported on points, with uniform mass at each point, can be computed in time by exploiting the metric structure of the cost. For , this structure no longer applies, and existing approaches require time. Our main contribution is an FFT-based data structure for balanced-interval transport queries, which bypasses this quadratic bottleneck and yields for any finite an -time algorithm for computing all optimal partial -Wasserstein transports costs on the line. We also provide an open-source C++ implementation that outperforms the state-of-the-art baseline on a range of synthetic instances. Finally, we show that computing all optimal partial -Wasserstein transport costs is (up to poly-logarithmic factors) equivalent to -convolution, for which the fastest currently claimed algorithm requires time.
Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.
Claim this paperedit · history
NeurIPS 2026
Accept (poster) · 3 reviews · OpenReview
Updated 25 Nov 2026, 03:43 UTC.
- Decision
- Accept (poster)
Read decision
Meta-review
Weaknesses were generally not shared by multiple reviewers. The authors should thoroughly address each of the reviewer's perspectives in their rebuttal.
Final justification
All reviewers are in favor of accepting the paper.
- Final justification
- All reviewers are in favor of accepting the paper.
Read meta-review
Meta-review
Weaknesses were generally not shared by multiple reviewers. The authors should thoroughly address each of the reviewer's perspectives in their rebuttal.
- Rating
- 5/6
- Confidence
- 3/5
- Quality
- 4/4
- Clarity
- 4/4
- Significance
- 3/4
- Originality
- 3/4
- Contribution type
- theory
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
This paper introduces a new algorithm for efficiently computing all partial -Wasserstein distance between two on-dimensional distributions of items each, consisting of chunks of unit mass . This new algorithm is applicable to all and computes for all the -partial -Wasserstein distance in time , thus outperforming the previous best-known approach, which exhibits an runtime once . This result is achieved by introducing a data structure that maintains optimal partial distances in form of a binary tree. For each subtree, optimal distances are computed recursively, and between two neighbors in the tree, the optimal distances are computed via the fast Fourier transform, as the formalization admits an expression as a convolution. This is the main technical contribution of the paper.
The results are complemented by empirical tests on artificial problems, showcasing that the new approach highly outperforms the preceding best algorithm for large instance sizes, and it is otherwise comparable. Moreover, the paper shows a conditional quadratic lower bound for computing partial Wasserstein distances once . This lower bound holds for different conjectures, most of which are stated in the appendix.
Strengths and weaknesses
This paper marks a strong contribution to computing partial Wasserstein distances in one dimension. The result greatly improves the prior state of the art, following a well-thought-out idea. Although the paper is very high in information density, it is very well presented, allowing readers, such as me, who are not very familiar with the topic to follow well.
Most proofs are directly given in the paper, and the remaining ones are given in the appendix. From what I can tell, the proofs are all correct. Unfortunately, for the proofs that are deferred to the appendix, no proof sketch is provided such that the final paper is less self-contained than it could be. Nonetheless, I believe that the excellent presentation of this paper is only very mildly affected by this.
Similarly to the proofs in the appendix, the presentation of the conditional nature of the lower bound could be improved by providing some more context for the hardness of the condition. Currently, it is not clear how challenging this assumption actually is. However, as above, this is mostly a minor nitpick, and the general presentation still does a very good job of communicating the overall idea.
The experiments are also nicely carried out for a paper with a clear theoretic focus, and the results complement and support the theory elegantly, showing at what instance size the asymptotic effects that are proven show up. My only complaint here is that the plots are not very legible in grayscale.
The biggest room for improvement I see with this paper is that the relevance for NeurIPS is not properly discussed. I see the merit of this paper’s contribution, but I have a hard time judging how interesting this topic is to the NeurIPS community. A few more motivating words would be adequate.
Overall, this is a good paper with a solid contribution and a clear presentation. My only complaints are about some smaller missing information that can easily be added for the final version.
Questions
-
How relevant is this paper to the NeurIPS community? I struggle to see how the results of this paper are of high interest. Hence, my score is majorly affected by the reply to this question. In particular, I am interested in how important the one-dimensional and discrete case is that is being studied here.
-
Why do the authors use the definite article for quantities such as a minimum-cost matching? Are these always unique?
-
Why do the experiments consider continuous distributions if this paper studies discrete ones?
Limitations
Yes.
Final justification
The authors have adequately addressed all of my concerns.
Formatting concerns
These are very minor issues that I cannot state anywhere else. They are meant to further improve the excellent presentation of the paper. They did not affect my score of the paper in any way.
-
I recommend sorting citations by increasing number.
-
In line 193, there is a space missing just before “and”.
-
Figure 4 would be more legible in grayscale if the different algorithms also used different markers in addition to different colors.
-
In line 364, one “the” in “the the” should be removed.
-
The references are a bit messy. The titles do not fully follow capitalization conventions (as everything but the first letter is just a lowercase one, regardless of whether this makes sense). Similar contribution types appear with different levels of details. I highly recommend streamlining and polishing the references. They give off a bad impression, staining this otherwise very nice piece of work.
-
The proof of Lemma 3.3 mentions Observation 1, which should likely be Observation 3.2.
2 comments
I thank the reviewers very much for their precise feedback. My questions have all been adequately answered, which is why, at the moment, I am clearly in favor of accepting this paper. Nonetheless, for full transparency, I would like to point out that I will only update my ranking once the third phase is about to end, as a discussion among the reviewers may change my eventual rating.
- Rating
- 5/6
- Confidence
- 1/5
- Quality
- 4/4
- Clarity
- 3/4
- Significance
- 4/4
- Originality
- 3/4
- Contribution type
- theory
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
The work studies the problem of computing the partial p-Wasserstein distance between two point sets over the real line. Fopr p=1, the known algorithms have a runtime of O(n \log n), and extending this to p> 1 seems to require quadratic time. This work improves upon this by presenting an O(pn \log^2 n) time algorithm. The main technical contribution is the creation of a data structure that computes optimal matching between red and blue point sets inside a balanced interval.
Strengths and weaknesses
Strengths:
The main algorithmic contribution is clean and addresses a gap between p = 1 and p > 1. The the balanced-interval data structure from Theorem 1.2 is very interesting and could be of independent interest. I did not go over all details, but the usage of Fast Fourier Transform-inspired approach is clever. The quadratic lowerbound for the case of p = \infty cicely complements the main algorithmic result.
Weakness: Not much. The technical content is quite dense and somewhat hard to follow, especially the way the balanced-interval data structure, FFT preprocessing, and augmenting-path framework work together. Theorem 1.2 is the central technical ingredient. A high-level explanation or running example would make the paper more accessible to readers (like me) who are not experts in this specific area.
Questions
I do not have any.
Limitations
Yes
Formatting concerns
None
2 comments
Rebuttal
We thank the reviewer for the positive assessment and for highlighting the balanced-interval data structure as interesting and potentially of independent interest. We also appreciate the insightful comment that the technical content is dense and that a high-level explanation would make the paper more accessible.
We will revise the technical overview to better explain how the balanced-interval data structure, FFT preprocessing, and augmenting-path framework fit together. The main idea is that the optimal matching inside any balanced interval pairs red and blue points in sorted order. Hence, if the first red point in the interval has index and the first blue point has index , then every matched pair has the same shift . Our range-tree data structure stores, at each node, the matching cost for all relevant shifts in that subtree. A balanced query interval is decomposed into range-tree nodes, and its optimal matching cost is obtained by aggregating the precomputed values for the appropriate shift.
This aggregation property is nontrivial because matching problems are not generally decomposable over disjoint subproblems. In our setting, the one-dimensional order structure and the balanced nature of the query interval enable precisely the decomposability needed by the data structure. The FFT enters in preprocessing: instead of explicitly computing all shift costs, we encode them as coefficients of carefully chosen polynomials obtained from the expansion of , and compute them efficiently using convolution.
Thank you for the response. I am positive about the paper.
- Rating
- 5/6
- Confidence
- 3/5
- Quality
- 3/4
- Clarity
- 4/4
- Significance
- 3/4
- Originality
- 3/4
- Contribution type
- theory
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
This paper studies the problem of computing all optimal partial -Wasserstein matchings on the line. Given two point sets , each of size , the goal is to compute, for every , the minimum cost of a -matching between the two sets. More precisely, the objective is to compute the sequence , where , and is a set of vertex-disjoint pairs. This sequence characterizes the optimal transport profile in the discrete uniform setting.
For full optimal transport on the line, the problem is relatively simple: after sorting the points, the optimal matching pairs them in order. However, this simplicity does not directly extend to partial transport. Previous work showed that when , all optimal partial matchings can be computed in time. For , however, the known approaches require time, because the optimal -matching and the optimal -matching may share very few edges. Thus, explicitly maintaining all matchings can lead to a quadratic number of edge changes.
The main contribution of this paper is an algorithm that computes all -partial -Wasserstein matching costs on the line in time and space for finite integer . The algorithm follows a Hungarian-style augmentation framework, but avoids explicitly maintaining all edges. Instead, it maintains a compact interval representation of the current matching. The key technical component is an FFT-based data structure for balanced interval matching queries. For a balanced interval , the algorithm can compute the minimum matching cost inside efficiently. This is achieved by exploiting the one-dimensional order structure and using convolution to precompute costs for different shifts.
The authors also provide a C++ implementation, called FFTHungarian, and compare it with previous implementations on synthetic one-dimensional datasets. In addition, they prove a conditional lower bound for the case , showing that truly subquadratic algorithms for computing all partial -Wasserstein costs would contradict the -Convolution Conjecture.
Strengths and weaknesses
Strengths
This paper provides a strong theoretical improvement over previous research. For , the previous approach requires time, while this paper reduces the runtime to for finite integer . For fixed , this is a near-linear-time algorithm and represents a significant improvement.
The proposed FFT-based balanced-interval data structure is technically interesting. The authors observe that inside a balanced interval, the optimal matching follows the sorted order, and the cost can be represented by shifts between red and blue points. By expanding and computing the resulting sums using FFT, the authors avoid the quadratic bottleneck that would arise from explicitly considering all pairs.
The paper also gives a useful structural view of the problem. Although the sequence of optimal matchings may contain distinct edges for , the authors show that the matchings can still be represented compactly through intervals. This helps explain why a near-linear algorithm is possible despite the apparent quadratic number of edge changes.
The lower bound for is also valuable. It clarifies the boundary of the positive result by showing that the finite- case and the case have different computational behavior. This makes the contribution more complete, since the paper not only provides an improved algorithm but also explains why the same approach should not be expected to extend to all values of .
Weaknesses
Although the theoretical improvement is strong, the experimental evaluation is limited to synthetic datasets. The experiments test samples from normal distributions with changes in mean, variance, and modality, but they do not evaluate the method on real applications where partial Wasserstein distances may be useful, such as outlier-robust comparison, noise filtering, or positive-unlabeled learning. Therefore, the practical usefulness of the full OT-profile in real tasks is not fully demonstrated.
The empirical comparison may be somewhat confounded by implementation differences. The proposed method is implemented in C++, while the main previous baseline, PAWL, is implemented in Python with Numba. Although the asymptotic improvement from to is theoretically clear, the experiment does not fully separate the algorithmic improvement from the possible speed advantage of using C++.
The positive result applies to finite integer , with runtime . This is efficient for common fixed values such as or , but the dependence on may become less attractive when is large. Moreover, the result does not extend to , and the authors show that this case is conditionally hard. Thus, the algorithm should be viewed as a strong result for fixed finite , rather than a uniform solution for all Wasserstein parameters.
Questions
How much of the empirical speedup comes from the new algorithmic idea, and how much comes from the fact that FFTHungarian is implemented in C++ while PAWL is implemented in Python/Numba? Would the comparison remain similar if both methods were implemented in the same language with similar levels of optimization?
Can the proposed method be integrated into a real downstream pipeline, such as robust distribution comparison or outlier filtering, to demonstrate that computing the full sequence provides practical benefits beyond synthetic runtime improvements?
Limitations
Yes.
Final justification
I have read the authors' rebuttal. Since the authors have satisfactorily resolved my primary concerns, I am happy to upgrade my score from 4 to 5.
Formatting concerns
NA.
1 comment
Rebuttal
We thank the reviewer for the careful reading and for recognizing the theoretical improvement, the balanced-interval data structure, the compact structural view of the matchings, and the lower bound for .
Experimental evaluation and downstream relevance.
The primary goal of this paper is to understand the computational complexity of computing all partial matchings for points on a line. Given this theoretical focus, our experiments are designed to isolate the algorithmic contribution and demonstrate when the asymptotic improvement becomes visible, rather than to evaluate a full downstream application pipeline. That said, the full OT-profile is directly motivated by applications in robust partial Wasserstein formulations, PU learning, noise removal, and outlier-robust OT, where one must decide how much mass should be transported and which points should be left unmatched. We will revise the introduction and experiments discussion to make these connections more explicit. Our code will be publicly available so that the algorithm can be used as a primitive in such applications.
Implementation differences.
The reviewer correctly notes that FFTHungarian is implemented in C++, while PAWL is implemented in Python/Numba. We agree that this difference can affect absolute runtimes. We want to highlight three important points in this regard:
-
Our main empirical point is not the language-level speedup, but the scaling behavior predicted by the theory: PAWL has quadratic dependence for , especially when the distributions differ, whereas our algorithm runs in time. We observe this theoretically predicted behavior in our experiments. We will revise our paper and emphasize more that the asymptotic trend, rather than raw wall-clock time alone, is the main evidence supported by the experiments.
-
Since PAWL uses Numba for performance-critical computations, it is not a purely interpreted Python baseline; nevertheless, we will revise the experimental discussion to state the implementation difference clearly.
-
For the simple cases, i.e., where we draw from the same distribution or for small instance sizes, PAWL and FFTHungarian exhibit a similar running time despite the different language of implementation. This suggests that the effect of the language is indeed minor.
Dependence on and scope of the result.
Our positive result should be viewed as a strong result for fixed finite integer . Indeed, as the reviewer notes, our conditional lower bound shows that one should not expect the same type of truly sub-quadratic algorithm for .
From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.
Loading the discussion…
Rebuttal
We thank the reviewer for the detailed and constructive comments and for recognizing the contribution, presentation quality, and empirical support. We address the main concerns below.
Relevance to NeurIPS and importance of the one-dimensional discrete setting.
High-dimensional optimal transport is a powerful tool for comparing distributions, but exact d-dimensional OT between empirical discrete distributions built from samples is computationally expensive for large datasets. The difficulty of high-dimensional OT has motivated Wasserstein-based alternatives that reduce computation to one-dimensional problems. A central example is the sliced Wasserstein distance, which averages Wasserstein costs after projecting distributions onto random lines [Rabin et al., 2011; see Nguyen, 2025 for a recent survey]. Sliced Wasserstein inherits many useful geometric properties of Wasserstein distance while being significantly more scalable, precisely because one-dimensional OT is much easier to compute.
Partial Wasserstein and partial sliced Wasserstein distances are important for noisy real-world datasets, where one must decide how much mass should be transported and which samples should be treated as outliers. However, the computational benefits of sliced Wasserstein had not fully extended to partial sliced Wasserstein beyond the p=1 case. Prior work on sliced optimal partial transport [Bai et al., CVPR 2023] used a quadratic-worst-case one-dimensional partial-transport primitive, while PAWL [Chapel and Tavenard, ICLR 2025] later gave the first near-linear-time algorithm for computing the full one-dimensional partial OT profile when p=1. For p>1, however, no sub-quadratic algorithm was previously known for computing this full profile.
Our goal is to fully characterize the scalability of computing all one-dimensional partial p-Wasserstein distances for empirical distributions with uniform mass. By giving an O(pnlog2n)-time algorithm for every fixed finite integer p, our result removes this bottleneck and provides a key primitive for making partial sliced Wasserstein computations scalable beyond the p=1 case. We will revise the introduction to make this motivation and connection to NeurIPS clearer.
Continuous distributions in experiments.
The paper studies discrete empirical distributions. In the experiments, the continuous distributions are used only as generators from which finite point sets are sampled; the algorithm is always run on the resulting discrete uniform empirical measures. We will clarify this in the experimental section to avoid confusion.
Uniqueness of minimum-cost matchings.
The reviewer is correct that minimum-cost matchings need not always be unique. We will revise the wording throughout the paper, replacing phrases such as “the minimum-cost matching” with “a minimum-cost matching” where appropriate.
Proof sketches and lower-bound context.
We agree that the appendix-deferred proofs would be easier to navigate with short proof sketches. We will add brief sketches before the deferred proofs, especially for the conditional lower bounds. We will also add more context on the (min,+)-Convolution Hypothesis, explaining that it is a standard fine-grained complexity assumption commonly used to explain quadratic barriers. This will make clearer why the p=∞ lower bound suggests that truly sub-quadratic algorithms are unlikely in that setting.
Paper formatting concerns
We thank the reviewer for the detailed presentation comments, which we will all implement as suggested. In particular, we will also ensure that the plots in Figure 4 are legible in grayscale.
References.
[Rabin et al., 2011] J. Rabin, G. Peyré, J. Delon, and M. Bernot. Wasserstein Barycenter and Its Application to Texture Mixing. Scale Space and Variational Methods in Computer Vision (SSVM), 2011.
[Nguyen, 2025] K. Nguyen. An Introduction to Sliced Optimal Transport. arXiv, 2025.
[Bai et al., CVPR 2023] Y. Bai, B. Schmitzer, M. Thorpe, and S. Kolouri. Sliced Optimal Partial Transport. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2023.
[Chapel and Tavenard, ICLR 2025] L. Chapel and R. Tavenard. One for all and all for one: Efficient computation of partial Wasserstein distances on the line. International Conference on Learning Representations (ICLR), 2025.