Online Metric Matching on the Line with Recourse

Nicole Megow, Lukas NölkeAlgorithmica 2025

Abstract

In the classic online metric matching problem on a line, algorithms are fundamentally limited by a logarithmic competitive ratio because decisions are strictly irrevocable. This paper demonstrates that by allowing a small amount of "recourse"—the ability to revise past matching decisions—we can break this barrier, achieving a constant $O(1)$ competitive ratio with an amortized budget of just $O(\log n)$ reassignments per request.

Introduction

The online metric matching problem on a line is a fundamental challenge in algorithmic design, often visualized through a 1D ride-sharing scenario: servers (cars) are fixed at points on a straight road, and requests (riders) appear sequentially. Each new request must be immediately assigned to an available server to minimize the total distance traveled across all matches.

A visualization of requests $r_i$ and servers on a 1D line, illustrating the matching challenges.

In the standard version of this problem, assignments are irrevocable. This constraint imposes a significant performance penalty; the best known online algorithms achieve a competitive ratio of $\Theta(\log n)$, and theoretical lower bounds prove that no algorithm can perform better than $\Omega(\sqrt{\log n})$. This paper explores a recourse model, where the algorithm is permitted to occasionally delete previously matched edges and rematch requests to different servers. The central question is whether a sublinear amount of recourse can yield a constant $O(1)$ competitive ratio.

Algorithmic Framework: Buffering and Freezing

To achieve a constant competitive ratio while maintaining a low recourse budget, the authors build upon the "$t$-net cost" algorithm. Their approach involves maintaining two auxiliary matchings: a zero-recourse online matching (which is high-cost) and an optimal offline matching (which has low cost but typically requires frequent reassignments).

The core innovation lies in a dual-strategy of buffering and freezing:

  1. Blocks as Input Buffers: Arriving requests are initially handled by the zero-recourse online strategy and grouped into local "blocks" based on their search intervals. A "recourse step" is only triggered when a block reaches a certain size or overlaps with new structures. This allows the algorithm to update assignments in large local batches, matching the optimal offline strategy without the overhead of constant, incremental reassignments.
  2. Dynamic Freezing Scheme: Recourse costs often spike when edge costs grow exponentially. To mitigate this, the authors introduce a freezing scheme. When the cost of an inactive edge becomes negligible relative to the current overall optimal cost, it is "frozen" and locked permanently. Subsequent requests route around these frozen edges using a "detour matching" technique.
The hierarchical structure of auxiliary matchings $M_i^*$ used to manage recourse budget.

Key Results and Trade-offs

The primary contribution of this work is the design of an $O(1)$-competitive algorithm for online metric matching on the line with an amortized recourse budget of $O(\log n)$. Beyond this main result, the authors establish a flexible trade-off between cost and recourse: for any function $f(n) \le \log n$, the algorithm can be tuned to be $O(f(n))$-competitive using an amortized recourse budget of $O(\frac{\log n}{f(n)})$.

Furthermore, the paper identifies a special class of "alternating instances" where requests and servers strictly alternate along the line. For these cases, the authors provide a highly efficient $(1+\epsilon)$-competitive algorithm that requires only a constant $O(1/\epsilon^2)$ amount of recourse per request.

Conclusion and Future Directions

By relaxing the strict irrevocability of online matching, this research proves that the logarithmic barrier on the line is not inherent to the metric itself, but rather to the lack of flexibility in decision-making. While the $O(\log n)$ recourse budget is amortized, future work may investigate whether a similar $O(1)$-competitive result is possible under a strict, non-amortized recourse cap per iteration. Additionally, determining if constant recourse is sufficient for general (non-alternating) instances on the line remains an open and intriguing question.

Summary updated

BibTeX
@article{megow2025online,
  author = {Nicole Megow and Lukas Nölke},
  title = {{Online Metric Matching on the Line with Recourse}},
  journal = {Algorithmica},
  year = {2025},
  doi = {10.1007/s00453-025-01299-8},
}
Figure