Table of Contents
Fetching ...

The Power of Greedy for Online Minimum Cost Matching on the Line

Eric Balkanski, Yuri Faenza, Noemie Perivier

TL;DR

This paper analyzes the online minimum cost matching problem on the line, focusing on the greedy (nearest neighbor) algorithm under partially random input models. Using a novel hybrid framework and a Hybrid Lemma, the authors prove that greedy is constant-competitive in the fully random model and in the fully random model with a linear excess of servers, substantially improving prior bounds. In the random requests model, they show an $O( ext{log } n)$ upper bound and complement it with an $oldsymbol{}$-logarithmic lower bound, establishing a tight threshold and revealing how randomness on the requests and servers drives performance. The results illuminate the role of randomness in online matching on the line and suggest directions for broader metric spaces and model extensions. Overall, the work provides both methodological tools (hybrid analysis, recursive bounds) and concrete performance guarantees for greedy in partially random settings, with implications for ride-haiting and related on-demand systems.

Abstract

We consider the online minimum cost matching problem on the line, in which there are $n$ servers and, at each of $n$ time steps, a request arrives and must be irrevocably matched to a server that has not yet been matched to, with the goal of minimizing the sum of the distances between the matched pairs. Despite achieving a worst-case competitive ratio that is exponential in $n$, the simple greedy algorithm, which matches each request to its nearest available free server, performs very well in practice. A major question is thus to explain greedy's strong empirical performance. In this paper, we aim to understand the performance of greedy over instances that are at least partially random. When both the requests and the servers are drawn uniformly and independently from $[0,1]$, we show that greedy is constant competitive, which improves over the previously best-known $O(\sqrt{n})$ bound. We extend this constant competitive ratio to a setting with a linear excess of servers, which improves over the previously best-known $O(\log^3{n})$ bound. We moreover show that in the semi-random model where the requests are still drawn uniformly and independently but where the servers are chosen adversarially, greedy achieves an $O(\log{n})$ competitive ratio. When the requests arrive in a random order but are chosen adversarially, it was previously known that greedy is $O(n)$-competitive. Even though this one-sided randomness allows a large improvement in greedy's competitive ratio compared to the model where requests are adversarial and arrive in a random order, we show that it is not sufficient to obtain a constant competitive ratio by giving a tight $Ω(\log{n})$ lower bound. These results invite further investigation about how much randomness is necessary and sufficient to obtain strong theoretical guarantees for the greedy algorithm for online minimum cost matching, on the line and beyond.

The Power of Greedy for Online Minimum Cost Matching on the Line

TL;DR

This paper analyzes the online minimum cost matching problem on the line, focusing on the greedy (nearest neighbor) algorithm under partially random input models. Using a novel hybrid framework and a Hybrid Lemma, the authors prove that greedy is constant-competitive in the fully random model and in the fully random model with a linear excess of servers, substantially improving prior bounds. In the random requests model, they show an upper bound and complement it with an -logarithmic lower bound, establishing a tight threshold and revealing how randomness on the requests and servers drives performance. The results illuminate the role of randomness in online matching on the line and suggest directions for broader metric spaces and model extensions. Overall, the work provides both methodological tools (hybrid analysis, recursive bounds) and concrete performance guarantees for greedy in partially random settings, with implications for ride-haiting and related on-demand systems.

Abstract

We consider the online minimum cost matching problem on the line, in which there are servers and, at each of time steps, a request arrives and must be irrevocably matched to a server that has not yet been matched to, with the goal of minimizing the sum of the distances between the matched pairs. Despite achieving a worst-case competitive ratio that is exponential in , the simple greedy algorithm, which matches each request to its nearest available free server, performs very well in practice. A major question is thus to explain greedy's strong empirical performance. In this paper, we aim to understand the performance of greedy over instances that are at least partially random. When both the requests and the servers are drawn uniformly and independently from , we show that greedy is constant competitive, which improves over the previously best-known bound. We extend this constant competitive ratio to a setting with a linear excess of servers, which improves over the previously best-known bound. We moreover show that in the semi-random model where the requests are still drawn uniformly and independently but where the servers are chosen adversarially, greedy achieves an competitive ratio. When the requests arrive in a random order but are chosen adversarially, it was previously known that greedy is -competitive. Even though this one-sided randomness allows a large improvement in greedy's competitive ratio compared to the model where requests are adversarial and arrive in a random order, we show that it is not sufficient to obtain a constant competitive ratio by giving a tight lower bound. These results invite further investigation about how much randomness is necessary and sufficient to obtain strong theoretical guarantees for the greedy algorithm for online minimum cost matching, on the line and beyond.
Paper Structure (50 sections, 88 theorems, 186 equations, 8 figures, 7 tables)

This paper contains 50 sections, 88 theorems, 186 equations, 8 figures, 7 tables.

Key Result

Theorem 0

For online matching on the line in the fully random model, the greedy algorithm achieves a constant competitive ratio.

Figures (8)

  • Figure 1: Set of servers $S_t$ (free servers at time $t$ for $\mathcal{H}_A^m$) and $S_t'$ (free servers at time $t$ for $\mathcal{H}_A^{m-1}$) in the case where $S_t\neq S_t'$, where the squares are the servers in $S_t$ and the circles the servers in $S_t'$.
  • Figure 2: The lower bound instance. There are $n^{4/5}+4 \log^2(n) \sqrt{n}$ servers at $0$, no server in the dashed area, and $n-(n^{\frac{4}{5}}+4\log^2(n)\sqrt{n})$ servers uniformly distributed in the gray area.
  • Figure 3: Sets of free servers for $\mathcal{H}^m$ and $\mathcal{H}^{m-1}$ at all time steps (with the circles denoting servers in $S_t$ and the squares denoting servers in $S_t'$).
  • Figure 4: Requests in and out of $I_i$ up to time $\overline{t}_i:= \min(t_i, t_{i-1} + c_2(n-t_{i-1}))$, with (A) the total number of requests that arrived in $I_i$ from time 0 to $\overline{t}_i$, (B) the total number of requests that arrived in $I_i$ and were matched outside $I_i$ from time $0$ to $\overline{t}_i$, and $(C)$ the total number of requests that arrived in $[\tfrac{3}{4}y_{i-1}, y_{i-1}]$ and were matched inside $I_i$ from time $t_{i-1} + 1 +c_1(n - t_{i-1})$ to time $\overline{t}_i$ (note that there are no free servers in the dashed area for times $t\geq t_{i-1}$).
  • Figure 5: The competitive ratio achieved by the greedy algorithm for different dimensions $d$ and number of uniformly random servers and requests $n$.
  • ...and 3 more figures

Theorems & Definitions (137)

  • Theorem 0
  • Theorem 0
  • Theorem 0
  • Theorem 0
  • Lemma 0
  • Lemma 0
  • Lemma 1: Kanoria21
  • Theorem 2: Kanoria21
  • Lemma 2
  • proof
  • ...and 127 more