Deterministic, near-linear ε-approximation algorithm for geometric bipartite matching

Pankaj K. Agarwal, Hsien-Chih Chang, Sharath Raghvendra, Allen Xiao

TL;DR

This paper presents the first deterministic, near-linear time algorithm for finding an $\epsilon$-approximate Euclidean Minimum-Weight Matching (EMWM) between two point sets. By replacing randomized quadtrees with a deterministic "tree cover" and employing a novel "adjusted cost" regularizer, the authors achieve a running time of $n \cdot (\epsilon^{-1} \log n)^{O(d)}$, matching the performance of previous randomized approaches without relying on luck.

What Problem Does This Paper Address?

The authors tackle the Geometric Bipartite Matching problem: given two sets of $n$ points ($A$ and $B$) in $d$-dimensional Euclidean space, find a perfect matching that minimizes the total distance between matched pairs. This is the geometric version of the classic assignment problem and is a fundamental tool for calculating the Wasserstein distance (or Earth Mover’s Distance), widely used in machine learning, computer vision, and statistics to compare probability distributions.

While exact solutions exist, they are too slow for massive modern datasets (often taking $\Omega(n^{1.5})$ or more). To scale, researchers use $\epsilon$-approximation algorithms. Until this paper, all algorithms that could find a $(1+\epsilon)$-approximation in "near-linear" time (roughly proportional to $n$) were Monte-Carlo algorithms—meaning they relied on random shifts of a quadtree and only succeeded with high probability. Deterministic alternatives were significantly slower.

Methods

The core challenge in making these algorithms deterministic is that a single quadtree might "cut" many close pairs of points, making them appear far apart in the tree hierarchy. To fix this without randomness, the authors introduce several key techniques:

  1. Deterministic Tree Covers: Instead of one randomly shifted quadtree, the algorithm uses a collection of $2^d$ deterministically shifted quadtrees. This ensures that for any pair of points, there is at least one tree in the "cover" where the points are well-separated from cell boundaries, preserving their proximity.
  2. Adjusted Cost (Regularization): The authors define a new "$\epsilon$-adjusted cost" for edges and paths. This cost combines the standard net cost with a penalty proportional to the Euclidean length of the path. This acts as a regularizer, preventing the algorithm from choosing excessively long, winding paths that would blow up the running time.
  3. Cycle Cancellation: Because the algorithm works across multiple trees, it can inadvertently create self-intersecting paths or cycles. The authors implement a mechanism to periodically find and "cancel" alternating cycles that have a negative adjusted cost, which keeps the matching's total cost under control and ensures the algorithm converges.
  4. Hierarchical Data Structures: They develop a complex data structure to store "canonical paths" compactly. This allows the algorithm to detect intersections and simplify augmenting paths in near-linear time, despite the potential complexity of paths spanning different levels and trees.

Datasets

As a theoretical computer science paper focused on algorithmic complexity and proofs, no empirical datasets were used. The results are proven mathematically for any arbitrary set of points in $\mathbb{R}^d$ satisfying the constant dimension $d$ constraint.

Key Insights and Ideas

  • From Random to Cover: The most significant "aha" moment is demonstrating that the probabilistic guarantees of a randomly shifted quadtree can be replaced by the collective guarantees of a small, deterministic set of trees (the tree cover).
  • The Power of Regularization: In many matching algorithms, the number of edges in augmenting paths can be as high as $O(n^2)$. By adding the Euclidean length to the cost function, the authors prove that the total length of all paths used is bounded, which is the "secret sauce" for achieving near-linear time.
  • Handling Overlap: Unlike a single quadtree where cells are disjoint at each level, tree covers involve overlapping cells. Managing the "hand-off" of path segments between these overlapping regions required a new way to represent and simplify paths hierarchically.

Key Results

  • Complexity: The algorithm computes a $(1+\epsilon)$-approximate perfect matching in $n \cdot (\epsilon^{-1} \log n)^{O(d)}$ time.
  • Deterministic Guarantee: This is the first algorithm to achieve this time bound without using any random bits, filling a long-standing gap in geometric optimization.
  • Generality: While described for the Euclidean ($L_2$) norm, the authors note the algorithm works for any $L_p$ norm.

Limitations and Future Work

  • The Curse of Dimensionality: The running time includes an $O(d)$ exponent. While $d$ is considered a constant in this analysis, the algorithm's performance degrades rapidly as the number of dimensions increases, making it less practical for very high-dimensional data (e.g., embeddings with hundreds of dimensions).
  • Complexity of Implementation: The data structures required to manage canonical paths and cycle cancellation across $2^d$ trees are highly sophisticated. A simplified version might be needed for practical, "production-ready" software.
  • Open Questions: The authors point toward two future goals: finding a deterministic algorithm for $\epsilon$-optimal transport (a generalization of matching) and achieving $O(n \text{ poly} \log n)$ time for Root Mean Square (RMS) matching.

Summary updated

BibTeX
@inproceedings{agarwal2022deterministic,
  author = {Pankaj K. Agarwal and Hsien-Chih Chang and Sharath Raghvendra and Allen Xiao},
  title = {{Deterministic, near-linear ε-approximation algorithm for geometric bipartite matching}},
  booktitle = {STOC},
  year = {2022},
  url = {https://openreview.net/forum?id=JRpRqDlRYef},
}

Loading related content...

Figure