key: cord-0217951-axtdvsz4 authors: Delong, Steven; Farhadi, Alireza; Niazadeh, Rad; Sivan, Balasubramanian title: Online Bipartite Matching with Reusable Resources date: 2021-10-13 journal: nan DOI: nan sha: d744e4932416a89f3f5f3d281aa463466a934ae5 doc_id: 217951 cord_uid: axtdvsz4 We study the classic online bipartite matching problem with a twist: offline nodes are reusable any number of times. Every offline node $i$ becomes available $d$ steps after it was assigned to. Nothing better than a $0.5$-approximation, obtained by the trivial deterministic greedy algorithm, was known for this problem. We give the first approximation factor beating $0.5$, namely a $0.505$ approximation, by suitably adapting and interpreting the powerful technique of Online Correlated Selection. A central task of a two-sided online marketplaces is to match demand to supply. In several applications, the supply is available at the beginning of the decision making horizon-or equivalently, it is "offline"-while the demand arrives sequentially-or equivalently, it is "online". The queen of killer examples for this scenario is in sponsored search, where a market algorithm (for example Google Adwords) decides how to match the arriving search queries to advertisers who are willing to show their ads for that particular arriving query. As an important feature of this example, once a query is matched to an advertiser, the consumed budget of that advertiser is gone; in other words, it cannot be reused in the remaining decision making horizon. In contrast to the above applications, there are two-sided online marketplaces where the planner aims to match the arriving demand to rental resources-instead of available non-reusable supply. Examples are virtual machines in cloud computing platforms such as AWS, houses in vacation rental online marketplaces such as Airbnb, and local professional services in online labor platforms such as Thumbtack. Rental resources are also prevalent in even more traditional application domains. One example is in a city hospital where medical resources need to be managed properly. The hospital should allocate its scarce medical resources related to various treatments to patients as they arrive and demand for different treatments-resources that will be released to be used again after the patient is recovered (or unfortunately is deceased). This service operation was particularly important in early stages of the COVID-19 pandemic, in which hospitals needed to carefully manage the allocation of their beds, ventilators, and ICU units to new arriving COVID patients. A common theme in all of the above applications is that the planner's algorithm sequentially matches arriving requests to available compatible resources, where a resource is considered available only if it is not under rental at the time of the request. The main focus of this paper is to design and analyze such algorithms with the goal of matching as many demand requests as possible. The online bipartite matching problem, originated from the seminal work of Karp, Vazirani and Vazirani (1990) , is a prominent model to capture a special case where the offline resources can be only used once. Motivated by the rental applications, we revisit this classic problem by considering a variation where offline vertices are reusable, that is, once an offline vertex is used in the matching, it will be released to be reused after a certain duration of time, that can be different for different resources. We refer to this problem as the online bipartite matching with reusable resources (OBMRR). This basic model was first introduced in [25] -together with its generalization to online assortment planning. Later it was studied more extensively in [19] under deterministic rental durations and in [26, 27] under stochastic i.i.d. rental durations-but only in the regime where resources have large capacities (or equivalently fractional allocations are allowed). Problem Formulation Formally, an instance of the OBMRR problem consists of a bipartite graph G = (V, U ; E), where V is the offline side, U is the online side, and E is the set of edges. V represents the set of reusable resources and U represents the set of arriving (demand) requests. Also, an edge (i, j) ∈ E says that resource i can be assigned to request j. Vertices in U arrive online over discrete time j = 1, 2, . . . , |U |, and reveal their incident edges to vertices in V upon arrival. Once offline vertex i is matched to an arriving online vertex j, it remains unavailable for the next d − 1 (d is a known parameter) periods and will be available for re-allocation upon arrival of online vertex j + d. We consider online algorithms that irrevocably match the arriving online vertex at each time to one of the available offline neighbours (or refuse to match that online vertex). The goal is to maximize the total number of matched online vertices at the end, which we also refer to as the size of the final matching. 1 As is common in the literature on online algorithms, we compare our algorithm to the optimal offline algorithm that has the complete knowledge of G. We say that an algorithm is Γ-competitive for Γ ∈ [0, 1] if for every instance of the problem the expected size of the matching returned by the algorithm is at least Γ times the size of the matching produced by the optimal offline solution. We refer to Γ as the competitive ratio. Important to recall, what makes our problem substantially different from the setting in [35] is that each resource i is unavailable at time j only if it has been matched at some time j ′ ∈ [j − d + 1, j − 1]. In fact, the non-reusable online bipartite matching problem is a special case when d = |U |. We should also remark that in this paper we are interested in integral online matching algorithms under reusable resources. In contrast to fractional online algorithms that can divide the arriving online vertex and allocate it fractionally to offline vertices, we force the online algorithm-which can be randomized-to match the arriving online vertex in full to an offline vertex or just leave it unmatched. We do not assume offline vertices have large budgets; instead we assume each offline vertex's budget exactly equals to 1 as in the classic online bipartite matching problem-mostly to capture scenarios in practice where the reusable resources have small initial inventories such as in the AirBnB or Thumbtack applications mentioned earlier in the introduction. This is in contrast to prior work [19, 26, 27] which either consider fractional allocations or the equivalent formulation that asks for integral allocations but with large budgets. Main Contributions Any greedy algorithm always matches as many as half of the online vertices matched by the optimum offline solution. 2 No deterministic integral algorithm can beat this 0.5 competitive ratio, which is even true in the special case of non-reusable resources. In this special case, the elegant RANKING algorithm in [35] uses a randomized (negatively) correlated tie breaking rule for greedy matching through one uniform random permutation over offline vertices; the resulting structured correlation improves the competitive ratio from 0.5 to the optimal (1 − 1/e). At the same time, [19] considers the fractional OBMRR problem and shows an adaptation of the classic BALANCE algorithm-introduced first in [34] for the non-reusable online bipartite b-matching and later generalized to the Adwords problem in [41] -obtains the optimal (1 − 1/e) competitive ratio. This progress leaves the open question of what would be the optimal competitive ratio achievable by an integral online algorithm for reusable resources. In this paper, we take a first step towards answering this open question by studying the simpler yet fundamental question below: Does there exist an integral (randomized) online algorithm that can beat the vanilla greedy algorithm? In other words, can we obtain a constant competitive ratio Γ that is strictly better than 0.5 by an integral (randomized) online algorithm? Our main result answers the above question in affirmative. More precisely, we design and analyze a randomized yet integral online algorithm that is 0.505 competitive for The above progress is particularly important, as it shows 0.5 is not a barrier for competitive ratio in the case of online bipartite matching with reusable resources. It also resonates well with other recent work on edge-weighted online bipartite matching with free-disposal [14] and Adwords [32] , in which a similar paradigm is observed: it has been known for some time how to obtain the optimal (1 − 1/e) competitive ratio using fractional allocations in these problem, but it was not known a priori whether there exists an integral randomized algorithm that admits a constant improvement over 0.5. Our results also resemble other line of work on variants of online bipartite matching with different input semantics-e.g., the fully online bipartite matching [29] and the general vertex-arrival online bipartite matching [22] : it has been known that the greedy algorithm is again 0.5-competitive in these problems, but it was not clear a priori whether any improvement is possible; nevertheless, these works demonstrate that barrier 0.5 for competitive ratio can be overcome by proper usage of randomization. 3 Our result is obtained by using a novel randomized online algorithm which is primal-dual and has a specific two-layer architecture: an outer layer algorithm and an inner selection procedure. The design of the outer layer algorithm relies on technically subtle primal-dual ideas that at surface level share similarities with the existing primal-dual proofs in the literature (e.g., [9] ), yet adapted to handle reusable resources under no free-disposal assumption. More interestingly, for the inner layer, we introduce a new randomized selection problem that we refer to as the online correlated rental (OCR). Our OCR problem is indeed an artifact of a unified interpretation and a simpler proof of prior work [14, 32] , which introduces a powerful technique known as the online correlated selection (OCS) for resources that are non-reusable and can be matched multiple times-but contribute to the objective only once (due to free-disposal); This unified interpretation is the key to extend the existing machinery to the matching case with reusable resources. We then solve this new problem and use its solution at the heart of the inner layer of our final algorithm. We should remark that the primal-dual two-layer architecture of our algorithm, together with our OCR procedure, are what really distinguish our approach from known optimal competitive algorithms for the fractional version of OBMRR, which are variants of the BALANCE algorithm and primal-dual ideas are merely used in their analysis. Below, we sketch high-level approaches for the design and analysis of both outer and inner layers in this final algorithm. Overview of our Techniques Our proposed algorithm is an online primal-dual algorithm, meaning that it maintains a feasible primal and an infeasible dual assignment as online vertices arrive for a natural linear programming (LP) relaxation of the problem. This LP relaxation is basically the linear program of the maximum cardinality matching in G, but rather than ensuring each offline vertex is only matched once (non-reusable), it ensures that each offline vertex i is only matched once during any time interval of length d (reusable); see Section 3.1 for details. 4 In our dual construction, (i) the resulting dual assignment is randomized and gets updated each time a new online vertex arrives and the algorithm makes a new matching decision, (ii) the change in the dual objective at each time equals that of the primal objective, and (iii) the dual assignment only becomes approximately feasible in-expectation at the end. This style of dual-fitting is motivated in part by the primal-dual proof of RANKING in [9] . Upon the arrival of an online vertex, we use two algorithms in sequence to select its offline match. First, the outer algorithm uses the current dual assignment of offline vertices to suggest either one or two of these offline vertices as potential matches. Note that the outer algorithm ignores the availability of its suggested vertices. When this algorithm suggests a single vertex, we call it a deterministic query, and the vertex is matched if it is available. However, when two vertices are suggested, we refer to the suggestion as a randomized query, and the inner randomized algorithm is then executed to select which one to match. This is inspired by a similar idea in [14] , where the online integral algorithm pushes its allocation towards more fractional allocations by suggesting two choices rather than one. 5 One simple candidate for the inner algorithm mentioned above is selecting one of the two vertices independently with probability ½. It can be shown that this approach fails to improve over 0.5-competitive. To make an improvement, intuitively, the goals are: (i) Ensuring that a matched resource i is not used in the next d − 1 time units and hence the final matching decisions are feasible given the reusability of the resources, (ii) For each resource i, making sure that its allocation decisions in rounds that can potentially affect each other (i.e., rounds with distance at most d − 1) are negatively correlated; in other words, if this vertex is suggested and not chosen in round j, it will become more likely to be chosen if suggested again in the next d − 1 rounds, and vice versa. The instrumental new technical ingredient of our algorithm is the randomized OCR procedure that handles the aforementioned conflicts among the reusable resources suggested by the outer algorithm over time, in a way that it satisfies both properties (i) and (ii) above. In order to design an appropriate OCR procedure, we first formalize the intuitive "negative correlation criteria" in property (ii) for the online matching of reusable resources. On the way to formalizing this intuition, we obtain a new interpretation of the OCS procedure for non-reusable resources, which can be extended to the reusable setting. Consider an offline vertex i, and suppose its probability of being available at time j is p i j . If vertex i is suggested by the outer algorithm in a deterministic query, it will increase the expected size of the matching by p i j . If the vertex i is one of two vertices suggested by the outer algorithm in a randomized query, we can increase the expected size of the matching including i by p i j /2 if we use a uniform random allocation (with no correlation) to select between the two. Note that the other proposed vertex will also contribute. The idea behind our OCR procedure (Algorithm 1) is to add a communication across different rounds of this inner selection so that a vertex that is less likely to be selected (although available) at some time is slightly more likely to be available in future related rounds and vice versa. This communication should also happen in an almost symmetric fashion, so that we can maintain a default lower-bound on the increase in the expected size of the matching as if the decisions were made uniformly at random and independently over time. The exact implementation of this communication can be thought of as leaving probabilistic temporary messages on offline vertices recording their previous selection decisions. If an offline vertex i is queried at time j and is selected, we will occasionally tag it with this outcome for the next d − 1 rounds. Should it be suggested again in this window of time, it will be less likely to be selected. Likewise, an offline vertex i ′ which is suggested but not selected will have a chance to be tagged with a message making it more likely to be selected in the next d − 1 rounds. As long as this successful message-passing happens with a constant probability, the resulting OCR algorithm will satisfy our desired guarantee. Given the above mentioned type of guarantees by the OCR procedure, and the way that our outer algorithm picks its suggested pair of resources, we develop our primal-dual analysis framework. In fact, this primal-dual analysis is tightly related to the design of the primal-dual algorithm itself, and follows a similar logic as the recent primal-dual techniques in [32] and [14] . We end up with identifying constraints that should be satisfied by our competitive ratio Γ and our dual assignments in order to guarantee approximate dual feasibility. We finish the analysis by setting up a factor revealing linear program that maximizes Γ given these constraints, and find the optimal solution (up to any desired precision) by appropriate discretization and running a computer program. Further Related Work Except the mentioned works about OCS, there are very recent works on improving this technique [5, 23] . Our work relates to and contributes to several streams of literature. Online bipartite allocations. Our results fit into the rich literature on online bipartite matching (with vertex arrival) and its extensions. Besides the work mentioned earlier, related to us is Aggarwal et al. [1] that generalizes the classic RANKING algorithm of [35] to the setting where offline vertices are weighted. Another line of work closely related to our problem is on online assortment optimization with non-reusable resources [e.g., 24, 37] and reusable resources [e.g., 25, 19, 28] in the adversarial setting, in which the online algorithm decides on subsets of resources to display to an adversarial stream of arriving consumers. Several of these work consider analyzing the "inventory balancing" algorithm or some variant of it using primal-dual-which are all inspired by the BALANCE algorithm and its analysis in the seminal work of [41] for the Adwords problem. Primal-dual framework. In connection to our primal-dual methodology, besides the earlier mentioned papers on OCS for non-reusable matching, [9] has partially inspired our approach. More specifically, our randomized dual-fitting analysis borrows some aspect of the elegant randomized primal-dual analysis of RANKING (and its extensions) discovered in [9] . An economic-based interpretation of this primal-dual analysis is also studied recently in [12] . At high-level, our primal-dual analysis bares some resemblance with the primal-dual framework in the Adwords problem [6, 41] , online fractional matching with free-disposal [16] , the online bipartite matching with concave returns on the offline nodes [8] , and the modified primal-dual framework for Adwords with random permutations [7] . Our dual-fitting style of analysis shares similarities with [13, 30] . Another related recent line of work is on multi-stage bipartite allocations and matchings, where similar-inspirit primal-dual analysis frameworks are discovered using ideas from convex programming duality, e.g., [36, 18, 21] . Other models. Some other problems that are indirectly related to us are (i) online bipartite stochastic matching [e.g., 17, 4, 39, 42, 33] , (ii) online bipartite matching with stochastic rewards [e.g., 40, 28, 31] and (iii) online prophet inequality matching, with or without reusable resources [e.g., 3, 19, 11, 20, 38] . Finally, marginally related to us in terms of modeling is also the rich literature on stochastic i.i.d. online packing LP and convex programming with large budgets [e.g., 15, 10, 2]. Organization In Section 2, we present the online correlated rental problem with adversarial queries. We present our first OCR algorithm in Section 2.1 and and prove its OCR guarantee. We then present our OCR-based primal-dual framework in Section 3.2. We start by formalizing the LP relaxation in Section 3.1. We then describe primal-dual algorithm for the OBMRR problem in Section 3.2 with the construction of the dual variables, and we finally show how the OCR guarantee helps with the final primal-dual proof in Section 3.3. In this section we describe Online Correlated Rental (OCR). Let Q 1 , Q 2 , · · · , Q |U | be the sequence of suggestions made by the outer algorithm where the outer algorithm suggests (proposes) Q j to the inner algorithm at the time j, and each Q j contains one or two offline vertices. Upon arrival of each Q j , the OCR algorithm -which acts as the inner algorithm -has to choose one offline vertex i ∈ Q j . The outer algorithm then adds i to the matching if i is available at the time j. Consider an online algorithm that selects one of the vertices in Q j uniformly at random. We first analyse the expected size of the matching returned by this algorithm. We say that round j is deterministic if |Q j | = 1, and randomized if |Q j | = 2. Considering an offline vertex i, and let ∆µ i j be the probability that i is matched at the round j. If i / ∈ Q j , it is clear that the online algorithm will not select i, and we have ∆µ i j = 0. Now consider a round j where i ∈ Q j . Since the online algorithm selects one of the vertices in Q j uniformly at random, the algorithm selects i with the probability of 1/2 if round j is a randomized round and 1 if it is a deterministic round. Although the algorithm picks i with the probability of at least 1/2, it does not necessarily imply that ∆µ i j ≥ 1/2. The reason it that vertex i might be matched in the time interval of [j −d+1, j −1], and consequently not be available at the time j. We claim that the probability that i is matched Claim 2.1. For any time j and any offline vertex i, the probability that i is matched in the time Proof. Let X i t be a random variable which is 1 if i is matched at the round t and is 0 otherwise. Therefore, we are looking for the following probability. Note that upon matching i at a time t, vertex i will not be available before the time t+d. Therefore, vertex i can be matched at most once in [j − d + 1, j − 1], and events X i t 's are mutually exclusive. We then have, Note that by the definition we have ∆µ i t = Pr[X i t ], which implies the claim. By the claim above the probability that vertex i is available upon arrival of Q j is 1 − to be the probability that i is available at the time j. In the online algorithm that we described, the decision of the algorithm in the round j is independent of its decisions in the previous rounds. Thus, we have ∆µ i j = Pr[i gets selected at the round j] · p i j . Therefore, In OCR, the goal is to outperform this simple randomized algorithm which selects one of the vertices in Q j uniformly at random, by introducing some negative correlations between the decisions of the randomized rounds. Specifically, OCR guarantees that if vertex i was in Q j and it was not picked by OCR, then vertex i should have a slightly better chance to get selected next time that the outer algorithm proposes i to the OCR. Given the sequence Q 1 , Q 2 , · · · , Q |U | , we use prev i j to denote the previous occurrence of the offline vertex i among the Q j 's before the time step j. Specifically, prev i j is the largest index j ′ < j such that i ∈ Q j ′ . We also define prev i j to be −∞ if vertex i has not appeared in any of Q 1 , Q 2 , · · · , Q j−1 . We are now ready to give a formal definition of OCR. Definition 2.2 (γ-OCR). An algorithm is γ-OCR for a 0 ≤ γ ≤ 1, if every round j and every offline vertex i the following holds. where in the equation above j ′ = prev i j and ∆µ i j denotes the probability that i gets picked at matched at the round j. Note that in the definition above the term p i j ′ − ∆µ i j ′ is the probability that i was available at the time j ′ but it was not picked by OCR. It is easy to verify that the algorithm that selects one of the vertices in Q j uniformly at random is 0-OCR. Therefore, the main challenge is to show the existence an OCR algorithm for a γ > 0. In the remaining of this section we show the existence of an 1/32-OCR online algorithm. Lemma 2.3. There exists an 1/32-OCR online algorithm. Algorithm 1 presents our 1/32−OCR algorithm. The algorithm maintains a state variable τ i,j for every offline vertex i and time j. Let j ′ = prev i j , if τ i,j is either selected or not-selected it means that the result of Q j ′ can be used at the time j to give us a negative correlation. Otherwise, if τ i,j is unknown, it means that we can not use the result of the last occurrence of i. In Algorithm 1, with a slight abuse of notation we use τ i,[l,r] to denote all state variables τ i,l , τ i,l+1 , · · · , τ i,r . Suppose that the algorithm receives a pair Q j = {i 1 , i 2 } at the time j. Then the algorithm decides to be a receiver or sender at this round uniformly at random with the probability of 1/2. In a sender round, the algorithm uses a fresh random bit to select i ℓ where ℓ ∈ {1, 2} is chosen uniformly at random. Algorithm also uses a new random bit to select m ∈ {1, 2} at random. The algorithm then uses state variables τ im,[j+1,j+d−1] to reflect whether we have selected i m in this round. Specifically, we set state variables τ im,[j+1,j+d−1] to be selected if ℓ = m and we set τ im,[j+1,j+d−1] to be not-selected otherwise. We also reset the state variables for im by setting τ i −m ,[j+1,j+d−1] to be unknown wherem is an abbreviation for 3 − m. Remark that in a sender Let assume Q j = {i 1 }. τ i 1 ,[j+1,j+d−1] = unknown. Select i 1 . 6: else 7: Let assume Q j = {i 1 , i 2 }. With the probability of 1/2, round j is a sender: Draw ℓ, m ∈ {1, 2} uniformly at random. τ im,[j+1,j+d−1] = not-selected. With the probability of 1/2, round j is a receiver: 16: Draw m ∈ {1, 2} uniformly at random. 17: if τ im,j = selected then Draw ℓ ∈ {1, 2} uniformly at random. 23 : round, we only change the state variables for the next d − 1 rounds. Therefore, the decision of the algorithm in a sender round can only affect the next d − 1 rounds. In a receiver round, the OCR uses the state variables that have been set in previous rounds. The algorithm chooses m ∈ {1, 2} uniformly at random and uses the state variables of vertex i m to provide a negative correlation. Consider the case τ im,j is not-selected. This means that the OCR did not pick i m the previous time this vertex was proposed to the algorithm. In this case, the algorithm selects i m for the round j. When τ im,j is selected, the case is similar and the algorithm selects im at this round. When τ im,j is unknown, the algorithm selects ℓ ∈ {0, 1} uniformly at random, and selects i ℓ at this round. At the end of a receiver round the algorithm resets the state variables for the future rounds by setting τ i 1 ,[j+1,j+d−1] and τ i 2 ,[j+1,j+d−1] to be unknown. What we have discussed so far was our OCR algorithm for randomized rounds. Consider a deterministic round and suppose that the algorithm receives Q j = {i 1 }. In this case the algorithm selects i 1 , and resets the state variables of i 1 for the future rounds by setting τ i 1 ,[j+1,j+d−1] to be unknown. We know show that Algorithm 1 is 1/32-OCR. Our analysis relies on a simple fact. Let µ i (Q 1 , Q 2 , · · · , Q |U | ) be expected the number of times that the algorithm matches vertex i when it receives sequence of vertices Q 1 , Q 2 , · · · , Q |U | . We show that we always have µ i (Q 1 , Q 2 , · · · , Q |U | ) = µ i (Q |U | , Q |U |−1 , · · · , Q 1 ). This fact shows that if Algorithm 1 receives the sets Q 1 , Q 2 , · · · , Q |U | in the reversed order, it matches every offline vertex the same number times in expectation. For the simplicity of the presentation, we use Q [l,r] as an abbreviation for the sequence Q l , Q l+1 , · · · , Q r when l ≤ r, and for the sequence Q l , Q l−1 , · · · , Q r when l > r. Claim 2.4. For any sets of proposed vertices Q 1 , Q 2 , · · · , Q ℓ , and every offline vertex i the following holds. Before proving the claim above, we have to define the dependency graph. Dependency Graph. Let Q 1 , Q 2 , · · · , Q ℓ be the sequence of the sets proposed by the outer algorithm, we define the dependency graph G = (V, E) as follow. In the dependency graph G we have a vertex for every set Q j , i.e., V = Q j : j ∈ [ℓ] . Also, for every offline vertex i we have an edge (Q j , Q j ′ ) i between two sets Q j and Q j ′ if both Q j and Q j ′ are randomized rounds, i ∈ Q j , Q j ′ , and i is not in any set proposed to the algorithm between the times j and j ′ . We use subscript i in the edge (Q j , Q j ′ ) i to distinguish parallel edges. Consider an edge (Q j , Q j ′ ) i in the dependency graph, and by symmetry assume that Q j is proposed to OCR algorithm before Q j ′ . In this case the decision of OCR for rounds Q j and Q j ′ is perfectly negatively correlated, and it selects i in exactly one of Q j or Q j ′ if (i) round Q j is a sender round, (ii) OCR selects i m = i in round Q j , (iii) round Q j ′ is a receiver round, (iv) OCR selects i m = i in round Q j ′ . However, this perfect negative correlation is not always guaranteed, and conditions (i)-(iv) should all be met to have a negative correlation. In this case, we say edge (Q j , Q j ′ ) i is realized and is in the realized dependency graph. For each edge (Q j , Q j ′ ) i in the dependency graph, there is a probability of 1/16 that this edge gets realized in the realized dependency graph. The reason is that OCR satisfies conditions (i)-(iv) each with the probability of 1/2. Moreover, it is easy to verify that every vertex in the realized dependency graph have at most one realized edge. Consider a sender round Q j , and let i m = i be the vertex selected by OCR in order to provide a negative correlation. In this case the corresponding vertex of Q j in the realized dependency graph can have at most one edge in the form of (Q j , Q j ′ ) i where Q j ′ is the next time that vertex i is proposed to the algorithm. We can use a similar argument to show that every receiver round has at most one realized edge as well. Therefore, every vertex has a degree of at most one in the realized dependency graph, i.e., realized edges form a matching between vertices of the dependency graph. We are now ready to prove Claim 2.4. Proof. [Proof of Claim 2.4] We call the input sequence Q 1 , Q 2 , · · · , Q ℓ the forward sequence, and the input sequence Q ℓ , Q ℓ−1 , · · · , Q 1 the backward sequence. For any offline vertex i we show that expected number of times the algorithm matches i in the forward and backward sequence is the same. Let X = X 1 , X 2 , · · · , X ℓ be random variables where X j is 1 when OCR selects i when it receives Q j in the forward sequence, and is 0 otherwise. Similarly, let Y = Y 1 , Y 2 , · · · , Y ℓ be random variables where Y j indicates whether OCR has selected i when it receives Q j (at the time ℓ − j + 1) in the backward sequence. In order to prove the claim we show that the joint distribution of X random variables is the same as Y random variables. In other words, let b ∈ {0, 1} ℓ be any binary vector of length |U |, we show the following. We first show how (2) directly implies Claim 2.4. Let µ ⊲ and µ ⊳ be random variables which indicate the number of times the algorithm matches i in the forward and backward sequences respectively. Consider a vector b ∈ {0, 1} ℓ , assuming (2), X and Y are equal to b with the same probability. We first show that if the X and Y are both equal to a vector b, then the algorithm matches vertex i exactly the same number of times in forward and backward sequences. In specific we show the following. Recall that for an offline vertex i, the way that the outer algorithm constructs the matching using the decisions of OCR is that it adds i to the matching whenever it is available and get selected by OCR. Let b = b 1 , b 2 , · · · , b ℓ , and 0 ≤ j 1 < j 2 < · · · < j k be all indices such that b j k ′ is 1 where k ′ ∈ [k]. By conditioning on X = b, we can say that the OCR algorithm selects i when it receives Q j 1 , Q j 2 , · · · , Q j k . In the forward sequence, the algorithm first matches i when it proposes Q j 1 , and then vertex i gets available after d time units. Therefore, the next time the algorithm matches i is the smallest index j ′ ∈ {j 1 , · · · , j k } such that j ′ ≥ j 1 + d, and the algorithm continues matching i in the same way. It is easy to verify that the number of times that our algorithm matches i is equal to the maximum number of times that we can match i at the time units {j 1 , · · · , j k } without violating the reusability constraints (i.e., we should not match i twice within any time interval of length d). Now consider the backward sequence. By conditioning on Y = b, we can say that OCR selects i in exactly the same proposed sets Q j 1 , Q j 2 , · · · , Q j k . However, in the backward sequence the first time that algorithm matches i is when it proposes Q j k , and then it cannot match i again when it proposes sets Q [j k ,j k −d+1] . Similar to the forward sequence, it is easy to see that the number of times that the algorithm matches i is equal to the maximum number of times that we can match i without violating the reusability constraints. Therefore, the expected size of the matching in the forward and backward sequences is the same. Using the observation above and assuming (2), we can easily prove Claim 2.4 as follows. which implies the claim. Therefore, in order to show the correctness of Claim 2.4, we only need to prove Equation (2). Let G = (V, E) be the dependency graph for the forward sequence. It is easy to see that the dependency graph for the backward sequence is G as well. Recall that in the dependency graph, we have a vertex for every proposed set. Since both forward and backward sequences have the same proposed sets, they have the same vertices in the dependency graph. Furthermore, they have the same set of edges in the dependency graph. As we discussed earlier we add an edge (Q j , Q j ′ ) i (in the forward sequence) between two sets Q j and Q j ′ if both Q j and Q j ′ are randomized rounds, i ∈ Q j , Q j ′ , and i is not in any set proposed to the algorithm between Q j and Q j ′ . In that case (Q j , Q j ′ ) i will be in the dependency graph of the backward sequence as well, since i is proposed in Q j and Q j ′ but not in any set in-between them. We further claim that the probability distribution of realized dependency graph is also the same for forward and backward sequences. Let E ⊲ , E ⊳ be the set of realized edges in the forward and backward sequences, respectively. We specifically show that for any set of edges S ⊆ E, the realized edges E ⊲ and E ⊳ will be equal to S with the same probability. I.e., Consider an edge (Q j , Q j ′ ) i in the dependency graph where j < j ′ . In this case this edge is in the realized dependency graph of the forward sequence if (i) round Q j is a sender round, (ii) OCR selects i m = i in round Q j , (iii) round Q j ′ is a receiver round, (iv) OCR selects i m = i in round Q j ′ . As we discussed earlier OCR satisfies each of conditions (i)-(iv) each with the probability of 1/2. Note that conditions (i) and (ii) are related to decisions of the algorithm when it receives Q j , and with the probability of 1/4 the algorithm satisfies these conditions. Also conditions (iii) and (iv) are only related to decisions of the algorithm when it receives Q j ′ which they met with the probability of 1/4. Another way to interpret the realization of dependency graph is as follow. Vertex Q j has at most 4 edges in the dependency graph, and it satisfies the conditions (i)-(iv) for at most one of them each with the probability of 1/4. The same thing holds for vertex Q j ′ . It satisfies the conditions for at most one of its incident edges each with the probability of 1/4. Therefore, we get the same distribution of realized dependency graphs if each vertex selects at most one of its incident edges each with the probability of 1/4, and we add an edge to the realized graph if it has been selected by both of its endpoints. Now consider the same edge (Q j , Q j ′ ) i in the dependency graph of the backward sequence. In this case the algorithm receives the proposed set Q j ′ before Q j . Therefore, this edge is in the realized dependency graph of the backward sequence if (i) round Q j ′ is a sender round, (ii) OCR selects i m = i in round Q j ′ , (iii) round Q j is a receiver round, (iv) OCR selects i m = i in round Q j . We can still interpret the realization of the dependency graph as if each vertex selects at most one of its incident edges each with the probability of 1/4, and we add an edge to the realized graph if it has been selected by both of its endpoints. Therefore, the probability of distribution of dependency graphs are the same for both forward and backward sequences which implies (3). As we discussed the distribution the realized dependency graph is the same for both forward and backward sequences. We further claim that for every offline vertex i the proposed sets that OCR selects i also have the same distribution for the forward and backward sequences. As we discussed earlier, edges in the realized dependency graph form a matching, and each edge represents a perfect negative correlation between the decisions of OCR. We first claim that in order to find the joint distribution of rounds in which the algorithm picks i, we can only look at the decisions of the algorithm for rounds that i is proposed. If we consider a randomized round Q j = {i, i ′ }, the algorithm picks each of i and i ′ with the probability of 1/2 when the probability is taken over all random decisions of the algorithm. Algorithm 1 just introduces slightly negative correlation between its decision for different rounds. Now consider an edge (Q j , Q j ′ ) i ′ in the realized dependency graph where Q j ′ does not contain i. Although the decision of the algorithm has a perfect negative correlation the rounds Q j ′ and Q j , vertex i still gets selected by the algorithm with the probability of 1/2 at round Q j . Also, the decision of the algorithm for the round Q j is independent of its decisions for other rounds that i is proposed. It follows that the distribution of the algorithm for selecting vertex i is as follows. Consider a randomized round Q j ∋ i. If Q j has no incident edges in the realized dependency graph, then the algorithm selects i with the probability of 1/2 independently. Otherwise, let assume that there is an edge between Q j and Q j ′ in the dependency graph. If i / ∈ Q j ′ , the algorithm still selects i he probability of 1/2 and this decision is independent of other rounds that i is proposed. If i ∈ Q j ′ , the algorithm selects i in exactly one of Q j and Q j ′ each with the probability of 1/2. Furthermore, for a deterministic round Q j ∋ i, the algorithm selects i with the probability of 1. It follows that the distribution of the rounds that the algorithm selects i is the same for both forward and backward sequences if they share a same dependency graph. In other words, for every set of edges S ⊆ E in the realized graph and any vector b ∈ {0, 1} ℓ , we have Therefore we have which proves (2) and completes the proof of the Claim 2.4. We now show that Algorithm 1 is 1/32-OCR. Let Q 1 , Q 2 , · · · , Q |U | be the sets proposed by the outer algorithm. We show that the expected matching returned by Algorithm 1 satisfies eq. (1). By the definition of µ i , for any round j, µ i (Q 1 , · · · , Q j ) is the expected number of times that the algorithm matches i for the first j rounds. Therefore, µ i (Q 1 , · · · , Q j ) − µ i (Q 1 , · · · , Q j−1 ) is the expected increment in the size of the matching in round j, which is the probability that the algorithm matches i at the round j. Therefore, we have By applying Claim 2.4, we get the following. We can re-write (6) as Consider Algorithm 1 for the input sequence Q [j,1] and an offline vertex i, we derive a lower bound on the expected number of times that the algorithm matches i. First, we claim that in order to find the expected size of the matching of vertex i, we can only look at the decisions of the algorithm for rounds that i is proposed. If we consider a randomized round Q j = {i 1 , i 2 }, the algorithm picks each of i 1 and i 2 with the probability of 1/2 when the probability is taken over all random decisions of the algorithm. Algorithm 1 just introduces slightly negative correlation between its decision for different rounds. Although the decision of the algorithm for a round Q j which contains vertex i might be correlated to other rounds that does not contain i, these correlations does not affect the number of times that the algorithm matches i. Therefore, for the analysis of the algorithm, we can only consider the rounds that contain i and the correlations between these rounds. We now consider the different cases of definition of 1, and we show that our algorithm satisfies the properties of OCR. • Case 1; i / ∈ Q j : As we discussed earlier we can only consider rounds that i is proposed to the algorithm. Since i is not proposed in round j, the algorithm does not match i, and goes to the next round. Therefore, in this case we have µ i ( Q [j,1] ) = µ i ( Q [j−1,1] ). By (7), we have • Case 2; i ∈ Q j and |Q j | = 1: In this case, the algorithm is given a deterministic round. Therefore, the algorithm picks and matches i with the probability of 1. After matching i, this vertex becomes available for matching again only after d time units when set Q j−d arrives. In this case the algorithm cannot match i when the sets Q [j−1,j−d+1] arrive. Therefore the decisions and correlations of the algorithm for these rounds does not affect the expected size of the matching. Therefore, we have 1] ). We then have, In the following observation we show that Observation 2.2. For any j ′ < j, Proof. We can re-write Using equation (7), we then have By the observation above and (8) we have Note that by the definition 1− j−1 t=j−d+1 ∆µ i t is equal to p i j . Therefore, ∆µ i j = p i j which completes the proof for this case. • Case 3; i ∈ Q j , |Q j | = 2, and prev i j ≤ j − d: Let j ′ = prev i j , then Q j ′ is the next time that vertex i is proposed to the algorithm in the sequence Q [j −1,1] . Recall that Algorithm 1 upon making a decision for a sender round, changes the state variables for the next d − 1 rounds. In the case that j ′ ≤ j − d, the algorithm does not change the state variables of Q j ′ . Consider the sequence of proposals Q [j,1] and consider the algorithm when it receives Q j . The algorithm selects i with the probability of 1/2 regardless it is a sender or a receiver round (Since Q j is the first round in the backward sequence). Also the sender round does not change the state variables for the next time vertex i gets proposed to the algorithm. Therefore with the probability of 1/2, algorithm selects i, and we get the expected matching of size 1 + µ i ( Q [j−d,1] ). Furthermore, the algorithm does not select i with the probability of 1/2. In this case the algorithm basically goes to next round and we get the expected matching of size µ i ( Q [j−1,1] ). Therefore, Hence, • Case 4; i ∈ Q j , |Q j | = 2, and prev i j > j − d: This is the only case that algorithm uses the negative correlation between the decisions for different rounds to get a better solution. Let j ′ = prev i j , We further divide this case into two subcases. -Q j ′ is a deterministic round: First note that when Q j ′ is deterministic round, we have ∆µ i j ′ = p i j ′ according to what we have already discussed. Also, the decision of a deterministic round does not rely on the state variables, and Algorithm 1 always resets state variables after a deterministic round. Considering the backward sequence Q [j,1] , the algorithm selects i with the probability of 1/2 when it receives Q j regardless of if it is a sender or a receiver round. Therefore with the probability of 1/2, our algorithm selects i, and we get the expected matching of size 1 + µ i ( Q [j−d,1] ). Also, with the probability of 1/2, our algorithm does not select i when it receives Q j . In this case vertex i only has a higher chance to get selected next times this vertex is proposed to the algorithm. This depends on the realized edges incident to Q j . Therefore, if the algorithm does not select i, the expected size of the matching in the remaining sequence is at least µ i ( Q [j−1,1] ). Therefore, We then have (7). where the last equality relies on the fact that p i j ′ = ∆µ i j ′ and p i j ′ − ∆µ i j ′ = 0. -Q j ′ is a randomized round: Consider the backward sequence Q [j, 1] , and let µ i receiver ( Q) be the expected size of the matching for vertex i, given that the round Q j is a receiver round, and let µ i sender ( Q) be the expected size of the matching given that the Q j is a sender round. Note that at each randomized round the algorithm chooses to be a sender or a receiver uniformly at random. Therefore for any input sequence Q such that the first round of Q is a randomized round, we have Consider the input sequence Q [j,1] and suppose that Q j is a receiver round. Since this is a first round in the backward sequence and all state variables are default values, the algorithm just selects i with the probability of 1/2 and proceeds to the next round. Similar to what we discussed for the previous case, if the algorithm selects i, the expected size of the matching is Now consider a sender round Q j . The algorithm selects i with the probability of 1/2. In this case the algorithm cannot match i again within the next d − 1 rounds. Therefore, in this case the expected size of the matching is 1 1] ). Otherwise suppose that the algorithm did not select i which happens with the probability of 1/2. Let Q j = {i 1 , i 2 }. In this case algorithm selects m ∈ {0, 1} uniformly at random and changes the state variables for i m to create a negative correlation for the next rounds. Suppose i m = i which happens with the probability of 1/2. In this case, the algorithm might have a realized edge between this round and one of the other rounds that i is proposed to the algorithm. In this case the algorithm has a better chance to select i for the next rounds. However, the existence of this realized edge cannot be guaranteed and we can say that in this case the algorithm returns a matching with the expected size of at least µ i ( Q [j−1,1] ) in the remaining sequence. In the remaining of the analysis we assume that the algorithm does not pick i for round Q j , and i m = i for this round. In this case the algorithm sets the state variables τ i to not-selected for the next d − 1 rounds to introduce a negative correlation. Now consider the round that the algorithm receives i which isQ j ′ . If round Q j ′ is sender round, the algorithm does not use the previous state variables and we get an expected matching size of µ i sender ( Q [j ′ ,1] ). Now Consider a receiver round Q j ′ . Let In this case algorithm selects m ∈ {0, 1} uniformly at random and uses the state variables for i ′ m to ensure a negative correlation. If i ′ m = i, the algorithm might have a realized edge between rounds Q j and Q j ′ which causes a negative correlation. However, the existence of such an edge cannot be guaranteed. Therefore, in this case we can assume that algorithm does not uses the state variables. Thus, we get at a matching of size least µ i receiver ( Q [j ′ ,1] ). However, if i ′ m is equal to i, the algorithm ensures a negative correlation between rounds Q j and Q j ′ . Therefore the algorithm selects i, and we get an expected matching size of 1 Putting all together, for a sender round Q j we have By Equation (10), we then have By (11) and (12) . By simplifying the inequality above we get Note that by Equation (10), 1] ). Thus, we can re-write the inequality above as Therefore, (7). We complete the proof using the claim below. Claim 2.5. For any backward sequence Q [j,1] where Q j is a randomized round, the following holds. Proof. We prove the claim using an induction on the size of Q. When | Q| = 1, there is no difference between sender and receiver rounds and the claim clearly holds. Now suppose that | Q| > 1. Let j ′ = prev i j , then by (12) we have Note that by Equation (10), 1] ). Thus, By (11) . Note that we always have 1 1] ) describes an event that i got matched at Q j ′ deterministically. Thus, 1] ) . 1] ) ≥ 0. Thus, using the inequality above we can say that µ i 1] ). By combining this with (10) we get µ i 1] ) which completes the proof for the induction, and proves the claim. It follows from the claim above and Inequality (13) that which completes the analysis and shows that Algorithm 1 is 1/32-OCR. In this section we show that using an γ-OCR algorithm as a black-box we can beat the approximation ratio of 0.5 for the OBMRR. Our algorithms are primal-dual and based on the natural linear programming relaxation of the OBMRR problem, which we describe next. Our algorithms and their analyses rely on the LP relaxation of OBMRR. In the LP relaxation of the problem, we associate a variable x i,j to every edge (i, j) ∈ E of the graph. Since every online vertex j should be matched to at most one offline vertex, the summation of edges incident to j should be at most 1. On the other hand, offline vertices are reusable and we know that if an offline vertex i gets matched, it will be available for re-allocation after d time units. This is equivalent to saying that an offline vertex i should be matched at most once in every time interval of size of d. For every offline vertex i we have a set of constraints in the LP relaxation which states that the summation of the edges incident to i in any interval of length d should be at most 1. The primal and dual linear programs of OBMRR are given below. It is interesting to mention that unlike the LP relaxation for the bipartite matching (with nonreusable resources), the polytope described by the LP relaxation above is not necessarily integral. Remark 3.1. The integrality gap of the LP relaxation of OBMRR is at least 7 6 . Consider the graph below, and assume that d = 3. It is easy to see that the size of the optimal matching is 3. However, we can get a feasible fractional solution of size 3.5 by setting x i,j to 0.5 for every edge of the graph. Throughout the paper we will always let x i,j to be the probability that edge (i, j) is in the matching. Then, the primal objective P is equal to the objective of the algorithm. Our algorithms always maintain both primal and dual solutions. We use the primal-dual framework below to provide a approximation guarantee for our algorithms. Lemma 3.2. Suppose an online algorithm maintains a primal assignment {x i,j } with objective value P , and there is a dual assignment {α i,t , β j } with objective value D satisfying the conditions below: i) Approximate dual feasibility: there exists Γ ∈ (0, 1], so that ii) Reverse weak duality: P ≥ D. Then, the algorithm is Γ-competitive. Proof. {α i,t /Γ} i,t , {β j /Γ} j is a feasible dual assignment, due to the approximate dual feasibility. Denoting the optimal LP objective value by OPT, by weak duality we have D/Γ ≥ OPT. Combined with the reverse weak duality, we have P ≥ Γ · OPT, as desired. Our algorithm is represented in Algorithm 2. At each round, the algorithm selects a set of at most two vertices, and propose these vertices to the OCR algorithm. Consider the round j of the algorithm and let Q 1 , Q 2 , . . . , Q j−1 be the previous set of vertices proposed by the algorithm, and let Q j be the new set proposed by the algorithm. We define the marginal contribution of the Q j as follows. Algorithm 2 and its analysis relies on the primal dual LP of OBMRR. Our algorithm maintains an online primal dual solution of OBMRR. In the primal solution we set x i,j = ∆µ i j . Therefore, the size of the primal solution is always equal to the expected size of the matching returned by the algorithm. Let Q j be the query proposed by the algorithm at the time j. Let i ∈ Q j , be a vertex proposed to OCR at the step j of the algorithm. Proposing this vertex increases the expected size of dual solution by ∆µ i j . Our algorithm maintains a dual solution by increasing dual variables α i,j and β j by ∆α i j and ∆β i j respectively. Our algorithm always guarantee that ∆α i j + ∆β i j = ∆µ i j . Thus, the size of the dual solution is always equal to the size of primal solution. Later in this section, we explain how we determine values of ∆α i j and ∆β i j . At each round, our online primal dual algorithm finds a set of at most two vertices that maximizes β j , and proposes this set to OCR. Note that our primal-dual algorithm does not look at the random decisions of OCR. Nevertheless, we can assume that we find an online matching which is constructed in the following way. Whenever OCR selects a vertex i, we add that vertex to the matching if vertex i is available. This vertex will not be available for the next d time-units, although OCR might pick this vertex again during this time period. Consider a randomized round Q j , and an offline vertex i ∈ Q j . Let j ′ = prev i j , thus Q j ′ is the previous occurrence of i. Suppose that j ′ > j − d. Then, a γ-OCR algorithm guarantees that i is selected with at least probability of p i j /2 + γ(p i j ′ − ∆µ i j ′ ). Recall that p i j ′ − ∆µ i j ′ is the probability that i was available at time j ′ but is not picked by OCR. Let u i j = p i j ′ − ∆µ i j ′ , and let r i j be the probability that i was not available at the time j ′ but became available due to re-usability before or at the time j. It is then clear that the probability that i is available at the time j is equal to u i j + r i j . Therefore, We can then rewrite the bound guaranteed by OCR as follows. This shows that whenever vertex i was available at the time j ′ but it is not matched by the algorithm, the OCR algorithm guarantees that it will be picked next time with a probability slightly larger than 1/2. However, if it is the first time that i is proposed after it became available again, the algorithm still picks i with the probability of 1/2. We set the dual variables based on the values of u i j and r i j . Intuitively, we assign a different weight to dual variables whenever i is proposed to OCR for the first time after becoming available again. For a vertex i in Q j , we set ∆β i j = β 1 r i j /2 + β 2 (∆µ i j − r i j /2), where β 1 ≥ β 2 are constants that we optimize through this section. We also set ∆α i j = (1 − β 1 )r i j /2 + (1 − β 2 )(∆µ i j − r i j /2). Note that for the consistency of our notations we set r i j = p i j whenever prev i j ≤ j − d (In this case we also have p i j = 1). Algorithm 2: Primal-Dual Algorithm 1: for each online vertex j do 2: Find a set Q j ⊆ N (j) with the size at most two vertices that maximizes β j , where N (j) is the set of neighbors of the online vertex j. Propose Q j to a γ-OCR algorithm, and update primal-dual variables accordingly. Let i be the vertex picked by the OCR. Add (i, j) to the matching if i is available at the time j. 5: return the matching. It is clear from our dual assignments in Section 3.2 that we always have ∆β i j + ∆α i j = ∆µ i j . Therefore, the size of the primal and dual solutions are always equal. In this section we show that for the proper choices of β 1 and β 2 , our algorithm satisfies the approximate dual feasibility as it is defined in Lemma 3.2. We begin our analysis by simple a observation about the dual variables. proposed to OCR, it gets matched with the probability of at least r i t /2, so it will not be available at time j with that probability. We also claim that t∈T r i t /2 ≤ (1 − r i j )/2. The reason is that vertex i can get matched at most once in every time interval of length d. Thus, vertex i cannot get available twice in a time interval of length d, and we have t∈T r i t + r i j ≤ 1. This implies that t∈T r i t /2 ≤ (1 − r i j )/2 and completes the proof of the claim. Let (i, j) be an edge in the graph. We consider the following cases. • Round j is a randomized round, and i ∈ Q j : Since the algorithm did not choose to propose i to OCR in a deterministic round, the value of β j is at least ∆β i j when i is proposed in a deterministic round. Therefore, we have β j ≥ ∆ deterministic β i j ≥ β 1 r i j /2 + β 2 (∆µ i j − r i j /2) ≥ β 1 r i j /2 + β 2 (p i j − r i j /2) . Since in a deterministic round ∆µ i j = p i j . Also, since i ∈ Q j , and the algorithm proposes i in a randomized round, ∆µ i j ≥ p i j /2. Therefore, Therefore, the LHS of the approximate duality constraint is equal to α i,t = By (14) β j + By (15) α i,j + By Observation 3.3 Thus, the approximate duality constraint reduces to • Round j is a deterministic round, and i ∈ Q j : Since i ∈ Q j , and the algorithm proposes i in a deterministic round, ∆µ i j = p i j . Therefore, Therefore, the LHS of the approximate duality constraint is equal to By (17) α i,j + By Observation 3.3 j−1 t=max{j−d+1,1} α i,t ≥ 1 + β 2 (ϕ i j + r i j /2 − 1) − β 1 (ϕ i j + r i j /2) . Thus, the approximate duality constraint reduces to 1 + β 2 (ϕ i j + r i j /2 − 1) − β 1 (ϕ i j + r i j /2) ≥ Γ . • Round j is a randomized round, and i / ∈ Q j : Let Q j = {i 1 , i 2 }. Recall that the algorithm picks the set Q j that maximizes β j . Therefore, ∆β i 1 j is at least ∆β i j for when we propose Q ′ j = {i 2 , i} at the round j instead of Q j . Similarly, ∆β i 2 j is at least ∆β i j for when we propose Q ′′ j = {i 1 , i} at the round j instead of Q j . Let j ′ = prev i j be the previous occurrence of i. We further divide this case into two different cases. -When i is not appeared in the last d proposed sets to OCR i.e., j ′ ≤ j − d: In this case we have r i j = p i j = 1 , and ∆β i j is β 1 /2, when we propose i in a randomized round. Thus, ∆β i 1 j and ∆β i 2 j are both at least β 1 /2. Therefore, the LHS of approximate duality is at least and, the approximate duality constraint reduces to -The other case is when j ′ > j − d: In this case OCR guarantees that ∆µ i j is at least (1/2 + γ)u i j + r i j /2 when we proposes i in a randomized round. We can then give a lower bound on the value of β j as follows. Therefore, the LHS of the approximate duality constraint is equal to β j + j t=max{j−d+1,1} α i,t ≥ By (21) β j + By Observation 3.3 j−1 t=max{j−d+1,1} α i,t ≥ 1 − p i j + β 2 (1 + 2γ)u i j + p i j + ϕ i j − 1 + β 1 (r i j − ϕ i j ) . Thus, the approximate duality constraint reduces to 1 − p i j + β 2 (1 + 2γ)u i j + p i j + ϕ i j − 1 + β 1 (r i j − ϕ i j ) ≥ Γ . • Round j is a deterministic round, and i / ∈ Q j : Inspired by [32] we introduce a set of new constraints to enforce the superiority of randomized rounds. We then show that this set of new constraints can reduce this case to the previous case. Consider a vertex i and round j, and let ∆ deterministic β i j be the ∆β i j when i gets proposed in a deterministic round, and let ∆ randomized β i j be the ∆β i j when i gets proposed in a randomized round. We then add the following set of constraints. 2∆ randomized β i j ≥ ∆ deterministic β i j . Note that we can re-write the inequality above as following. β 1 r i j + β 2 (1 + 2γ)u i j ≥ β 1 r i j /2 + β 2 (p i j − r i j /2) . We now show that given these set of constraints, we can reduce this case to the previous case. Let Q j = {i ′ } be the deterministic proposal in round j. Since the algorithm did not propose the set Q ′ j = {i, i ′ } at this round, we can say that β j = ∆ deterministic β i ′ j ≥ ∆ randomized β i j +∆ randomized β i ′ j . Also, by (23) we have 2∆ randomized β i ′ j ≥ ∆ deterministic β i ′ j . By combining this with the previous inequality we get ∆ randomized β i j ≤ ∆ randomized β i ′ j . Thus, This is the exact guarantee that we had for β j in the previous case. Thus, by adding the constraints (23) we can reduce this case to the previous case. Optimizing the Competitive Ratio: We solve an LP whose variables are Γ, β 1 , and β 2 , in order to find the optimal competitive ratio. max Γ subject to ∀p i j , r i j ∈ [0, 1], r i j ≤ p i j : Eqn (16), (18), (20) , (22) , (24) β 1 ≥ β 2 ≥ 0 . Although the constrainsts of the LP have variables like ϕ i j and u i j , these variable are a function of p i j and r i j . Thus, we only have to consider the constraints of LP for different values of p i j and r i j . In fact it is straightforward to verify that Γ = β 1 = 3+4γ 6+6γ and β 2 = 1 2+2γ is a feasible solution to the LP above. Note that we showed that an 1/32-OCR always exists. This immediately implies that the competitive ratio of our algorithm is at least 3+4·1/32 6+6·1/32 = 50/99 ≈ 0.50505. Online vertex-weighted bipartite matching and single-bid budgeted allocations Fast algorithms for online stochastic convex programming Online prophet-inequality matching with applications to ad allocation Improved bounds for online stochastic matching Multiway online correlated selection. CoRR Online primal-dual algorithms for maximizing ad-auctions revenue The adwords problem: online keyword matching with budgeted bidders under random permutations Online matching with concave returns Randomized primal-dual analysis of ranking for online bipartite matching Near optimal online algorithms and fast approximation algorithms for resource allocation problems Online resource allocation with matching constraints An economics-based analysis of ranking for online bipartite matching Online allocation with traffic spikes: Mixing adversarial and stochastic models Edge-weighted online bipartite matching Online stochastic packing applied to display ad allocation Online ad assignment with free disposal Online stochastic matching: Beating 1-1/e Batching and optimal multi-stage bipartite allocations Linear programming based online policies for real-time assortment of reusable resources Near-optimal bayesian online assortment of reusable resources Two-stage stochastic matching with application to ride hailing Online matching with general arrivals Real-time optimization of personalized assortments Online assortment optimization with reusable resources Online allocation of reusable resources: Achieving optimal competitive ratio Online allocation of reusable resources via algorithms guided by fluid approximations Online matching with stochastic rewards: Optimal competitive ratio via path based formulation Fully online matching Fully online matching ii: Beating ranking and water-filling Online primal dual meets online matching with stochastic rewards: configuration lp to the rescue Adwords in a panorama Online stochastic matching: New algorithms with better bounds An optimal deterministic algorithm for online b-matching An optimal algorithm for on-line bipartite matching Optimal online contention resolution schemes via ex-ante prophet inequalities Algorithms for online matching, assortment, and pricing with tight weight-dependent competitive ratios Dynamic pricing under a static calendar Online stochastic matching: Online actions based on offline statistics Online matching with stochastic rewards Adwords and generalized online matching Online stochastic matching with unequal probabilities Claim 3.3 . Let i be a vertex in Q j , and assume that we have assigned the dual variables according to the rule we discussed earlier. We then havebe all the time steps between j − d + 1 and j − 1 (inclusive) such that the algorithm has proposed i to OCR. Now consider a time t ∈ T where i is proposed to OCR. If it is the first time that i gets proposed to OCR after becoming available (which happens with the probability of r i t ), we increase ∆α i t by (1 − β 1 )r i t /2. If vertex i gets matched with a probability greater than r i t /2 at the time t or if it was available at the time t and gets matched in later steps, we add (1 − β 2 ) portion of its marginal contribution to ∆α i t . Note that (1 − β 2 ) is larger than (1 − β 1 ) since β 1 ≥ β 2 . Thus,We now claim that t∈T r i t /2 ≤ ϕ i j where ϕ i j = min{1 − p i j , (1 − r i j )/2} which proves the claim. It is easy to see that t∈T r i t /2 ≤ 1 − p i j . The reason is that for every time t ∈ T that vertex i gets