NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Impatient Online Matching

Yossi Azar, Ashish Chiplunkar, Haim Kaplan, Wattenhofer, Roger · DOI

Abstract

We investigate the problem of online Min-cost Perfect Matching with Delays (MPMD) on an $n$-point metric space. In this setting, requests arrive online, and an algorithm must match them while balancing the distance between matched pairs (connection cost) and the time requests wait to be matched (delay cost). We present a randomized algorithm achieving a competitive ratio of $O(\log n)$, significantly improving upon previous bounds that depended on the metric space's aspect ratio $\Delta$. Our approach utilizes a deterministic timer-based algorithm on trees of logarithmic height, combined with probabilistic tree embeddings. Furthermore, we establish the first lower bounds for this problem that scale with $n$: $\Omega(\sqrt{\log n})$ for general matching and $\Omega(\log^{1/3} n)$ for bipartite matching.

Introduction

In many real-world applications—ranging from ride-sharing platforms like Uber to matchmaking in online gaming—service providers must pair requests that arrive dynamically over time. These systems face a fundamental trade-off: matching requests immediately may result in large travel distances or skill gaps (high connection cost), while waiting for a better spatial match increases user frustration (high delay cost).

This problem was formalized by Emek et al. (2016) as Min-cost Perfect Matching with Delays (MPMD). Given an $n$-point metric space, requests appear at points in real-time. The goal is to find a perfect matching that minimizes the sum of distances between matched pairs and the total waiting time of all requests. While initial work provided a competitive ratio of $O(\log^2 n + \log \Delta)$, where $\Delta$ is the aspect ratio of the metric space, the dependence on $\Delta$ is problematic as it can be arbitrarily large. This paper presents a strategy to achieve a competitive ratio of $O(\log n)$, effectively "breaking" the aspect ratio barrier.

Problem Formulation

The MPMD problem is defined on a metric space $(M, d)$ with $|M| = n$. Requests arrive at points in $M$ at various times. An online algorithm must decide when to match two requests. The total cost is defined as:

$$Cost = \sum_{(r_i, r_j) \in \text{Matching}} d(r_i, r_j) + \sum_{r_i} (T_{match}(r_i) - T_{arrival}(r_i))$$

In the bipartite version (MBPMD), requests are either positive or negative, and only opposite polarities can be matched.

The Algorithmic Framework

The authors' solution relies on a multi-stage reduction and a novel deterministic strategy for tree metrics.

1. Metric Embedding and Height Reduction

The first step involves embedding the arbitrary $n$-point metric into a distribution over weighted hierarchically separated trees (HSTs). Standard embedding techniques provide a distortion of $O(\log n)$. However, to remove the dependence on $\Delta$, the authors apply a height-reduction technique to ensure the resulting trees have a height $h = O(\log n)$.

2. Deterministic Timer-Based Algorithm on Trees

The core contribution is a deterministic algorithm designed specifically for tree metrics. For any vertex $u$ in the tree, let $e_u$ be the edge connecting $u$ to its parent. The algorithm maintains a state for each subtree:

  • State Tracking: It tracks whether a subtree has an "unmatched" request (in MPMD, this is simply whether the number of requests in the subtree is odd).
  • The Timer: A timer $z_u$ runs whenever the subtree rooted at $u$ is in an unmatched state.
  • Edge Acquisition: When the accumulated timer $z_u$ reaches a threshold equal to the weight of the edge $w(e_u)$, the algorithm "buys" the edge.
  • Matching: Once a path of bought edges connects two unmatched requests, they are matched immediately.

This strategy ensures that the connection cost is within a constant factor of the optimal solution's connection cost, while the delay cost is bounded by $O(h)$ times the optimal delay cost.

3. Handling Bipartite Matching

The bipartite case (MBPMD) is more complex because subtrees can have a surplus of either positive or negative requests. The authors extend the timer logic by maintaining two separate timers for each node—one for positive surplus and one for negative. Using a sophisticated potential function, they prove that this dual-timer approach remains $O(h)$-competitive.

Lower Bounds

Prior to this work, no lower bounds existed that scaled with the number of points $n$. The authors utilize Yao’s min-max principle to establish limits on any randomized algorithm. By constructing a hard distribution of inputs on a simple line metric (equally spaced points on a unit interval), they prove:

  • MPMD: A lower bound of $\Omega(\sqrt{\log n})$.
  • MBPMD: A lower bound of $\Omega(\log^{1/3} n)$.

These results confirm that the complexity of the problem necessarily grows with the size of the metric space, regardless of the spatial distribution of points.

Conclusion and Future Work

By achieving an $O(\log n)$ competitive ratio, this research demonstrates that the "spread" of a metric space ($\Delta$) does not fundamentally limit the efficiency of online matching with delays. The use of deterministic timers on trees provides a robust framework for balancing spatial and temporal costs.

However, a gap remains between the $O(\log n)$ upper bound and the polylogarithmic lower bounds. Future research may focus on developing algorithms directly for general metrics to avoid the $O(\log n)$ distortion penalty or investigating whether competitive deterministic algorithms exist for non-tree metrics.

Summary updated

BibTeX
@misc{azar2016impatient,
  author = {Yossi Azar and Ashish Chiplunkar and Haim Kaplan and Wattenhofer, Roger},
  title = {{Impatient Online Matching}},
  year = {2016},
  eprint = {1610.05155},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1610.05155},
}
Figure