Table of Contents
Fetching ...

An Efficient Algorithm for Unbalanced 1D Transportation

Gabriel Gouvine

TL;DR

This work addresses the lack of efficient algorithms for unbalanced optimal transport in one dimension. It recasts 1D UOT as a minimum-cost flow and develops a successive shortest path algorithm augmented with a positional-encoding representation, enabling fast, monotone, no-hole solutions. The main result is a provably optimal $O((n+m) \log(n+m))$ algorithm (i.e., $O(n \log n)$ when $n$ and $m$ are of the same order) that matches the balanced 1D OT complexity and tightens previous bounds for UOT. The method is implemented in C++ and validated on 10k random instances, with open-source code, highlighting practical impact for fast, exact 1D UOT in applications where the earth mover distance is employed in unbalanced settings.

Abstract

Optimal transport (OT) and unbalanced optimal transport (UOT) are central in many machine learning, statistics and engineering applications. 1D OT is easily solved, with complexity O(n log n), but no efficient algorithm was known for 1D UOT. We present a new approach that leverages the successive shortest path algorithm for the corresponding network flow problem. By employing a suitable representation, we bundle together multiple steps that do not change the cost of the shortest path. We prove that our algorithm solves 1D UOT in O(n log n), closing the gap.

An Efficient Algorithm for Unbalanced 1D Transportation

TL;DR

This work addresses the lack of efficient algorithms for unbalanced optimal transport in one dimension. It recasts 1D UOT as a minimum-cost flow and develops a successive shortest path algorithm augmented with a positional-encoding representation, enabling fast, monotone, no-hole solutions. The main result is a provably optimal algorithm (i.e., when and are of the same order) that matches the balanced 1D OT complexity and tightens previous bounds for UOT. The method is implemented in C++ and validated on 10k random instances, with open-source code, highlighting practical impact for fast, exact 1D UOT in applications where the earth mover distance is employed in unbalanced settings.

Abstract

Optimal transport (OT) and unbalanced optimal transport (UOT) are central in many machine learning, statistics and engineering applications. 1D OT is easily solved, with complexity O(n log n), but no efficient algorithm was known for 1D UOT. We present a new approach that leverages the successive shortest path algorithm for the corresponding network flow problem. By employing a suitable representation, we bundle together multiple steps that do not change the cost of the shortest path. We prove that our algorithm solves 1D UOT in O(n log n), closing the gap.
Paper Structure (10 sections, 8 theorems, 1 equation, 6 figures, 2 algorithms)

This paper contains 10 sections, 8 theorems, 1 equation, 6 figures, 2 algorithms.

Key Result

Theorem 3.1

The SSP algorithm in alg:basic_transportation has complexity $\mathcal{O}(nm(n+m))$.

Figures (6)

  • Figure 1: Representation of a 1D transportation problem and a solution as a flow problem. $u_i$ and $v_j$ values are shown by the position of the node. Edges with zero flow are omitted for clarity.
  • Figure 2: A non-monotonic solution (edges with flow are crossed).
  • Figure 3: A solution with a hole (the middle sink has unmet demand).
  • Figure 4: Two steps of the SSP algorithm, sending the supply from a new source
  • Figure 5: Visualizing the positional encoding associated with a solution.
  • ...and 1 more figures

Theorems & Definitions (19)

  • Definition 3.1
  • Definition 3.2
  • Theorem 3.1
  • proof
  • Theorem 3.2
  • proof
  • Definition 3.3
  • Theorem 3.3
  • proof
  • Theorem 3.4
  • ...and 9 more