Introduction
Optimal Transport (OT) distances, often referred to as Earth Mover's Distance, are essential for comparing probability distributions in fields like image retrieval and natural language processing. Despite their utility, computing these distances is computationally intensive. Recently, the machine learning community has favored entropic regularization—specifically the Sinkhorn algorithm—due to its perceived scalability and differentiability. However, a comprehensive comparison between these modern numerical methods and classical combinatorial algorithms across diverse real-world datasets has been lacking. This study addresses this gap, evaluating which approach provides the best computational efficiency.
Methodology
The study benchmarks two primary families of algorithms:
- Numerical Matrix Scaling: Including Sinkhorn and its greedy variant, Greenkhorn. These methods use entropic regularization to transform OT into a matrix scaling problem.
- Combinatorial Methods: Including Network Simplex (Lemon NS), the Kuhn-Munkres (KM) algorithm, and the Auction Algorithm.
- Batched KM: A novel variant of the Hungarian algorithm introduced by the authors. It routes maximal sets of paths among "tight" edges to amortize search costs, specifically targeting performance gains on real-world data with many small integer costs.
The evaluation utilizes four dataset types: synthetic geometric data (CircleSquare), word embeddings (NLP), pixel intensities (MNIST), and color pixel distributions (CIFAR).
Key Insights: Combinatorial vs. Numerical Performance
A primary finding is that combinatorial methods consistently outperform numerical ones for computing OT distances. Even when Sinkhorn is permitted a 10% margin of error, it often remains an order of magnitude slower than an exact solver like Network Simplex.
The "high accuracy wall" is a significant hurdle for numerical methods. Achieving high precision requires increasing the regularization parameter ($\eta$), which leads to a super-linear increase in iterations and potential numerical instability. Furthermore, the rounding overhead required by Sinkhorn to produce feasible flows adds significant time without necessarily improving the objective value.
Key Results
The results demonstrate the dominance of combinatorial approaches across various scenarios:
- Network Simplex Dominance: The
Lemon NSimplementation was the overall winner for exact computations. - Speed Comparisons: In assignment problems (unit demands), Batched KM and AuctionScaled were orders of magnitude faster than Sinkhorn. For instance, on the
CS4900dataset, Batched KM completed in ~1.35s compared to Sinkhorn's ~620s. - Non-Unit Demands: On MNIST and NLP datasets, Network Simplex remained faster than Sinkhorn, even when the latter only targeted a 1.1-approximation.
Limitations and Future Work
While combinatorial methods excel in raw speed for distance computation, Sinkhorn retains a critical advantage in deep learning: differentiability. This allows it to function as a loss function in backpropagation. Additionally, Sinkhorn is highly parallelizable on GPUs, a factor not fully explored in this CPU-focused study. Future research aims to develop differentiable analogs of high-performance combinatorial algorithms to combine their speed with the requirements of modern neural networks.
Summary updated