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 $\Omega(\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.
Introduction
The online minimum cost matching problem is a fundamental challenge in operations research and computer science, with direct applications in ride-hailing and delivery logistics. In this setting, $n$ servers are available, and $n$ requests arrive sequentially. Each request must be immediately and irrevocably matched to an available server to minimize the total distance traveled.
While the simple "nearest neighbor" greedy algorithm is intuitive and performs well in practice, theoretical analysis has long painted a bleak picture. In worst-case adversarial scenarios on a line, Greedy's competitive ratio—the ratio of its cost to the optimal offline solution—can be as high as $2^n - 1$. This paper bridges the gap between theory and practice by analyzing Greedy under randomized and semi-random models, providing a theoretical justification for its strong empirical performance.
Methodology: The Hybrid Lemma
The authors introduce a novel mathematical framework to analyze Greedy's performance. The core of their approach is the Hybrid Lemma. They define a sequence of hybrid algorithms $H^m_A$ that follow a known efficient reference algorithm $A$ for the first $m$ requests before switching to Greedy for the remaining requests.
By bounding the expected cost increase at each switch point and using a telescoping sum, they rigorously bound the total expected cost of the Greedy algorithm. This structural analysis also demonstrates that Greedy is "customer-strategyproof," meaning users have no incentive to misreport their locations to obtain a better match, a property not shared by many more complex algorithms.
Key Results and Comparative Performance
The paper's primary contribution is proving that randomness significantly tames the "butterfly effect" in Greedy matching, where one early poor choice typically cascades into a series of expensive matches.
As shown in the table above, the competitive landscape varies significantly based on the arrival order and metric space. The authors' findings significantly improve the known bounds for Greedy in randomized settings:
- Constant Competitiveness: In the fully random model (where both servers and requests are uniform on $[0,1]$), Greedy achieves a constant competitive ratio, a major leap from the previous $O(\sqrt{n})$ bound.
- Semi-Random Robustness: In the model where servers are adversarial but requests are random, Greedy achieves an $O(\log n)$ competitive ratio.
- Excess Supply: If there is even a small linear excess of servers (e.g., 1% more drivers than customers), Greedy remains constant-competitive, improving upon the previous $O(\log^3 n)$ bound.
- Tight Bounds for Random Order: For adversarial requests arriving in a random order, the authors provide a tight $\Omega(\log n)$ lower bound, showing that random arrival order alone is insufficient for constant competitiveness.
Discussion and Future Directions
Beyond the line metric ($d=1$), simulations in higher dimensions suggest that Greedy's performance may actually improve as dimensionality increases, with competitive ratios staying below 1.4 in up to 12D hypercubes. However, formal proofs for $d \ge 2$ remain an open challenge. Future research could also investigate non-uniform request distributions or "sublinear excess" scenarios where the number of servers only slightly exceeds the number of requests. These results invite further investigation into the minimum amount of randomness required to guarantee strong performance for simple, practical algorithms like Greedy.
Summary updated