arXiv:2610.21285cs.DSOct 2026Cited by 2 papers on PaperVantage

Manuscript Offprint

arXiv:2610.21285

A General Framework for Matching with Delays

Sara Ahmadian, Shuchi Chawla, Ravi Kumar, Manish Purohit, Shirley Zhang

Abstract

We present a simple deterministic O(log⁡n)O(\log n)-competitive algorithm for the online minimum-cost perfect matching with delays (MPMD) problem on arbitrary, unknown metric spaces, where n is the (unknown) number of requests. This improves upon the recent O(log⁡5n)O(\log^5 n)-competitive algorithm of Dufay and Wattenhofer (SODA 2026) and nearly matches the Ω(log⁡n/log⁡log⁡n)\Omega(\log n/\log \log n) randomized lower bound of Ashlagi et al. (APPROX 2017). Our algorithmic framework rests on two ingredients: an online moat-growing process that grows active dual variables at a deliberately slowed constant rate α<1\alpha < 1 to control temporal asymmetry, and a delayed eligibility rule that matches requests in the same dual component only after their waiting time is proportional to their time-expanded distance. The framework extends naturally to arbitrary concave delay functions, maintaining an O(log⁡n)O(\log n) competitive ratio, and to k-way matching with delays, yielding an O(klog⁡n)O(k \log n)-competitive deterministic algorithm.

1 Introduction

In this paper we study the problem of min-cost perfect matching with delays (MPMD), introduced by Emek, Kutten, and Wattenhofer (2016). In this problem, requests arrive over time in a metric space. The algorithm may irrevocably match any two pending requests at any time, paying the metric distance between their locations together with the time each has waited since its arrival. Every request must eventually be matched, and the objective is to minimize the total connection and delay cost.

Delay in service is an important consideration in many online systems. However, postponing service can sometimes create opportunities to improve its quality or use resources more efficiently. This tradeoff arises naturally in matching problems, where requests are processed in pairs. For example, an online gaming platform seeks to pair players of similar skill to provide a balanced and engaging game. A ride-pooling service combines requests with compatible routes to reduce travel costs and passenger detours. A computational system groups jobs with similar processing requirements into batches to reduce wasted capacity. In each setting, a suitable partner may not be available when a request arrives, and waiting for future arrivals can improve the match. But this flexibility sets up a tradeoff: matching immediately can commit the system to poor choices, while waiting too long can erase the benefit of a better match. The algorithmic challenge is to manage this tradeoff without knowing which requests will arrive next.

Main contributions We study MPMD in the general setting when neither the metric space (which may be infinite) nor the number of requests (n) is known a priori: the algorithm learns only the locations of arriving requests and the distances between them. We develop a new framework that yields simple deterministic algorithms with nearly tight competitive ratios. The framework rests on two novel ideas: an online dual-growing process that grows dual variables at a deliberately reduced rate, and a delayed eligibility rule that allows requests to be matched only once they belong to the same dual component and satisfy a waiting time threshold. Together, these ideas yield a surprisingly simple algorithm: match eligible pairs as soon as possible, breaking ties arbitrarily.

For this unknown-metric setting, Bienkowski, Kraska, and Schmidt (2017) first gave an O(nlog⁡25.5)O(n^{\log_2 5.5})-competitive algorithm; this was later improved to O(n)O(n) by Bienkowski, Kraska, Liu, and Schmidt (2018) using the same primal-dual formulation that we use in this paper. Subsequently, Azar and Jacob Fanani (2020) reduced this factor to O(nlog⁡21.5+ϵ)≈O(n0.59)O(n^{\log_2 1.5+\epsilon}) \approx O(n^{0.59}). In a recent breakthrough, Dufay and Wattenhofer (2026) obtained the first deterministic polylogarithmic competitive ratio of O(log⁡5n)O(\log^5 n). We show:

Theorem 1.1 (Main result). There is a deterministic O(log⁡n)O(\log n)-competitive algorithm for min-cost perfect matching with delays on arbitrary metric spaces. The algorithm requires no advance knowledge of the metric space or the number of requests.

Our bound is nearly tight, as Ashlagi et al. (2017) showed that no algorithm, even randomized, can obtain a ratio better than Ω(log⁡n/log⁡log⁡n)\Omega(\log n/\log \log n) against an oblivious adversary. As we will see, relative to the earlier primal-dual approach, a key difference in our work is that the dual grows at a slow constant rate below 1; this allows the primal–dual gap to be bounded by a constant.

Extensions The same approach extends with only minor changes to two natural variants. First, suppose that a request waiting for t units of time incurs cost ϕ(t)\phi(t), where ϕ\phi is a known, increasing, unbounded concave function with ϕ(0)=0\phi(0) = 0. MPMD with concave delays has also been well studied in literature and Deryckere and Umboh (2023) gave an O(n)O(n)-competitive algorithm. Adjusting the dual growth and matching thresholds to the delay function ϕ\phi, we show:

Theorem 1.2 (Concave delays). There is a deterministic O(log⁡n)O(\log n)-competitive algorithm for min-cost perfect matching with arbitrary concave delays on arbitrary metric spaces.

Our techniques also naturally extend to the k-way matching problem with delays, in which requests must be partitioned into groups of size exactly k. The problem was introduced by Melnyk, Wang, and Wattenhofer (2021) to model multiplayer online games. When the connection cost of a group is equal to the sum of all the pairwise costs inside it, and the delays are linear, we show:

Theorem 1.3 (k-way matching). There is a deterministic O(klog⁡n)O(k \log n)-competitive algorithm for min-cost k-way matching with delays on arbitrary metric spaces with sum group costs.

Thus, for every fixed k, the dependence on the number of requests remains logarithmic. Through a reduction to sum costs, we extend our framework to several other metrics on sets of size k, obtaining O(poly k⋅log⁡n)O(\text{poly } k \cdot \log n) competitive ratios. These include diameter, MST cost, and the general class of H-metrics introduced by Melnyk, Wang, and Wattenhofer (2021) to model k-way connection costs. See Appendix C for these extensions.