A Combinatorial Algorithm for the Semi-Discrete Optimal Transport Problem

Pankaj K. Agarwal, Sharath Raghvendra, Pouyan Shirzadian, Keegan YaoNeurIPS 2024

Introduction

Optimal Transport (OT), often measured via the Wasserstein distance, provides a mathematically rigorous metric for comparing probability distributions. It has become a foundational tool in machine learning, widely used for tasks such as training generative models (like GANs and VAEs) and domain adaptation.

This paper specifically tackles the semi-discrete optimal transport problem. This variation asks for the most cost-effective way to move mass from a continuous distribution (such as a continuous latent space) to a discrete distribution (such as empirical data samples). While fast, exact algorithms exist for purely discrete OT, the semi-discrete counterpart is notoriously difficult. Existing algorithms rely heavily on numerical solvers that scale exponentially with precision and require the continuous distribution to be "smooth." If the continuous distribution is irregular or non-smooth, these numerical methods slow down drastically or fail to converge.

To bridge this gap, the authors introduce a novel combinatorial algorithm that brings the speed, reliability, and polynomial runtime of discrete combinatorial frameworks to the semi-discrete setting, completely bypassing the smoothness assumption.

Methods: A Combinatorial Framework for Continuous Space

In purely discrete OT, algorithms frequently employ a combinatorial primal-dual framework. They maintain a "residual graph" of fixed vertices and iteratively find "augmenting paths" to push mass from one distribution to the other until the transport is complete. Extending this framework to continuous spaces requires several clever innovations.

Dynamic Continuous Vertices

Instead of relying on fixed points, the "vertices" representing the continuous distribution are treated as dynamically changing regions. The algorithm partitions the continuous space using $\delta$-expanded weighted Voronoi diagrams (also known as Laguerre cells).

Expanded weighted Voronoi diagrams used to dynamically partition the continuous space.

By dynamically grouping the continuous mass into these regions, the algorithm can treat them similarly to discrete nodes, adjusting their boundaries on the fly as the optimization progresses.

Cost-Scaling and Shifting Regions

The algorithm iteratively refines the transport plan across $O(\log \frac{\Delta}{\varepsilon})$ scales, where $\Delta$ is the diameter of the support and $\varepsilon$ is the target error. However, because the continuous regions change shape as the algorithm updates dual weights, standard discrete algorithms would break down and form infinite loops (cycles).

Residual graph and augmenting paths connecting discrete points and continuous regions.

To resolve this, the authors introduce three carefully calibrated subroutines to manage the residual graph:

  1. SearchAndAugment: A partial Depth-First Search (DFS) that finds valid paths to push mass without creating cycles.
  2. IncreaseWeights: Adjusts the dual weights of the discrete points to create new transport paths.
  3. Acyclify: A novel cleanup step that dynamically detects and prunes "admissible cycles" from the residual graph and transport plan, maintaining a clean "forest" structure. This acyclicity is the secret sauce that makes the combinatorial approach mathematically sound in a continuous domain.

Key Results and Applications

Faster Semi-Discrete OT

In 2D space, the algorithm computes an $\varepsilon$-additive approximate semi-discrete transport plan in $O(n^4 \log n \log \frac{1}{\varepsilon})$ time, where $n$ is the number of discrete points. This strictly polynomial runtime is significantly faster than prior numerical methods, and it works perfectly even if the continuous distribution is highly irregular.

Sub-linear Discrete OT Queries

Beyond the semi-discrete problem, the authors leverage their framework to solve massive discrete OT problems. By treating a massive discrete dataset as a "continuous" distribution using a spatial data structure (like a simplex range tree), they designed a system that preprocesses a massive discrete distribution of size $N$ in $O(N \log N)$ time.

Given a new, smaller query distribution of size $k$, the OT plan can be computed in $O(k^3 \sqrt{N} \log \frac{1}{\varepsilon})$ time. Because this runtime scales with $\sqrt{N}$, it is sub-linear relative to the massive dataset—a significant breakthrough for large-scale retrieval tasks.

Limitations and Future Work

While groundbreaking, the approach has two primary limitations:

  • Oracle Assumption: The algorithm assumes the existence of an "oracle" capable of computing the mass of the continuous distribution inside any given triangle in $O(1)$ time. While standard in computational geometry, building this oracle for complex, neural network-based distributions can be practically challenging.
  • Curse of Dimensionality: The algorithm extends to $d$-dimensions, but the runtime scales exponentially with $d$ (specifically $O(n^{d+1})$). It is highly efficient for low-dimensional spaces (like 2D or 3D) but currently intractable for high-dimensional latent spaces.

The authors leave open a compelling question for future research: Can this combinatorial framework be adapted to compute approximate semi-discrete transport plans in high dimensions with a runtime that is polynomial to $n$, $d$, and $1/\varepsilon$?

Summary updated

BibTeX
@inproceedings{agarwal2024combinatorial,
  author = {Pankaj K. Agarwal and Sharath Raghvendra and Pouyan Shirzadian and Keegan Yao},
  title = {{A Combinatorial Algorithm for the Semi-Discrete Optimal Transport Problem}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=N0ta4zURXw},
}
Figure