Abstract
In this paper, we consider the online matching problem with two heterogeneous sensors and in a metric space . If a request r is assigned to sensor , the service cost of r is the distance . Otherwise, r is assigned to sensor , and the service cost of r is , where is the weight of sensor . The goal is to minimize the maximum matching cost, we design an optimal online algorithm with a competitive ratio of for , and an optimal online algorithm with a competitive ratio of for .
1. Introduction
In a metric space , X is a set of points and is a distance function. is a set of sensors, and is a set of requests. Each request arrives one by one in an online fashion. When a request arrives, it must be immediately and irrevocably matched to some unmatched sensor . The cost of matching to is the distance .
For a minimization problem and an input instance I, let ( for short) and ( for short) be the costs of the feasible solution obtained by an online algorithm A and an optimal off-line algorithm, respectively. An online algorithm A is -competitive (or the competitive ratio of A is at most ) if for any input instance I. For an online problem, if there is no algorithm with competitive ratio less than r, then r is a lower bound of the problem. If there is an algorithm whose competitive ratio matches the lower bound, this algorithm is called an optimal online algorithm.
Online problem and algorithm can be abstracted as a request-answer game between the algorithm designer and adversary. Each time the adversary gives a request, the algorithm decides how to respond based on the previous responses of both parties and the current request, and the adversary gives the next request based on the responses of both parties so far. The goal of the algorithm is to make it perform as well as possible, while the goal of the adversary is exactly the opposite.
Online-matching based models have many applications, e.g., when assigning cars to parking spots, advertisers to ad slots, skis to skiers at a rental station, drivers and riders in Uber. The classical Online Minimum Matching (OMM) is to find a matching M such that the total cost of matching all requests is minimized. Kalyanasundaram and Pruhs [1] and Khuller et al. [2] independently introduced the OMM problem and proved that the Permutation is an optimal online algorithm with a competitive ratio of . Meanwhile, Kalyanasundaram and Pruhs [1] also proved that the greedy algorithm is -competitive, and this bound is tight. Meyerson et al. [3] presented a randomized online algorithm with competitive ratio of . Bansal et al. [4] proposed an -competitive randomized algorithm.
If the metric space is a line, Gupta and Lewi [5] gave an -competitive randomized algorithm for the OMM problem. Fuchs et al. [6] gave a lower bound 9.001 for the OMM problem. Antoniadis et al. [7] designed a deterministic online algorithm with competitive ratio for any . Nayyar and Raghvendra [8] proved that the competitive ratio of the deterministic online algorithm proposed in [9] is , which is improved to [10] for the OMM problem. Recently, Peserico and Scquizzato [11] proved that the competitive ratio of any randomized online algorithm for the OMM problem exceeds .
The OMM problem is closely related to the Online Bottleneck Matching (OBM) problem which is to find a matching M such that the maximum cost is minimized. Kalyanasundaram and Pruhs [1] also introduced the OBM problem and proved that the Permutation algorithm is -competitive, and gave a lower bound of . Idury and Schaffer [12] gave a lower bound approximately for the OBM problem even if the metric space is a real line. Anthony and Chung [13] proved that the greedy algorithm achieves a competitive ratio of .
A generalized version of the OMM problem, which is called online b-matching [1], online transportation [1], the fire station problem [14], the school assignment problem [14], or online facility assignment [15], is also considered, where each sensor can be matched multiple times. Recently, Itoh et al. [16] presented several lower bounds on the competitive ratio for this problem with different number of sensors. Xiao and Li [17] considered the semi-matching problem with two heterogeneous sensors, and proposed two optimal online algorithms.
In this paper, we describe our problems and some preliminaries in Section 2. In Section 3, we consider an OBM problem with two heterogeneous sensors. We gives two optimal online algorithms, and the competitive ratios are shown in Figure 1. Finally, we make a summary in Section 4.
Figure 1.
Two competitive ratios in this paper.
2. Preliminaries
Let be a metric space, where X is a set of points and is a distance function. We are given a set of two heterogeneous sensors and two requests , in X, where each sensor is characterized by the position and the weight , . A request is also characterized by the position , .
In the online fashion, the positions of the sensors are known in advance. The requests arrive one-by-one and the request must be assigned to some unmatched sensor before the request arrives. A sensor is called available if the is not matched by one request. If is matched with the sensor , the cost of pair is
For convenience, let be the request matched by sensor for . Without loss of generality, we assume that and .
The online bottleneck matching problem with two heterogeneous sensors () is to find a matching such that the maximum cost
is minimized. Clearly, if , this problem is exactly the problem considered in [18] and has an optimal online algorithm with competitive ratio 3.
3. The OBM(2) Problem
In this section, for different ranges of w, we use the adversary approach to obtain the worst case competitive ratios of the OBM(2) problem. Let be the real root of the equation , implying that
We propose two optimal online algorithms for and in next two subsections respectively.
3.1. The Case
Theorem 1.
When , any online algorithm A for OBM(2) has a competitive ratio at least , even if is a line.
Proof.
As shown in Figure 2, let , , and . The first request arrives at position . If is matched with sensor , the last request arrives at position . Therefore, , and , implying that
Figure 2.
The locations of sensors and requests.
If is matched with sensor , the last request arrives at position . Therefore, , , implying that
According to the above analysis, there is no online algorithm which competitive ratio strict smaller than . □
When , our Algorithm 1 is described as follows.
| Algorithm 1:A1 |
![]() |
Theorem 2.
The competitive ratio of Algorithm 1 is at most .
Proof.
Let be the off-line optimal solution, and be the feasible solution produced by the Algorithm 1. Let be the request attaching the maximum in the , and be the request attaching the maximum in the , . For , if , implying that Algorithm 1 produces an optimal solution. Otherwise,
we distinguish the following four cases.
Case 1. and ( and .
In this case, we have and . By (1), we have . If , by the choice of Algorithm 1, we have . Since , we have
implying that
If , by the choice of Algorithm 1, we have . Hence,
Case 2. and .
In this case, we have and . By (1) and , we have .
If , by the choice of Algorithm 1, we have . Therefore, by (2),
If , by the choice of Algorithm 1, we have . Hence,
Case 3. and ( and .
In this case, we have and . By (1), we have . If , by the choice of Algorithm 1, we have . Hence,
If , by the choice of Algorithm 1, we have . Hence,
Case 4. and .
In this case, we have and . By (1), we have .
If , by the choice of Algorithm 1, we have . Therefore,
If , by the choice of Algorithm 1, we have . Hence,
Therefore, the theorem holds. □
3.2. The Case
Theorem 3.
When , any online algorithm A for OBM(2) has a competitive ratio at least , even if is a line.
Proof.
Let . As shown in Figure 3, assume that and . The first request arrives at position . If is matched with sensor , the last request arrives at position , implying and . Thus,
Figure 3.
The locations of sensors and requests.
If is matched with sensor , the last request arrives at position , implying that , and . Thus,
Therefore, the theorem holds. □
When , for convenience, let
Our Algorithm 2 is described as follows.
| Algorithm 2:A2 |
![]() |
Theorem 4.
The competitive ratio of Algorithm 2 is at most .
Proof.
As in the proof of Theorem 2, let be the request attaching the maximum in the feasible solution produced by the Algorithm 2, and be the request attaching the maximum in the optimal solution , We assume that
and distinguish the following four cases.
Case 1. and ( and .
In this case, we have and . By (3), we have . If , by the choice of Algorithm 2, we have . Therefore,
If , by the choice of Algorithm 2, we have . Hence,
Case 2. and .
In this case, we have and . By (3) and , we have . If , by the choice of Algorithm 2, we have . Therefore,
If , by the choice of Algorithm 2, we have . Hence,
Case 3. and ( and .
In this case, we have and . By (3), we have . If , by the choice of Algorithm 2, we have . Hence,
If , by the choice of Algorithm 2, we have . Hence,
where the last inequality follows from that .
Case 4. and .
In this case, we have and . By (3), we have .
If , by the choice of Algorithm 2, we have . Therefore,
If , by the choice of Algorithm 2, we have . Hence,
where the last inequality follows from .
Therefore, the theorem holds. □
4. Discussion
In this paper, we studied an online matching problem with two heterogeneous sensors in a metric space. For the bottleneck objective, we proposed two optimal online algorithms for different values of w. It is interesting to study the online matching problem with more than three sensors.
Author Contributions
M.X. proposed the methods, and wrote the manuscript; Y.Y. provided suggestions for the methods and reviewed the manuscript; W.L. proposed the problem, reviewed and modified the manuscript. All authors have read and agreed to the published version of the manuscript.
Funding
The work is supported in part by the National Natural Science Foundation of China [No. 12071417].
Conflicts of Interest
The authors declare no conflict of interest.
References
- Kalyanasundaram, B.; Pruhs, K. Online weighted matching. J. Algorithms 1993, 14, 478–488. [Google Scholar] [CrossRef]
- Khuller, S.; Mitchell, S.G.; Vazirani, V.V. On-line algorithms for weighted bipartite matching and stable marriages. Theor. Comput. Sci. 1994, 127, 255–267. [Google Scholar] [CrossRef]
- Meyerson, A.; Nanavati, A.; Poplawski, L. Randomized online algorithms for minimum metric bipartite matching. In Proceedings of the Seventeenth Annual ACM-SIAM Symposium on Discrete Algorithm (SODA), Miami, FL, USA, 22–24 January 2006; pp. 954–959. [Google Scholar]
- Bansal, N.; Buchbinder, N.; Gupta, A.; Naor, J.S. A randomized O(log2 k)-competitive algorithm for metric bipartite matching. Algorithmica 2014, 68, 390–403. [Google Scholar] [CrossRef]
- Gupta, A.; Lewi, K. The online metric matching problem for doubling metrics. In Proceedings of the International Colloquium on Automata, Languages, and Programming (ICALP), Warwick, UK, 9–13 July 2012; pp. 424–435. [Google Scholar]
- Fuchs, B.; Hochstattler, W.; Kern, W. Online matching on a line. Theor. Comput. Sci. 2005, 332, 251–264. [Google Scholar] [CrossRef][Green Version]
- Antoniadis, A.; Barcelo, N.; Nugent, M.; Pruhs, K.; Scquizzato, M. A o(n)-competitive deterministic algorithm for online matching on a line. Algorithmica 2019, 81, 2917–2933. [Google Scholar] [CrossRef]
- Nayyar, K.; Raghvendra, S. An input sensitive online algorithm for the metric bipartite matching problem. In Proceedings of the IEEE 58th Annual Symposium on Foundations of Computer Science, Berkeley, CA, USA, 15–17 October 2017; pp. 505–515. [Google Scholar]
- Raghvendra, S. A robust and optimal online algorithm for minimum metric bipartite matching. In Proceedings of the International Conference on Approximation, Randomization, and Combinatorial Optimization—Algorithms and Techniques (APPROX/RANDOM 2016), Seattle, WA, USA, 16–18 August 2016; p. 18. [Google Scholar]
- Raghvendra, S. Optimal analysis of an online algorithm for the bipartite matching problem on a line. In Proceedings of the 34th International Symposium on Computational Geometry, College Park, MD, USA, 14–17 July 2017; p. 67. [Google Scholar]
- Peserico, E.; Scquizzato, M. Matching on the line admits no o()-competitive algorithm. In Proceedings of the 48th International Colloquium on Automata, Languages, and Programming (ICALP), Glasgow, Scotland, 12–16 July 2021; p. 103. [Google Scholar]
- Idury, R.; Schaffer, A.A. A Better Lower Bound for On-Line Bottleneck Matching. Manuscript. 1992. Available online: http://www.ncbi.nlm.nih.gov/core/assets/cbb/files/Firehouse.pdf (accessed on 29 September 2022).
- Anthony, B.M.; Chung, C. Online bottleneck matching. J. Comb. Optim. 2014, 27, 100–114. [Google Scholar] [CrossRef]
- Kalyanasundaram, B.; Pruhs, K. The online transportation problem. SIAM J. Discret. Math. 2000, 13, 370–383. [Google Scholar] [CrossRef]
- Ahmed, A.R.; Rahman, M.S.; Kobourov, S. Online facility assignment. Theor. Comput. Sci. 2020, 806, 455–467. [Google Scholar] [CrossRef]
- Itoh, T.; Miyazaki, S.; Satake, M. Competitive analysis for two variants of online metric matching problem. Discret. Math. Algorithms Appl. 2021, 13, 2150156. [Google Scholar] [CrossRef]
- Xiao, M.; Li, W.D. Online semi-matching problem with two heterogeneous sensors in a metric space. In Proceedings of the 28th International Computing and Combinatorics Conference (COCOON), Shenzhen, China, 22–24 October 2022. [Google Scholar]
- Xiao, M.; Zhao, S.; Li, W.D.; Yang, J.H. Online Bottleneck Semi-matching. In Proceedings of the 15th Annual International Conference on Combinatorial Optimization and Applications (COCOA), Tianjin, China, 17–19 December 2021; pp. 445–455. [Google Scholar]
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

