Online Matching with Delays and Size-Based Costs
Abstract
In this paper, we introduce the problem of Online Matching with Delays and Size-based Costs (OMDSC). The OMDSC problem involves requests arriving online. At any time, a group can be formed by matching any number of requests that have been received but remain unmatched. The cost associated with each group is determined by the waiting time for each request within the group and size-dependent cost. The size-dependent cost is specified by a penalty function. Our goal is to partition all the incoming requests into multiple groups while minimizing the total associated cost. This problem is an extension of the TCP acknowledgment problem proposed by Dooly et al. (J. ACM, 2001). It generalizes the cost model for sending acknowledgments. This study reveals the competitive ratios for a fundamental case, in which the penalty function takes only values of either or . We classify such penalty functions into three distinct cases: (i) a fixed penalty of regardless of the group size, (ii) a penalty of if and only if the group size is a multiple of a specific integer , and (iii) other situations. The problem in case (i) is equivalent to the TCP acknowledgment problem, for which Dooly et al. proposed a -competitive algorithm. For case (ii), we first show that natural algorithms that match all remaining requests are -competitive. We then propose an -competitive deterministic algorithm by carefully managing the match size and timing, and prove its optimality. For any penalty function in case (iii), we demonstrate the non-existence of a competitive online algorithm. Additionally, we discuss competitive ratios for other typical penalty functions that are not restricted to take values of or .
Keywords and phrases:
Online matching, competitive analysis, delayed serviceFunding:
Yasushi Kawase: JST ERATO Grant Number JPMJER2301, JST PRESTO Grant Number JPMJPR2122, JSPS KAKENHI Grant Number JP20K19739, and Value Exchange Engineering, a joint research project between Mercari, Inc. and the RIISE.Copyright and License:
![[Uncaptioned image]](x1.png)
2012 ACM Subject Classification:
Theory of computation Online algorithmsAcknowledgements:
The authors thank anonymous reviewers for useful comments.Editors:
Olaf Beyersdorff, Michał Pilipczuk, Elaine Pimentel, and Nguyễn Kim ThắngSeries and Publisher:

1 Introduction
In online gaming platforms, the challenge of matching players for an optimal gaming experience lies in balancing minimal waiting times and high match quality. For instance, consider an online gaming platform hosting a -player game, such as chess (), Mahjong (), or battle royal-style shooting games (e.g., for Apex Legends). On such platforms, players enter a waiting queue sequentially, and the platform selects players from the queue to start a match. To address scenarios with an insufficient number of players, the platform may opt to fill in groups with computer (AI) players. Although this approach ensures prompt matchmaking, it potentially compromises the quality of the gaming experience. Conversely, waiting to gather the full quota of the required players may significantly increase the waiting time, potentially reducing player satisfaction.
Motivated by the above challenge, we introduce the Online Matching with Delays and Size-based Costs (OMDSC) problem. In this problem, requests (corresponding to players) are presented sequentially in real time. At any moment, it is possible to match a group composed of any number of previously received but unmatched requests. The total cost associated with each match is defined by the waiting time for each request within the group and the cost that depends on the group size. The penalty function specifies the cost based on the size of the group.
The OMDSC problem has applications beyond gaming. For instance, in online shopping services, product orders arrive sequentially, and the products can be dispatched together at any time. While it is preferable to dispatch as many orders as possible to minimize costs, customers may become frustrated if their wait times are too long. This situation can also be modeled as an OMDSC problem, where the waiting time and the size of each dispatch jointly determine the total cost.
Notably, our problem is closely related to the TCP acknowledgment problem [14], the online weighted cardinality Joint Replenishment Problem (JRP) with delays [12], and the online Min-cost Perfect Matching with Delays (MPMD) [16]. The TCP acknowledgment problem (without look-ahead) is equivalent to the OMDSC problem with a constant penalty function. Various generalizations of the TCP acknowledgment problem partially capture the OMDSC problem. Specifically, the online weighted cardinality JRP with delays considers the costs dependent on the (weighted) cardinality of each group. In these generalizations, the penalty function is assumed to be monotonically nondecreasing. However, the OMDSC problem treats penalty functions as nonmonotonic. In the MPMD problem, requests arrive on a metric space, and matching is restricted to groups of exactly size . The online Min-cost Perfect -way Matching with Delays (-MPMD) [27] extends the group size to . For further details, please refer to Section 1.2.
1.1 Our Results
In this study, we determine the competitive ratios of the OMDSC problem for fundamental and critical scenarios in which the penalty function takes only values of either or . In the OMDSC problem, dividing a group into multiple smaller groups can reduce penalties. Therefore, it is sufficient to consider a modified penalty function obtained by optimally dividing a group into subgroups. With this modification, we classify penalty functions into three cases: (i) always , (ii) if the size is a multiple of , and (iii) all other scenarios.
In case (i), the OMDSC problem is equivalent to the TCP acknowledgment problem. Dooly et al. [14] proposed a -competitive online algorithm that matches all remaining requests when the total waiting cost increases by . For case (ii), we first examine natural algorithms that match all the remaining requests whenever a match incurs a positive cost, which we refer to as match-all-remaining algorithms. We demonstrate that every match-all-remaining algorithm is -competitive (Theorem 6). Consequently, to obtain an -competitive algorithm, we must consider both the timing and size of the requests to be matched. By carefully managing remaining requests, we propose an -competitive online algorithm (Theorem 8). We also prove that this competitive ratio is the best possible (Theorem 15). It is worth mentioning that the competitive ratio for case (ii) with is trivial (Theorem 3) and that with can be obtained from the results of Emek et al. [17]. For any penalty function in case (iii), we prove that no competitive online algorithm exists (Theorem 2). The results are summarized in Table 1. Furthermore, the competitive ratios for other typical penalty functions that are not restricted to take values of or are discussed in Section 2.3.
1.2 Related Work
An online version of the matching problem was first introduced by Karp et al. [21]. In their study, arriving requests are matched immediately upon arrival, primarily focusing on bipartite matching. Additionally, research has been conducted to minimize matching costs, both in settings where vertices have determined costs and in settings that consider distances in a metric space. Mehta et al. [26] proposed an application to AdWords. Other applications, such as food delivery, have also been considered. For further details, please refer to [25, 15].
In applications such as online game matchmaking and ride-sharing services, service providers can delay user matches. Emek et al. [16] modeled this scenario as an MPMD problem. In this setting, the requests can be retained by incurring waiting costs. Several online algorithms have been proposed for solving the MPMD problem [1, 8, 3]. Subsequently, Melnyk et al. [27] extended the MPMD problem to the -MPMD problem, which requires exactly matching the size . To address this problem, deterministic and randomized algorithms have been proposed [27, 19].
Dooly et al. [14] introduced the TCP acknowledgment problem that involves acknowledging TCP packets. In this problem, the aim is to minimize the sum of the acknowledgment costs and the costs of delaying TCP packets. Optimal deterministic and randomized algorithms were proposed by Dooly et al. [14] and Karlin et al. [20], respectively. The TCP acknowledgment problem is equivalent to the OMDSC problem, where the penalty function falls under case (i). Conversely, the OMDSC problem can be viewed as a generalization of the acknowledgment cost of the TCP acknowledgment problem.
Various extensions of the TCP acknowledgment problem have been proposed [10, 7, 6, 9, 5, 11, 2, 29, 12]. In particular, Chen et al. [12] introduced the problem of an online weighted cardinality JRP with delays. Their model can handle penalties based on the size of the match. However, unlike in our study, their penalty function is restricted to monotonically nondecreasing. They proposed a constant-competitive algorithm to solve this problem.
The objectives of the MPMD and -MPMD problems are to pair requests and form groups of exact size , respectively. In contrast, the proposed OMDSC problem does not impose constraints on the number of requests in each group. Emek et al. [16] introduced a problem called MPMDfp, which allows the clearance of a request at a cost. The MPMDfp problem on a single source is equivalent to the OMDSC problem where the penalty function corresponds to case (ii) with . Additionally, the MPMDfp problem on a single source can be reduced to an MPMD problem using two sources [16]. For MPMD on two sources, Emek et al. [17] proposed a deterministic algorithm, and He et al. [18] proposed a randomized algorithm (see Section 4 for more details).
Another approach to extend the MPMD problem is to modify waiting costs. Liu et al. [23] generalized the waiting costs from linear to convex. Other variations of waiting costs have also been studied [24, 4, 13]. Pavone et al. [28] investigated Online Hypergraph Matching with Deadlines problem. Although hypergraph matching does not impose constraints on group size, it differs from the OMDSC problem in that it employs deadlines instead of delays, and requests arrive at one at each unit of time.
2 Preliminaries
We denote the set of real numbers, nonnegative real numbers, integers, nonnegative integers, and positive integers by , , , , and , respectively. In addition, for a positive integer , we define as the set of integers from to .
2.1 Problem Settings
In this section, we formally define the OMDSC problem. An instance of the problem is specified by a penalty function and requests that arrive in real time. Each request arrives at time , where is assumed.
An online algorithm initially knows only the function ; it does not have prior knowledge of the arrival times or the total number of requests. Each request is revealed at time . At each time , the algorithm can match any subset of requests that appeared by time and have not yet been matched. The cost of matching requests in at time is defined as
where the first term represents the size cost and the second term represents the waiting cost. In addition, the waiting cost at time is defined as , where is the set of unmatched but previously presented requests at that time.
The objective is to design an online algorithm that matches all requests while minimizing the total cost. We use the competitive ratio to evaluate the performance of the online algorithm. For a given instance , let represent the cost incurred by the online algorithm and let denote the optimal cost with prior knowledge of all requests in the instance. The competitive ratio of for an instance is defined as , interpreting as . In addition, the competitive ratio of for a problem is defined as the supremum of the competitive ratios over all instances, that is, . We call an online algorithm -competitive if the competitive ratio of that algorithm is .
The competitive ratio defined above is the strict competitive ratio. We can also define the asymptotic competitive ratio as . However, in our problem, the strict and asymptotic competitive ratios of the optimal algorithm coincide. Indeed, if an algorithm is strictly -competitive, then it is also asymptotically at most -competitive by definition. Moreover, if no strictly -competitive algorithm exists, we can construct an instance for each algorithm in which the strict competitive ratio is at least . Thus, by repeatedly constructing and providing such instances, we can conclude that no algorithm has an asymptotic competitive ratio better than . Hence, we only consider the strict competitive ratio hereafter.
2.2 Binary Penalty Function
This study focuses primarily on penalty functions that take values only of either or . We discuss other penalty functions in Section 2.3. For such a binary penalty function , we may be able to match requests with size cost , even if , by appropriately partitioning the requests. For instance, if and , we can match requests with a size cost of by partitioning them into groups of sizes , , and . We introduce a notation for the set of numbers of requests that can be matched with a size cost of as follows:
Definition 1.
For the penalty function , we define the zero-penalty set as a set of quantities that can be matched with a size cost of by optimally dividing requests into subsets and matching them. Formally,
For example, if , then . Alternatively, if and , then . We can interpret the size cost of matching requests as if and if .
We classify binary penalty functions into the following three types: (i) , (ii) for some , and (iii) all other scenarios. Case (i) is the situation in which the penalty for matching requests is always (i.e., for all ). Case (ii) is a situation in which a set of requests can be matched without a size cost only if the size is a multiple of (i.e., and for all ). This case is applicable in the context of an online gaming platform that hosts a -players game, as described in Introduction.
2.3 Other Penalty Functions
If the range of the penalty function is with a positive real , it can be treated as a binary penalty function by scaling the increase rates of the waiting costs times slower. This is because the cost of matching requests in at time can be expressed as . For example, if and the unit time is one minute in the original problem, the range of the penalty function can be treated as by adjusting the unit time to one hour. Let with and consider a penalty function that takes values of or within the range . By applying our -competitive algorithm to the problem while treating positive penalties as if they were , we can obtain a -competitive algorithm. In addition, our impossibility result for case (iii) can be transferred in the same manner.
Another interesting penalty function is for a specific integer . This penalty function appears when a service can process up to requests simultaneously, and each processing costs a fixed amount. For this penalty function, an algorithm similar to that in (i) is -competitive for any . We also prove that this competitive ratio is best possible for every (see the full version [22]). For , the algorithm that matches each request upon its arrival is -competitive.
3 Zero-penalty Set is Nonempty and Non-representable as Multiples
In this section, we examine case (iii), where the penalty function satisfies and for any . We demonstrate that, in this case, no algorithm has a finite competitive ratio.
To illustrate this intuitively, let us consider the case where and , representing a poker table for at least two players. Imagine two players arriving initially, followed potentially by a third. If we match the first two players immediately upon their arrival, matching the subsequent player incurs a cost. Alternatively, if we wait to match the first two, an unnecessary waiting cost is incurred when no additional player appears. We can construct similar instances for every penalty function in case (iii).
Theorem 2.
For the OMDSC problem with a penalty function that satisfies both and for every , the competitive ratio of any randomized algorithm is unbounded against an oblivious adversary.
Proof.
Let , where such a value must exist by the assumption that . Additionally, let , where such a value must exists because and . We fix an arbitrary online algorithm and take a sufficiently small . Consider an instance where requests are given at time , and afterward, there may be arrivals of additional requests at time depending on the behavior of . Suppose that matches all the initial requests before with probability .
If , consider an instance where additional requests are given at time . Since , incurs an expected size cost of at least . In contrast, the minimum total cost is by matching all requests at time . Thus, the competitive ratio is at least .
Conversely, if , consider the instance where no additional requests are presented. Then, the (expected) waiting cost for is at least , while the offline optimal cost is by matching all requests at time . Hence, the competitive ratio is unbounded.
Therefore, in both scenarios, the competitive ratio is unbounded as goes to , proving that the competitive ratio for any online algorithm is unbounded.
4 Zero-penalty Set is Multiples of an Integer
In this section, we investigate the case (ii), where the penalty function satisfies for some .
When (i.e., ), we have . Thus, the algorithm that immediately matches each request individually upon its arrival incurs a cost of and is -competitive.
Theorem 3.
For the OMDSC problem with a penalty function such that , there exists a -competitive deterministic online algorithm.
For the case , the OMDSC problem is equivalent to the problem of MPMDfp in a metric space consisting of a single point. It is known that the MPMDfp problem can be reduced to the MPMD problem by doubling the number of points on the metric space [16]. By this reduction, the OMDSC problem with can be reduced to the problem of MPMD on two sources by setting the distance between two sources to and giving requests for two sources simultaneously when a request is given in the OMDSC problem. A matching across two sources in the MPMD problem corresponds to a matching of a single request in the OMDSC problem. The optimal cost of the reduced MPMD problem is twice that of the original OMDSC problem.
Emek et al. [17] provided a -competitive online algorithm for the online MPMD problem on two sources and demonstrated that this is best possible. In their instances constructed for the proof of the lower bound, requests are always given to two sources simultaneously, which can be reduced to the OMDSC problem with . Therefore, we obtain the following theorem.
Theorem 4 (Emek et al. [17]).
For the OMDSC problem with a penalty function such that , there exists a -competitive deterministic algorithm. Moreover, no deterministic online algorithm has a competitive ratio smaller than .
He et al. [18] proposed a -competitive randomized algorithm against an oblivious adversary for the MPMD problem on two sources. Thus, this leads to a -competitive randomized algorithm for the OMDSC problem with .
In the remainder of this section, we conduct an asymptotic analysis with respect to .
Firstly, we define a type of algorithm as below and demonstrate the difficulty of case (ii) compared to case (i).
Definition 5.
We call an algorithm for the OMDSC problem match-all-remaining if, whenever it makes a match, it matches all remaining requests or the size is in .
For case (i), where a penalty to match requests is always , a match-all-remaining algorithm achieves the optimal competitive ratio. However, for case (ii), we show that every match-all-remaining algorithm has a competitive ratio of , where the proof can be found in the full version [22].
Theorem 6.
For the OMDSC problem with a penalty function that satisfies , every match-all-remaining algorithm has a competitive ratio of .
In Section 4.1, we provide an -competitive algorithm by utilizing partial matchings of remaining requests. Thus, no match-all-remaining algorithm is optimal. Subsequently, in Section 4.2, we establish the lower bound of .
Before proceeding, we introduce some notations. Recall that .
Definition 7.
We write to represent the remainder of when divided by . Additionally, for , we define the cyclic interval
With this notation, can be expressed as . Note that we have if and if .
Let be a real number such that . Then, we have because the ratio approaches as (i.e., ). Thus, our task is to provide upper and lower bounds of and , respectively.
4.1 Upper Bound
The objective of this subsection is to prove the following theorem.
Theorem 8.
For the OMDSC problem with a penalty function that satisfies , there exists an -competitive deterministic online algorithm.
According to Theorem 6, an ()-competitive algorithm must consider both the timing and the size of requests to be matched. To address this requirement, we propose an algorithm that references the costs of other algorithms. The execution of the algorithm is divided into phases. In each phase, the goal is to ensure that any competing algorithm incurs a cost of at least , while our algorithm’s cost remains at most . We categorize competing algorithms based on the number of unmatched requests they carry over from the previous phase. As for the current phase, we assume that algorithms only perform matches of sizes that are multiples of , since otherwise, their cost immediately reaches at least . Furthermore, it is sufficient to focus on “greedy” algorithms that immediately match requests whenever at least unmatched requests exist.
The first phase starts at the beginning. In each phase, our algorithm runs with the following variables.
Definition 9.
At each time within each phase, the variables , , and are defined as follows:
-
: the waiting cost incurred by time within the phase on the algorithm that greedily performs matches with no size cost, assuming unmatched requests are carried over to the current phase.
-
: the number of requests given by time in the phase.
-
: the number of requests that our algorithm has matched up to, but not including, time during the phase.
We will omit the argument when there is no confusion.
Note that, if unmatched requests are carried over to the current phase, the optimum cost incurred thus far within the phase is at least . At the end of the phase, our algorithm ensures for all . This means that any algorithm incurs a cost of at least per phase because matching a number of requests that is not a multiple of results in a cost of .
During each phase, our algorithm recursively processes a subroutine , which takes as parameters a cyclic interval and an integer . When the subroutine is called, it ensures that for all and for all . In each iteration of the subroutine, the interval size is reduced by a factor of or is increased by one, with incurring cost at most . As a result, all reach at least after recursions by .
At the beginning of each phase, the variables , , and are and is called. Throughout the phase, the algorithm updates the values of , , and , appropriately. Moreover, if at least unmatched requests exist (i.e., ), it immediately matches of them.
|
|
|
|
|
|
|
|
We now describe the subroutine . See Algorithm 1 for a formal description. Figure 1 illustrates lower bound of each at each line.
When is called, it is guaranteed that , , for all , for all , and (recall that is the remainder of when divided by , see also Figure 1). The recursion ends (line 3) when equals to or when is at least . Then, it matches all remaining requests and proceeds to the next phase.
At the beginning of each recursion, the algorithm waits until increases by (line 2). Afterward, if for all , it calls (Figure 1). Now, assume that for some . In this case, there exists a smaller interval such that for all (Figure 1). The algorithm picks the smallest such cyclic interval (line 6).
Next, it attempts to change from to by matching requests. To achieve this, it waits to satisfy (see Figure 2) until increases by (line 7). If increases by , then holds for every as we will show later (Figure 1). Consequently, the algorithm calls (line 8). Now, suppose that in at some point. In that case, it changes from to by matching requests (line 9 and see Figure 1).
Then, the algorithm waits until increases by (line 10). We consider two cases: () for all (Figure 1) and () for some (Figure 1). In case (), the algorithm attempts to move from to to call . To do this, the algorithm waits until (see Figure 2) or until increases by (line 12). If increases by , then holds for every as we will show later (Figure 1). Then, it calls (line 18). Otherwise, the algorithm changes from to by matching requests (line 14 and see Figure 1). Consequently, it calls (line 15). In case (), becomes at least for in not a cyclic interval (Figure 1). Then, the algorithm calls (line 18).
After completing the call of recurring, we have for all . Then, the algorithm moves to the next phase.
To analyze the competitive ratio of this algorithm, we present several lemmas. The value of changes continuously within each phase, and its rate of increase over time is given by . The increase rate of for each is illustrated in Figure 3.
We demonstrate that if increases significantly while increases only slightly, then increases significantly during periods when is small.
Lemma 10.
Let and . For two times in the same phase, suppose that and . Then, the increment of in time with and is more than .
Proof.
Let be the index such that . Define and .
Fix . Then, we have either or . If , then . Otherwise (i.e. and ), we have
Thus, in either case, .
Suppose to the contrary that the increment of within is at most . Under this condition, must increase by at least within because . Therefore, we have
where the second inequality holds by for . This contradicts the assumption that . Therefore, the increment of within is more than .
Next, by using Lemma 10, we show that increases by at least except for some small interval after increases by . This indicates that is small in the situation depicted in Figure 1.
Lemma 11.
Let . For two times in the same phase, suppose that . Then, there exist some such that , , and for all .
Proof.
If for all , then the conditions are satisfied by setting . Hence, in what follows, we assume that for some . Define to be the minimum cyclic interval such that for all .
What is left is to show that . Let be the index such that and for . Then, by Lemma 10, the increments of within and are more than , respectively. Since the total increment of is , the intervals and must overlap. Thus, we have (see Figure 4).
Now, we are ready to prove . If , then we have Otherwise (i.e., ), we have
Now, we demonstrate that recurring satisfies desired properties.
Lemma 12.
When is called, the following three conditions are satisfied: for all , for all , and . Moreover, if is called next, it satisfies either (a) and , or (b) and .
Proof.
We prove these by induction.
Initially, when is called at the beginning of a phase, the conditions are satisfied as for all and .
As an induction hypothesis, suppose the conditions are satisfied when is called. Our goal is to show that these conditions continue to be satisfied at the next recursive call. We analyze this based on where the recursive call is made in the conditional branching of Algorithm 1. We denote by the cardinality of .
- If the condition of line 5 is true and is called
- If the condition of line 5 is false
- If the condition of line 8 is true and is called
- If the condition of line 8 is false
- If the condition of line 11 is true
-
In this scenario, at line 13 or at line 15 is called. In both cases, condition (a) is satisfied. In the first case, increases by at line 12, which indicates during the increase. Thus, for any , increases by at least , and (see Figure 1). Then, it calls at line 13. In the second case, is in and the proposed algorithm can match requests, making (see Figure 1). Then, it calls at line 15. These calls satisfy conditions (i) and (iii) in both cases and condition (ii) is satisfied because the condition of line 11 is true.
- If the condition of line 11 is false and is called
-
There exists an index such that increases by less than at line 10 (Figure 1). Let be the index such that . Lemma 10 ensures that increases by more than during . Therefore, for all , also increases by at least . As , we obtain
As , we have and condition (b) is satisfied. Since , conditions (i) and (iii) are satisfied, and by the induction hypothesis, condition (ii) is also satisfied.
We can bound the number of recursions called by the proposed algorithm from Lemma 12, giving us the upper bound of the cost incurred by the proposed algorithm during each phase.
Lemma 13.
The proposed algorithm incurs a cost of per phase.
Proof.
It is not difficult to see that the cost incurred by the algorithm in each recursive call is no more than . Thus, it is sufficient to prove that the number of recursions is at most in each phase.
As our goal is asymptotic evaluation, we may assume that , which implies . By Lemma 12, each call of either increments by or reduces the number of elements in to at most . Recall that the recursion starts with and and ends when or .
Let be the number of elements in after the interval reduction has occurred times. Then, we have , which implies
Thus, the number of elements in the interval after iterations is at most
where the second inequality holds by and the third inequality holds by from the assumption that . Consequently, the number of elements in is reduced to or increases to in at most iterations. Thus, the number of recursive calls is .
Next, we provide a lower bound on the cost incurred by any algorithm during each phase.
Lemma 14.
At the end of a phase, the cost incurred within the phase by any algorithm is at least (if we treat the waiting costs as imposed sequentially at each moment, rather than at the time of matching).
Proof.
Recall that, if unmatched requests are carried over to a phase, the optimum cost incurred thus far within the phase is at least . Thus, it is sufficient to prove that for all at the end of the phase.
The phase ends at line 4. At this point, we have or , according to the condition at line 3. If , then we have , and for all by Lemma 12. Since due to the wait performed at line 2, it follows that for all . Conversely, if , we have for all and for all by Lemma 12. Thus, in either case, we obtain for all at the end of the phase. This proves the lemma.
Based on the lemmas above, we now prove Theorem 8.
Proof of Theorem 8.
Suppose that the proposed algorithm completes phases for the given instance. Then, the cost for the proposed algorithm is at most by Lemma 13, while the cost for any algorithm is at least by Lemma 14. Therefore, the competitive ratio for this instance is at most .
Conversely, suppose that the instance ends during the first phase. If the optimal offline algorithm incurs a cost of at least , then the competitive ratio is at most , as the cost incurred by the proposed algorithm during the first phase is . If the cost incurred by the optimal offline algorithm is less than , then only waiting costs are incurred, as no requests are carried over to the first phase. This means that the total cost of the optimal offline algorithm is equal to . Since the proposed algorithm continues to wait until reaches at line 2, the total cost of the proposed algorithm is also equal to , resulting in a competitive ratio of for such an instance.
Therefore, the proposed algorithm is -competitive.
4.2 Lower Bound
In this subsection, we prove the following lower bound of the competitive ratio.
Theorem 15.
For the OMDSC problem with a penalty function that satisfies , every deterministic online algorithm has a competitive ratio of .
Recall that is a positive real such that . We fix an arbitrary online algorithm and construct an adversarial instance according to the behavior of , denoted as . The instance is composed of rounds. To construct , we introduce variables similar to Definition 9.
Definition 16.
For the instance and time , the variables , , and are defined as follows:
-
: the waiting cost incurred by time for an algorithm that initially matches requests (i.e, leaving requests) at time and subsequently performs matches of size immediately for every unmatched requests accumulated.
-
: the number of requests given by time .
-
: the number of requests matched by up to, but not including, time .
We will omit the argument when there is no confusion.
The instance contains requests with arrival time at . For and any , there exists an offline algorithm that incurs a cost of at most , where is the time when the last requests are given in . This can be achieved by matching requests at time , greedily matching a multiple of requests in the middle, and matching all the remaining requests at time . For each round , the starting time is , and there is a (non-empty) cyclic interval such that for every . As rounds progress, the interval is gradually narrowed, and incurs a cost of per round. The instance consists of rounds. This implies that while there exists an offline algorithm with a cost of , incurs a cost of , indicating that the competitive ratio of is .
Initially, the instance gives requests at time (i.e. and ). Let be the variable that indicates the round, initialized to . Define , , and .
For the th round (), if , set to be and finalize the instance. Otherwise, the round continues until time . Requests in round are provided at time based on the number of remaining requests immediately before time (i.e., ).
Let be . If , then set to be and give no requests. Otherwise, let , and give requests so that at time (see Figure 5). Then, increase round count by and proceed to the next round.
This instance ensures that (i) , (ii) for all , and (iii) and .
Now, we show a lemma that establishes a lower bound on the number of elements in a cyclic interval where the increment of in the interval is at most times the increment of for specific .
Lemma 17.
For a cyclic interval , let and . Suppose that and . Then, for any and , the increment of is at most times the increment of in the state where .
Proof.
Figure 6 depicts the increment rates and . By the assumption that and , we have
(1) |
Therefore, for any and , we get
where the third inequality follows from (1). Since the rate of increase is constant while , the increment of is at most times the increment of .
By using this lemma, we bound the number of elements in after rounds from below and bound the values of for all from above.
Lemma 18.
Let and suppose that . At time , the following three conditions are satisfied: (i) , (ii) for all , and (iii) and .
Proof.
We prove this by induction on .
At time , we have , and for all . In addition, we have and . Thus, conditions (i), (ii), and (iii) are satisfied.
Let . Suppose that conditions (i), (ii), and (iii) are satisfied for . We show that these conditions are also satisfied for .
Recall that . Then, there are two cases where is set to be or . In both cases, we prove the inductive step by using Lemma 17. Note that , and in both cases by the definition of the procedure. Thus, the condition (iii) is met. By the induction hypothesis, we have and . Also, as , we have . Thus, we have
Also, we have
where the second inequality holds by and the third inequality holds by . Thus, the condition (i) is satisfied in both cases. Moreover, we have
because and (see Figure 6). Thus, the increment of is less than for all by Lemma 17 with setting and . Therefore, combining with the induction hypothesis, we obtain for all . This means that the condition (ii) is satisfied.
Therefore, the conditions (i), (ii), and (iii) are satisfied for . This completes the proof by induction.
In what follows, we bound the cost incurred by any online algorithm on is at least and the cost for the optimal offline algorithm on is at most a constant. As our goal is asymptotic evaluation, we assume that in the following.
Lemma 19.
The number of rounds is .
Proof.
For , let . From Lemma 18, we have . By the termination condition, we have and . As , we have . In addition, as , we have . Therefore, we obtain , and hence .
From Lemma 19, we can prove the following lemmas.
Lemma 20.
For any deterministic online algorithm , there exists an offline algorithm that incurs a cost of at most a constant for the instance .
Proof.
Let be an arbitrary element in . Consider the algorithm that initially matches requests at time , subsequently performs matches of size immediately for every unmatched requests accumulated, and finally matches all the remaining unmatched requests at . Then, the total waiting cost of this algorithm is at most by Lemmas 18 and 19. Moreover, the total size cost is at most , as it matches at most twice with sets of requests of size not a multiple of . Therefore, The total cost incurred by this algorithm is at most .
Lemma 21.
for any deterministic online algorithm .
Proof.
For the th round, we divide into two cases in which matches a non-multiple of requests during a period or not. If matches a non-multiple of requests, it incurs a size cost of . Otherwise, for all , leading to that the increment of during is because and its increase rate is . In both cases, the algorithm incurs at least a cost of in each round.
Therefore, the total cost incurred over the instance is at least by Lemma 19.
Now, we are ready to prove Theorem 15.
Proof of Theorem 15.
References
- [1] Yossi Azar, Ashish Chiplunkar, and Haim Kaplan. Polylogarithmic bounds on the competitiveness of min-cost perfect matching with delays. In Proceedings of the 2017 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA 2017), pages 1051–1061, 2017. doi:10.1137/1.9781611974782.67.
- [2] Yossi Azar, Ashish Chiplunkar, Shay Kutten, and Noam Touitou. Set cover with delay – Clairvoyance is not required. In Proceedings of the 28th Annual European Symposium on Algorithms (ESA 2020), pages 8:1–8:21, 2020. doi:10.4230/LIPIcs.ESA.2020.8.
- [3] Yossi Azar and Amit Jacob Fanani. Deterministic min-cost matching with delays. Theory Comput. Syst., 64(4):572–592, 2020. doi:10.1007/s00224-019-09963-7.
- [4] Yossi Azar, Runtian Ren, and Danny Vainstein. The min-cost matching with concave delays problem. In Proceedings of the 2021 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA 2021), pages 301–320, 2021. doi:10.1137/1.9781611976465.20.
- [5] Yossi Azar and Noam Touitou. General framework for metric optimization problems with delay or with deadlines. In Proceedings of the 2019 IEEE 60th Annual Symposium on Foundations of Computer Science (FOCS 2019), pages 60–71, 2019. doi:10.1109/FOCS.2019.00013.
- [6] Marcin Bienkowski, Martin Böhm, Jaroslaw Byrka, Marek Chrobak, Christoph Dürr, Luk’avs Folwarczn’y, Lukasz Jez, Jiri Sgall, Kim Thang Nguyen, and Pavel Veselý. Online algorithms for multi-level aggregation. In Proceedings of the 24th Annual European Symposium on Algorithms (ESA 2016), pages 12:1–12:17, 2016. doi:10.4230/LIPIcs.ESA.2016.12.
- [7] Marcin Bienkowski, Jaroslaw Byrka, Marek Chrobak, Lukasz Jez, Dorian Nogneng, and Jirí Sgall. Better approximation bounds for the joint replenishment problem. In Proceedings of the 2014 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA 2014), pages 42–54, 2014. doi:10.1137/1.9781611973402.4.
- [8] Marcin Bienkowski, Artur Kraska, Hsiang-Hsuan Liu, and Pawel Schmidt. A primal-dual online deterministic algorithm for matching with delays. In Proceedings of the 16th Workshop on Approximation and Online Algorithms (WAOA 2018), pages 51–68, 2018. doi:10.1007/978-3-030-04693-4_4.
- [9] Niv Buchbinder, Moran Feldman, Joseph S. Naor, and Ohad Talmon. depth-competitive algorithm for online multi-level aggregation. In Proceedings of the 2017 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA 2017), pages 1235–1244, 2017. doi:10.1137/1.9781611974782.80.
- [10] Niv Buchbinder, Tracy Kimbrel, Retsef Levi, Konstantin Makarychev, and Maxim Sviridenko. Online make-to-order joint replenishment model: Primal-dual competitive algorithms. Oper. Res., 61(4):1014–1029, 2013. doi:10.1287/opre.2013.1188.
- [11] Rodrigo A. Carrasco, Kirk Pruhs, Cliff Stein, and José Verschae. The online set aggregation problem. In Proceedings of the 13th Latin American Symposium on Theoretical Informatics (LATIN 2018), pages 245–259, 2018. doi:10.1007/978-3-319-77404-6_19.
- [12] Ryder Chen, Jahanvi Khatkar, and Seeun William Umboh. Online weighted cardinality joint replenishment problem with delay. In Proceedings of the 49th International Colloquium on Automata, Languages, and Programming (ICALP 2022), pages 40:1–40:18, 2022. doi:10.4230/LIPIcs.ICALP.2022.40.
- [13] Lindsey Deryckere and Seeun William Umboh. Online matching with set and concave delays. In Proceedings of the Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques (APPROX/RANDOM 2023), pages 17:1–17:17, 2023. doi:10.4230/LIPIcs.APPROX/RANDOM.2023.17.
- [14] Daniel R. Dooly, Sally A. Goldman, and Stephen D. Scott. On-line analysis of the TCP acknowledgment delay problem. J. ACM, 48(2):243–273, 2001. doi:10.1145/375827.375843.
- [15] Federico Echenique, Nicole Immorlica, and Vijay V. Vazirani. Online and Matching-Based Market Design. Cambridge University Press, 2023. doi:10.1017/9781108937535.
- [16] Yuval Emek, Shay Kutten, and Roger Wattenhofer. Online matching: Haste makes waste! In Proceedings of the Forty-Eighth Annual ACM Symposium on Theory of Computing (STOC 2016), pages 333–344, 2016. doi:10.1145/2897518.2897557.
- [17] Yuval Emek, Yaacov Shapiro, and Yuyi Wang. Minimum cost perfect matching with delays for two sources. Theor. Comput. Sci., 754:122–129, 2019. doi:10.1016/j.tcs.2018.07.004.
- [18] Kun He, Sizhe Li, Enze Sun, Yuyi Wang, Roger Wattenhofer, and Weihao Zhu. Randomized algorithm for MPMD on two sources. In Proceedings of the 19th Conference On Web And InterNet Economics (WINE 2023), pages 348–365, 2023. doi:10.1007/978-3-031-48974-7_20.
- [19] Naonori Kakimura and Tomohiro Nakayoshi. Deterministic primal-dual algorithms for online k-way matching with delays. In Proceedings of the 29th International Computing and Combinatorics Conference (COCOON 2023), pages 238–249, 2023. doi:10.1007/978-3-031-49193-1_18.
- [20] Anna R. Karlin, Claire Kenyon, and Dana Randall. Dynamic TCP acknowledgement and other stories about . In Proceedings of the 33rd Annual ACM Symposium on Theory of Computing (STOC 2001), pages 502–509, 2001. doi:10.1145/380752.380845.
- [21] Richard M. Karp, Umesh V. Vazirani, and Vijay V. Vazirani. An optimal algorithm for on-line bipartite matching. In Proceedings of the 22nd Annual ACM Symposium on Theory of Computing (STOC 1990), pages 352–358, 1990. doi:10.1145/100216.100262.
- [22] Yasushi Kawase and Tomohiro Nakayoshi. Online matching with delays and size-based costs. arXiv:2408.08658, 2024. doi:10.48550/arXiv.2408.08658.
- [23] Xingwu Liu, Zhida Pan, Yuyi Wang, and Roger Wattenhofer. Impatient online matching. In Proceedings of the 29th International Symposium on Algorithms and Computation (ISAAC 2018), pages 62:1–62:12, 2018. doi:10.4230/LIPIcs.ISAAC.2018.62.
- [24] Xingwu Liu, Zhida Pan, Yuyi Wang, and Roger Wattenhofer. Online matching with convex delay costs. arXiv:2203.03335, 2022. doi:10.48550/arXiv.2203.03335.
- [25] Aranyak Mehta. Online matching and ad allocation. Found. Trends Theor. Comput. Sci., 8(4):265–368, 2013. doi:10.1561/0400000057.
- [26] Aranyak Mehta, Amin Saberi, Umesh V. Vazirani, and Vijay V. Vazirani. AdWords and generalized online matching. J. ACM, 54(5):22:1–22:19, 2007. doi:10.1145/1284320.1284321.
- [27] Darya Melnyk, Yuyi Wang, and Roger Wattenhofer. Online -way matching with delays and the -metric. arXiv:2109.06640, 2021. doi:10.48550/arXiv.2109.06640.
- [28] Marco Pavone, Amin Saberi, Maximilian Schiffer, and Matthew W. Tsao. Technical note—online hypergraph matching with delays. Oper. Res., 70(4):2194–2212, 2022. doi:10.1287/opre.2022.2277.
- [29] Noam Touitou. Nearly-tight lower bounds for set cover and network design with deadlines/delay. In Proceedings of the 32nd International Symposium on Algorithms and Computation (ISAAC 2021), pages 53:1–53:16, 2021. doi:10.4230/LIPIcs.ISAAC.2021.53.