Abstract 1 Introduction 2 Preliminaries 3 Techniques 4 Randomized Integral Matching 5 Fractional Matching 6 Conclusion References

Optimal Online Bipartite Matching in Degree-2 Graphs

Amey Bhangale ORCID University of California, Riverside, CA, USA Arghya Chakraborty ORCID Tata Institute of Fundamental Research, Mumbai, India Prahladh Harsha ORCID Tata Institute of Fundamental Research, Mumbai, India
Abstract

Online bipartite matching is a classical problem in online algorithms and we know that both the deterministic fractional and randomized integral online matchings achieve the same competitive ratio of 11e. In this work, we study classes of graphs where the online degree is restricted to 2. As expected, one can achieve a competitive ratio of better than 11e in both the deterministic fractional and randomized integral cases, but surprisingly, these ratios are not the same. It was already known that for fractional matching, a 0.75 competitive ratio algorithm is optimal. We show that the folklore Half-Half algorithm achieves a competitive ratio of η0.717772 and more surprisingly, show that this is optimal by giving a matching lower-bound. This yields a separation between the two problems: deterministic fractional and randomized integral, showing that it is impossible to obtain a perfect rounding scheme.

Keywords and phrases:
Online Algorithm, Bipartite matching
Funding:
Amey Bhangale: Supported by Hellman Fellowship award & NSF CAREER award 2440882.margin: [Uncaptioned image]
Arghya Chakraborty: Supported in part by Prof. Mrinal Kumar’s SERB grant CRG/2023/006433.margin: [Uncaptioned image]
Prahladh Harsha: Supported in part by the Google India Research Award.margin: [Uncaptioned image]
Copyright and License:
[Uncaptioned image] © Amey Bhangale, Arghya Chakraborty, and Prahladh Harsha; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Online algorithms
Funding:
margin: [Uncaptioned image] Research of the second and third authors supported by the Department of Atomic Energy, Government of India, under Project Identification No. RTI4001.
Editors:
Ho-Lin Chen, Wing-Kai Hon, and Meng-Tsung Tsai

1 Introduction

The problem of Bipartite Matching involves a bipartite graph G=(L,R,E) with vertices LR and edges EL×R. The objective is to find the largest sized matching in G - in other words, the largest subset ME such that no two edges in M share a common vertex. This problem has been well studied [25, 4] and polynomial time algorithms are known.

Online Bipartite Matching was first introduced by Karp, Vazirani, and Vazirani [24]. In the online version of the problem, the set L is known in advance, but the vertices in R arrive one by one. Each time a vertex jR arrives (along with its edges), we must make an irreversible decision on whether to match j with one of its neighboring vertices iN(j)L. In a fractional version, we can assign fractional weights to the edges satisfying the matching constraints. The competitive ratio of an online matching algorithm is simply the approximation ratio achieved by the algorithm, that is, the worst-case ratio between the cost of the matching found by the algorithm and the cost of an optimal matching. Online Bipartite Matching has found immense applications in real-world problems. AdWords, organ matching, and online dating are some of the few areas with direct applications.

The seminal work of Karp, Vazirani, and Vazirani showed that if an unweighted graph has an optimal matching of size n then no online algorithm can guarantee a matching of size larger than (11e)n, in expectation. They also gave an algorithm, called RANKING, that attains the same competitive ratio of (11e) on unweighted graphs.

Many variants of this problem have also been studied. The survey by Mehta [27] provides an excellent overview of the problem and its variants. Among the various generalizations studied, there is the edge arrival model [20], where the edges arrive in an online fashion instead of the vertices. Recently, there have been breakthroughs [16, 30, 21, 5] in the setting where the edges are weighted (one has to make additional assumptions here, as in this case, no competitive algorithm exists without an additional assumption). Other variants, like stochastic weights [23, 15], ad words [28, 22, 13], display ads [19, 10, 17], online sub-modular welfare maximization [26, 9] have been studied. Most of these edge-weighted settings require either a stochastic input [23, 22] or a free disposal model [18, 16, 30, 5].

For all these matching-related problems, one may consider the polytope of matchings. Randomized algorithms naturally give rise to a fractional matching in this polytope. Hence, the problem of fractional matching is of extreme importance and has also been well studied. The WATER-LEVEL Algorithm [10] is a well-studied deterministic fractional matching algorithm, attaining a competitive ratio of (11e), and this is optimal. Almost all problems related to matching have this feature, which is that the optimal competitive ratio for randomized integral algorithms is the same as the optimal competitive ratio for fractional matching algorithms. Indeed, randomized integral algorithms inherently produce a probability distribution over matchings, and this probability distribution may be viewed as a fractional matching.

However, given that the competitive ratio is the same for all these related problems, it is interesting to ask if the fractional and the randomized integral matchings are inherently the same problems. Hence, people have tried to obtain integral matchings as a randomized rounding of fractional matchings [8]. In fact, for the edge weighted case, all the known algorithms [16, 30, 21, 5], first produce a fractional matching and then use (randomized) Online Correlated Selection (OCS) algorithm to perform the task of online rounding. Therefore, it is interesting to ask whether the fractional and randomized integral matching problems are the same for other variants of matching.

Bounded degree graphs.

All the candidate graphs that prove the lower bound of (11e) competitive ratio for randomized integral or fractional matching have the feature that they contain very high-degree vertices. It is natural to ask whether one can construct low-degree graphs to obtain the same lower bounds. There have been some works on this [2, 1, 11, 12, 29, 6, 3]. In this paper, we study graphs where the online vertices have a degree at most 2. We show that, indeed, algorithms can perform better in this particular setting. More specifically, we prove the following theorem.

Theorem 1 (Integral Matching).

For any graph, G, with n online vertices and degree of online vertices at most 2, there exists an online randomized integral matching algorithm with competitive ratio η, and no online algorithm can attain a competitive ratio better than η,

where η:=1i=1122i+i10.717772.

This is interesting, in contrast to the following known result:

Theorem 2 (Fractional Matching).

For any graph, G, with n online vertices and degree of online vertices at most 2, the Water-Level Algorithm (c.f, Algorithm 2) attains a competitive ratio of 0.75 and no online algorithm can obtain a better competitive ratio.

The analysis of the fractional matching problem has been done in [6], but for the sake of completeness, we provide an easy proof in Section 5.

It is intriguing that the fractional and the randomized integral matchings seem to be different problems for this class of graphs, as the optimal competitive ratio differs for the two different settings.

We use the Primal-Dual analysis used in prior works [7, 16, 5] on online bipartite matching (described in detail in the following section) for our algorithm. Our main technical contribution is to set the primal-dual variables in the algorithm’s analysis in a non-trivial manner, allowing us to prove the optimality of our algorithm.

1.1 Brief overview

In Section 2, we formally define some of the notations that we will use throughout the paper, the models that we look at, and the online primal-dual framework which is a commonly used tool in the analysis of online bipartite matching algorithms. Then in Section 4.1, we explicitly construct a graph, and then use Yao’s principle to prove a lower bound for our problem. Finally, in Section 4.2 we use the online primal-dual framework to prove the tightness of the above bound, by analyzing a simple algorithm.

2 Preliminaries

Throughout this paper, we shall denote by G(d1,d2) the set of graphs that have degree at most d1 for the offline vertices and degree at most d2 for the online vertices. Note that a bipartite graph on n online vertices and n offline vertices can be any graph from G(n,n). We shall focus on G(n,2) graphs where the online vertices may have a degree at most 2.

We shall use L to refer to the set of offline vertices and R to refer to the set of online vertices. To make things easier to read, we shall use i,i1,i2 to refer to vertices in L (offline vertices) and j to refer to vertices in R (online vertices). We shall mostly consider an online vertex j, arriving with exactly two neighbors i1 and i2, and this is without loss of generality as given by the following lemma.

Lemma 3.

Online Bipartite Matching on graphs in G(n,2) is equivalent to graphs with degree of online vertices exactly 2. In other words, a c-competitive randomized algorithm for one implies a c-competitive randomized algorithm for the other.

Proof.

Since G(n,2) includes graphs with online degrees at most 2, an online algorithm might perform better on graphs with exactly degree 2. We show that these two cases are equivalent. We only need to show that if we have a γ-competitive ratio algorithm on graphs with an online degree of exactly 2, then there is a γ-competitive ratio algorithm on graphs with an online degree of at most 2.

Fix an arbitrary algorithm A with γ-competitive ratio on graphs with an online degree of exactly 2. From this, we will construct an algorithm A with γ-competitive ratio on G(n,2). Fix any graph G=(L,R,E)G(n,2). We construct a new graph Gm=(L,R,E), parameterized by an integer m, where all online vertices have exactly degree 2. This graph Gm consists of m copies of G, where the i-th copy is denoted by Gi=(Li,Ri,Ei) and an additional vertex to adjust the degree of every online vertex in Gm to exactly two. More precisely, the set of offline vertices L is L1L2Lm{} while the set of online vertices R is R1R2Rm. The edge set E is E1E2EmE~ where the edges in E~ are defined next.

The arrival sequence of the online vertices in Gm is as follows: all the m copies of the first vertex in R, followed by all the m copies of the second vertex in R, and so on. Recall, each of the copies Gi=(Li,Ri,Ei) are isomorphic to the original graph G=(L,R,E). The graph Gm has an additional set E~ of the edges as follows: For every vR1R2Rm with degree 1, we add an edge (v,) to the graph Gm.

Now, we run A on Gm for the first m online vertices, followed by the next m online vertices, and so on. The matching produced by A can be viewed as m different matchings on G, with an additional vertex L. However, at most one of those matchings may contain as part of the matching. The remaining m1 matchings must not contain and can be directly viewed as a matching on G. The algorithm A will pick one of these m matchings uniformly at random. If A happens to pick the matching with we give up and do not out put any matching. Note that A can be generated from A in an online fashion, by selecting one of the m matchings and simulating it. If this matching contains , we stop at that point and otherwise we output a feasible matching.

Now, let us bound the competitive ratio of A, assuming that the competitive ratio of A is γ. Let us assume that G has an optimal matching of size n, implying that Gm will have an optimal matching of size at least mn. Hence A, with a competitive ratio of γ, should give us at least γmn size, in expectation. However, in this matching produced, we might have , which we cannot use in algorithm A. By our construction, we have m collections of matchings of which one contains and the remaining m1 of them are used by A. Now, if we leave aside the particular matching that contains , we would still have a matching of size at least γmnnm in expectation, as produced by A. The optimal matching in this set is of size at most n. Hence the expected competitive ratio of A is at least γmnnmn=γm1m, which converges to γ as m increases. Hence, by choosing a large m, this conversion ensures that A attains the same competitive ratio as A on G.

2.1 Primal and Dual programs for bipartite matching

At this point, we would like to explain the primal and dual programs for online bipartite matching. We shall use xi,j to denote whether i is matched to j or not. So, we would want xi,j to be either 0 or 1, and the size of the matching produced would be the sum of xi,j, which we would like to maximize. To ensure that it is a matching, we add the constraints that for each vertex, there must be at most one edge incident on the vertex.

We shall also use xi:=jRxi,j to denote whether vertex i is matched or not. We shall also relax this problem as follows :

Maximize iLjRxi,j=iLxi

subject to :

iLjNbd(i)xi,j1
jRiNbd(j)xi,j1
xi,j0

Minimize iLαi+jRβj

subject to :

(i,j)E,αi+βj1
iL,jR,αi0 and βj0

We have relaxed the xi,j’s from being {0,1} valued to instead allow any fraction : xi,j[0,1]. This means that the optimal value of the primal objective can only be larger now (since the graph is bipartite, the optimal value actually is the same), which means that the matching size obtained (the competitive ratio) will only be lower, compared to the primal optimal. Also note that if we are doing a fractional or a randomized matching, we would want xi,j to represent the fraction that i is matched to j or the probability of i being matched to j, ensuring that the expected size of matching is iL,jRxi,j and the change/increment in the primal value because of the vertex j is iLxi,j=iLΔxi.

The dual program represents the vertex cover problem, but we shall not use this fact in any way. Note the dual constraint αi+βj1. If a dual solution is not feasible, meaning that the solution does not satisfy αi+βj1 for all (i,j)E but instead satisfies αi+βjγ for some γ<1, then we shall call this solution γ-feasible.

In the analysis of our online algorithm, we will keep updating the primal and dual solutions. We shall use ΔP and ΔD to denote the increase in the primal and dual objectives, respectively. Similarly, we shall use Δxi and Δαi to refer to the increments in the corresponding variables.

The main idea that we use in our algorithms is an online primal-dual method, similar to the one used in prior work [14, 16]. We always maintain feasible primal and approximately feasible dual solutions. Whenever primal increases by some amount, we increase the dual by the same amount, so the primal and dual always have the same value. The primal will be feasible, so we would obtain an optimal solution if the dual were also feasible. However, we will be unable to maintain a feasible dual solution; instead, we will maintain an approximate feasible solution that satisfies the dual constraints with a slack of γ, in other words, be γ-feasible.

More specifically, we will always maintain the following throughout :

  • Approximate Dual Feasibility: For any iL and jR, αi+βjγ

  • Reverse Weak Duality: The objective value of the primal (P) and the objective value of the dual (D) satisfy that PD.

This is important because of the following claim.

Claim 4.

If the primal solution is feasible and has value P, and if the dual solution has objective value at most P, while being γ-feasible, then the primal value P is at least γ fraction of the primal optimal.

Proof.

Let M be the primal optimal. By strong duality, it is also the value of the dual optimal. Since the primal is feasible, PM. Let the dual solution have value DP. Since the dual solution is γ feasible, multiplying all the dual variables by 1γ gives a feasible dual solution with value DγM because it is feasible.

Hence DPMDγγMDPPMγ.

3 Techniques

While the algorithm that we suggest is extremely simple, the interesting part is the analysis. We use the online primal-dual method to prove that the algorithm is optimal. The primal variables are easy to update, given the algorithm. The tricky part is to update the dual variables: αi and βj. Indeed, there are other intuitive candidate algorithms for this problem, which we tried but were unable to analyse using the primal-dual approach.

On arrival of any vertex, jR, we try to increase the αi’s as much as possible and βj as little as possible while maintaining γ-competitive ratio. The key observation, in Lemma 9, is that given the primal variable of a vertex iL, one can determine a lower bound for the dual variable αi. Given this observation, it is sufficient to show that as the probability of i being matched approaches 1, the dual variable αi approaches γ.

4 Randomized Integral Matching

We start with a lower-bound construction first.

4.1 Lower Bound

Recall that η:=1i=1122i+i1. The following theorem shows that no online algorithm can achieve a competitive ratio better than η.

Theorem 5.

For Online Integral Bipartite Matching, no online algorithm (deterministic or randomized) can attain a competitive ratio better than η.

Proof.

We will use Yao’s principle to prove this. We shall first construct one particular graph G and then look at the uniform distribution over all graphs that are isomorphic to the described graph.

Refer to caption
Figure 1: The graph for the lower bound, with 8 online and offline vertices with online degree bounded by 2. The black edges correspond to online vertices in the first phase, the red ones correspond to the second phase and the green ones correspond to the third phase.

This graph will have n=2k online and 2k offline vertices for some integer k. We will describe the graph in phases. There will be k=logn phases in total. The online i-th vertex will always have an edge to the offline i-th vertex. Since the online vertices will have degree 2, it suffices to explain the other neighbor of the online vertex i. Figure 1 depicts this graph for k=3, with 2k=8 online and offline vertices.

This is where we will use the phases to describe the neighbors. In the first phase, there will be n2 online vertices: 1 through n2 and the i-th vertex would have the other edge to offline vertex n2+i. In the second phase, there will be n4 online vertices: n2+1 through nn4 and the n2+i-th vertex would have the other edge to offline vertex nn4+i. In the j-th phase, there will be n2j online vertices: nn2j1+1 through nn2j and the nn2j1+i-th vertex would have the other edge to offline vertex nn2j+i.

Notice that in the j-th phase, when an online vertex arrives, its neighbors’ degree changes from j1 to j.

Now using this graph, G, let us construct a distribution over graphs. We shall consider a set of all graphs that can be obtained from G, by a permutation of the offline vertices, and then take a uniform distribution over these graphs. The idea is to use Yao’s principle on this distribution and study the competitive ratio of deterministic algorithms. We shall compute the probability of offline vertices being matched, based on the phases. We shall consider any candidate deterministic algorithm for this.

Consider any offline vertex, u. If there is an online vertex, say v, in the j-th phase, with u as a neighbor of j, then we shall say that u “appeared” in the j-th phase. Notice that if u appeared in the j-phase, then u must have appeared in the phases 1,2,,j1 too. For every offline vertex, u, there will be a unique j such that u appeared in the j-th phase and then did not appear in any of the phases j+1,j+2, again.

Let us first look at offline vertices that appear in the first phase and then never again. The probability that such a vertex is matched is 12, and there are n2 such vertices.

Next, for vertices that appear in the second phase and never after that, we shall compute the probability that they are not matched. Let us consider one such vertex, u. For u not to be matched, it has to be necessarily unmatched when it appeared in the first phase. This would happen with probability 12. Also, when u appears in the second phase, the online vertex, say v, will have another neighbor, say i1. If i1 happened to be matched earlier, in phase 1, then u will get matched in the second phase. Therefore, for u to be unmatched i1 must be unmatched and then on the arrival of v the probability that the deterministic algorithm will leave u unmatched will be 12. Hence the probability that u is unmatched is 18.

For a vertex u that appears in the third phase and never thereafter, the probability that u is unmatched is 121818 because this is the case when u was unmatched even after phase two and i1, the competitor of u in phase three was also unmatched after phase two and in this case the probability of u being unmatched is 12.

Similarly, for a vertex that appears in the i-th phase and then never thereafter, the probability that such a vertex is unmatched is 122i1. Also, there are n2i such vertices that appear in the i-th phase and then never thereafter.

Hence, the expected number of vertices unmatched equals

i=1n22i+i1.

Therefore, the competitive ratio will be

1i=1122i+i1=η0.717772.

4.2 Upper Bound

In this section, we will show that the folklore half-half algorithm attains a competitive ratio of η. We begin by recalling the half-half algorithm, which can be described as follows. When an online vertex v comes, if it has only one unmatched neighbor, then match v with the unmatched neighbor. If both the neighbors of v are unmatched, then pick one uniformly at random and match it with v. The formal description of the algorithm is given in Algorithm 1.

Algorithm 1 Half-Half Algorithm.

4.2.1 Analysis of the half-half algorithm

Theorem 6.

The half-half algorithm attains a competitive ratio of η, where:

η:=1i=1122i+i1=114132121012190.717772.

Throughout the rest of the section, we are going to prove this theorem.

The plan is again to use the online Primal-Dual analysis. We will show that on the arrival of jR, with neighbors i1,i2L, we can update the primal such that the expected size of the matching produced is at least the value of the primal. Simultaneously we will set up βj and increment αi1,αi2 so that the dual conditions are η-feasible. We shall initialize by setting all the αi’s to 0, and βj will start off as 0 before we do the increments for the dual variables. We shall describe how to update the dual variables later. First, we will describe the updates to the primal variables.

Updating the Primal variables.

According to the algorithm, we can change the primal variables according to the following rule. We always maintain the primal variables to take values of the form 112p where p{0,1,2,3,}. If an online vertex j comes with neighbors {i1,i2}, and the old values of xi1 and xi2 are as follows:

xi1=112p1,xi2=112p2,

then the updated values would be

xi1=xi2=112p1+p2+1.

With this, the change in the primal value would be

ΔP=2(112p1+p2+1)(112p1)(112p2).
Claim 7.

Changing the primal in this way ensures that primal variables are always of the form 112p, and that the expected increment of matching size is at least the change in primal.

Proof.

First of all, it is clear from these updates that the primal variables are always of the form 112p. Had the events of i1 and i2 being unmatched been independent events, we could have said

[i1 is unmatched after j]=[i2 is unmatched after j]
=12[i1 and i2 were unmatched before j]=12p1+p2+1.

However, if the events are not independent, then there is only a negative correlation, i.e., given that i1 is unmatched, the probability of i2 being unmatched can only decrease. The proof is as follows. Conditioned on i1 being unmatched, every online vertex, with i1 as its neighbor, must have been matched to the offline vertex other than i1. Let us call this set of vertices S. Now, when these offline vertices from S, after being matched, were neighbors of some online vertex, say v, the online vertex v must have been matched to the other neighbor of v. We can update our S to include all such vertices that get matched in this manner. Continuing like this, the set S will consist of all vertices that are matched, conditioned on i1 not being matched. If any online vertex had i2 as its neighbor and a vertex from S as its other neighbor, i2 must have been matched conditioned on i1 not being matched. Otherwise, i1 being matched and i2 being matched are independent events. Hence,

[i1 is unmatched after j]=[i2 is unmatched after j]
=12[i1 and i2 were unmatched before j]12p1+p2+1.

We have already seen that the change in primal is

ΔP=2(112p1+p2+1)(112p1)(112p2)=12p1+12p222p1+p2+1.

Now we can compare this to the expected increase in matching size,

𝔼[ Increment in size of matching]
=[Either i1 or i2 was unmatched on arrival of j]
=[i1 was unmatched on arrival of j]+[i2 was unmatched on arrival of j]
[Both i1 and i2 were unmatched on arrival of j]
12p1+12p222p1+p2+1.

Thus,

𝔼[Increment in size of matching]ΔP,

and this proves the claim.

Updating the Dual variables.

Now that we have described how the primal variables are updated, we shall describe how to update the dual variables. As mentioned earlier, we will always maintain ΔPΔD. So, when online vertex j with neighbors i1,i2 arrives, we shall first compute ΔP and then try to set up αi1=αi2. The goal is to set up the α’s as high as possible, preferably to η, and assign the remainder of ΔP to βj if needed. This will ensure ΔPΔD. We would want αi1+βjη and also αi2+βjη, while simultaneously maintaining βj0. This would limit us from setting large α’s. It will be convenient to define the following notation.

Definition 8 (α(k)).

We define the quantity α(k) as follows: On arrival of the online vertex j with neighbors i1 and i2, suppose the primal variables xi1 and xi2 take the value 112k after the update, then the minimum value that the dual variables αi1 and αi2 are set (while maintaining η-feasibility and βj[0,1]) is the quantity α(k).

What we will show now is that it will always be possible for us to set the dual variables in order to maintain η-approximate dual feasibility.

We shall first show that for 1i3, we can set up α(i) to maintain approximate dual feasibility. After that, we will prove a general statement showing that we can assign appropriate dual variables for all xi.

Setting 𝜶(𝟏).

Let us first consider the case when the two neighbors i1,i2 had not appeared before. In this case, the half-half algorithm will set xi1=xi2=12. Observe that this is the only case when the xi will be set to 12, and hence the previous values of xi1,xi2 is 0. So, ΔP=1. Let us set αi1=αi2=α(1)=1η in this case, and βj to 2η1. This will ensure that ΔD=1=ΔP (recall, αi1 and αi2 were set to 0 at the beginning). Additionally, the dual constraints for the edges {i1,j},{i2,j} are η-satisfied.

Setting 𝜶(𝟐).

Let the neighbors of j be i1 and i2 with xi1=112 and xi2=0. Then the updated xi1=xi2=114 and notice that, up to symmetry, this is the only way for the primal variables to attain xi=114. In this case, ΔP=1. Updating αi1=αi2=α(2)=22η means that the increment in αi1+αi2 is (α(2)α(1))+(α(2)0)=((22η)(1η))+((22η)0) because for i1, with xi1=0, we had αi1=1η and for i2 we had αi2=0 before the arrival of j. Hence the total increment in αi1+αi2 is 33η. Therefore, assigning βj to ΔPΔαi1Δαi2=3η2 ensures that βj is positive and the increment in primal is equal to the increment in the dual. Also, for the edges, the dual constraints are η-satisfied since (22η)+(3η2)=η.

Setting 𝜶(𝟑).

There are two cases in this case.

  1. 1.

    In the first case, let the neighbors of j be i1 and i2 with xi1=xi2=112 before the arrival of j. According the the change in primal values, both xi1 and xi2 would be set to 118 after the update. Therefore, ΔP=2(118)1212=34. Also, αi1 and αi2 used to be α(1)=1η before j arrived. If we update αi1 and αi2 to α(3), then we can set βj to ΔP(2α(3)2(1η)) in order to ensure that the change in dual is at most the change in primal. However, after the update, the edge corresponding to {i1,j} must satisfy approximate dual feasibility. Hence, we must have βj+α(3)η, implying 34α(3)+22ηη. Therefore α(3)1143η.

  2. 2.

    In the second case, if the two neighbors i1 and i2 had xi1=114 and xi2=0 (i.e. i2 not having appeared before) even then both xi1 and xi2 would be set to 118 after the update. It can be checked that in this case, ΔP=1 and hence we can set αi1=αi2=η, while keeping βj=0.

Considering both these cases, we can ensure that αi1,αi2 will certainly be set to at least 1143η and hence α(3)=1143η.

Setting 𝜶(𝒌) for 𝒌𝟒.

As we have seen till now, we can set up the α variables so that approximate dual feasibility is satisfied.

The next lemma gives a strategy for the remaining cases to set the dual variables so that the Dual is η-feasible.

Lemma 9.

For every k4, there is a fixed α(k) such that whenever the primal variables are set to 112k, one can set the value of the corresponding dual variables α such that αα(k) while ensuring ΔDΔP, βj[0,1] and the η-approximate dual feasibility. More specifically, the algorithm sets α(k) to be η whenever k is not of the form 2m1 (for some integer m), otherwise

α(2m1)i=1m12m1i(122i2122(2i2)+2)+2m1(2m1)η.

Before we prove this lemma, let’s first see why this is enough to prove the main theorem.

Proof of Theorem 6.

It is easy to see that proving this lemma completes the proof. This is because, after the arrival of j, i1 and i2 are more likely to be matched and hence xi1 and xi2 increase. We have seen that xi may only take values of the form 112k for some integer k. For k=1 to 3, we have explicitly checked that we can always satisfy reverse weak duality and η-approximate dual feasibility. For any larger value of k, the Lemma 9 tells us that we will always be able to set up the dual variables while satisfying reverse weak duality and η-approximate deal feasibility. Hence, we shall always be able to update the dual variables in this manner, for all k and therefore the Half-half Algorithm would be η-competitive.

We now prove Lemma 9.

Proof of Lemma 9.

The proof will be by induction on k. Let us assume that α(k) follows the lemma up to some k<T.

We will need to check the base cases for k=4,5,6,7 after which the proof follows by induction. The calculations are exactly like that for k=1,2,3. We provide a table of values here for each k. This table describes how the dual variables are set for that particular k. Each row describes a different initial setting of xi1 and xi2 that can lead to xi1=xi2=112k. The reader may check that these updates satisfy ΔPΔD and η-approximate dual feasibility and satisfy Lemma 9.

For k=𝟒,

xi1 xi2 ΔP Old αi1 Old αi2 New αi1=αi2 βj
0 118 1 0 1143η η 0
12 114 12+1418 1η 22η η 0

For k=𝟓,

xi1 xi2 ΔP Old αi1 Old αi2 New αi1=αi2 βj
0 1116 1 0 η η 0
12 118 12+18116 1η 1143η η 0
14 14 14+14116 22η 22η η 0

For k=𝟔,

xi1 xi2 ΔP Old αi1 Old αi2 New αi1=αi2 βj
0 1132 1 0 η η 0
12 1116 12+116132 1η η η 0
14 18 14+18132 22η 1143η η 0

For k=𝟕,

xi1 xi2 ΔP Old αi1 Old αi2 New αi1=αi2 βj
0 1164 1 0 η η 0
12 1132 12+132164 1η η η 0
14 116 14+116164 22η η η 0
18 18 18+18164 1143η 1143η 367647η 8η36764

For T, we can have three cases: (1) T is of the form 2m1 for some m. (2) T is of the form 2m1+2m21, or (3) T is not of these forms.

Case 3.

We note that

α(T)=mink{0,1,2,,T12}[(12k+12T1k12T1)+α(k)+α(T1k)η]

can be achieved by putting the entire ΔP into α without increasing the β. Now, considering the case we are in, we know that either α(k) or α(T1k) is η (inductive hypothesis). Since the other α already had value more than η(1xi) (this can be seen from the fact that α(T) converges to η as T tends to and the total value added to α(T), at any point, is at most the increment in xi) and observe that ΔP(1xi). Therefore, the alpha can be increased to η.

Case 1.

In this case T=2m1 for some m.

α(2m1)=mink{0,1,2,,2m11}(12k+122mk2122m2)+α(k)+α(2mk2)η

Note that the minimum occurs when k=2m11 (on top of this, we need to show that ΔPΔα0, so that β can be set to a value in [0,1]). In this case,

α(2m1) =(122m11+122m2m1+12122m2)+α(2m11)+α(2m2m1+12)η
=i=1m12m1i(122i2122(2i2)+2)+2m1(2m1)η.

as required. Now, we need to show that the following quantity is non-negative.

ΔPΔα =(122m11+122m11122m2)2(α(2m1)α(2(m1)1)).
=(122m11+122m11122m2)2(α(2m1)α(2(m1)1)).
=(122m12122m2)2(α(2m1)α(2(m1)1)).

We have the following claim.

Claim 10.

The quantity (122m12122m2)2(α(2m1)α(2(m1)1)) is non-negative for all values of m1.

Proof.

We first simplify the last term.

(α(2m1)α(2(m1)1))
=(i=1m12m1i(122i2122(2i2)+2)+2m1(2m1)η)
(i=1m22m2i(122i2122(2i2)+2)+2m2(2m11)η.)
=12(122m12122(2m12)+2)+(2m12m2)(2m2m1)η
+i=1m1(2m1i2m2i)(122i2122(2i2)+2)
=12(122m12122(2m12)+2)+2m22m1(1i=1122i+i1)
+i=1m12m2i(122i2122(2i2)+2)
=12(122m12122(2m12)+2)2m2+2m2i=1222i+i1
+2m2i=1m112i(122i2122(2i2)+2).

Now,

2(α(2m1)α(2(m1)1)) =(122m12122(2m12)+2)2m1+2m1i=1222i+i1
+2m1i=1m112i(122i2122(2i2)+2)
=(122m12122m2)2m1+2m1i=1222i+i1
+2m1i=1m112i(122i2122(2i2)+2).

Therefore,

ΔPΔα =2m12m1i=1222i+i12m1i=1m112i(122i2122(2i2)+2)
=2m1(1i=1222i+i1i=1m112i(122i2122(2i2)+2))
=2m1(1i=1222i+i1i=1m1(222i+i112(2i+1+i2))).

Now, we simplify the last summation as follows

i=1m1(222i+i112(2i+1+i2)) =i=1m1(222i+i112(2(i+1)+(i+1)3))
=i=1m1(222i+i142(2(i+1)+(i+1)1))
=222i=2m1222i+i142(2m+m1)

Hence,

ΔPΔα =2m1(1i=1222i+i1i=1m1(222i+i112(2i+1+i2)))
=2m1(1i=1222i+i1222+i=2m1222i+i1+42(2m+m1))
=2m1(1222i=m222i+i1222+42(2m+m1))
=2m1(42(2m+m1)i=m222i+i1)0.

Given the claim, we can see that ΔPΔα0, allowing us to set βj0.

Case 2.

In the case when T is of the form 2m1+2m21 (where m1>m2), we will try to find out α(T) using α(2m11) and α(2m21). For all other instances in which we end up with α(T), at least one of the offline vertices will already have α set to η so like case 1, we are in good shape. Hence we just need to consider the case when one offline vertex, say i1, had xi1 at 1122m11 and the other vertex, i2, had xi2 at 1122m21.

First of all, we note that

ΔP=122m11+122m21222m1+2m21.

The plan is to put all the ΔP into both the α values and confirm that indeed we can make both the α values equal to η, without incrementing the β.

This can be achieved iff ΔP is at least 2ηα(2m11)α(2m21). The following claim precisely shows this.

Claim 11.

ΔP2ηα(2m11)α(2m21).

Proof.

We show that ΔP2η+α(2m11)+α(2m21) is non-negative as follows.

ΔP2η+α(2m11)+α(2m21)
=122m11+122m21222m1+2m21+i=1m112m11i(122i2122(2i2)+2)+
i=1m212m21i(122i2122(2i2)+2)+2m11+2m21(2m1+2m2)η
=122m11+122m21222m1+2m21+2m11+2m21(2m1+2m2)η+
2m11(12i=2m11222i+i142(2m1+m11))+
2m21(12i=2m11222i+i142(2m1+m11))
=122m11122m21222m1+2m21+
2m11(12+2i=1122i+i1+12i=2m11222i+i1)+
2m21(12+2i=1122i+i1+12i=2m21222i+i1)
=122m11122m21222m1+2m21+2m11(i=m1222i+i1)+
2m21(i=m2222i+i1)
0

5 Fractional Matching

In this section, we prove a lower bound on the competitive ratio of any algorithm for fractional matching and then give an online algorithm that achieves the best attainable competitive ratio.

5.1 Lower Bound

Theorem 12.

No online algorithm can attain a competitive ratio better than 0.75 for online fractional bipartite matching.

Proof.

Consider a graph with two offline vertices i1 and i2. The first online vertex will have edges to both i1 and i2 while the second online vertex will have an edge to only one of the vertices. The optimal matching is of size 2 but one can see that no online algorithm can attain a competitive ratio better than 0.75 using this graph.

5.2 Upper Bound

For the fractional matching, we shall consider the water-level algorithm which was an optimal algorithm for the case without the degree bound.

Algorithm 2 Water-Level Algorithm.

We show that the same algorithm gives the optimal algorithm for the degree 2 case.

Theorem 13.

Water-level algorithm attains a competitive ratio of 0.75 when the vertices have a degree at most 2.

Proof.

We shall use the primal-dual analysis for this. The main idea is to maintain the value of the fractional matching produced by water level and simultaneously maintain dual variables.

We already know how the primal variables are updated by water level, given the algorithm. We will now explain how the dual variables will be updated to maintain reverse weak duality and weak dual feasibility.

Let us define xi:=jRxi,j. The variable xi denotes how much the vertex i is matched. We will maintain the αi’s such that, given xi, we will know exactly what αi is. Thus, we will know how much αi increases by considering how much xi was incremented by water level. Given the increments in αi’s, we will know what value to set βj because we will maintain that the primal and dual objectives will always be the same. So, the dual objective will be increased by the same amount as the primal, which is the amount of matching done by the water level algorithm on the arrival of online vertex j.

Hence, first, we will describe how to maintain the αi’s.

For the first half fraction of the matching, for any vertex iL, if a fractional matching of size p is done between i and jR, then we shall increment αi by p/2 and βj by p/2. Whereas, if u is already matched more than 0.5, then for a matching of size x, we shall increment αi by x, and we shall not increment βj at all.

Firstly, note that we never decrease any dual variables. So if some dual constraint is satisfied at a given time then it will certainly be satisfied in the future. We shall now see that whenever a new vertex jR arrives, both the newly introduced edges (i1,j) and (i2,j) satisfy approximate dual feasibility. This will complete the proof.

In order to observe the approximate dual feasibility, we shall look at a few cases based on how much i1 and i2 were matched right before the arrival of j.

  1. 1.

    𝒊𝟏 and i𝟐 are completely unmatched.

    Notice that in this case, the water-level algorithm will match j half to i1 and a half to i2, and the primal increases by 1. Let us see how the dual variables are updated. Since xi1 and xi2 are both at 0.5 we will have αi1=αi1=0.25 which adds 0.5 to the dual objective. Hence, we can add 0.5 to βj.

    Therefore αi1+βj=αi2+βj=0.75

  2. 2.

    𝒊𝟏 is xi𝟏 fraction matched and i𝟐 is completely unmatched

    We will assume that i1 is xi1 fraction matched where xi10. First, we note that the water-level algorithm maintains that if xi10, then we must have xi10.5. In other words, if a vertex iL starts getting matched, it will be matched at least till the half-level mark. Hence we may assume xi10.

    In this case, water-level algorithm will first match xi1 fraction of vertex i2 to j and then 1xi12 to i1 and 1xi12 to i2. This will mean that 1+xi12 will be the updated value of xi1 and xi2 after vertex j is matched fractionally.

    Hence, after the matching αi1=αi2=0.25+xi12 and βj=0.25. Therefore αi1+βj=αi2+βj=0.5+xi120.75 since xi1 was greater than 12.

    Note that the case where i1 is completely unmatched but i2 is partially matched is symmetric.

  3. 3.

    𝒊𝟏 is xi𝟏 fraction matched and i𝟐 is xi𝟐 fraction matched

    In this last case, when both i1 and i2 were partially matched to begin with (hence, at least half matched as stated earlier), we can see that the water-level algorithm would end up matching i1 and i2 to j - whatever fraction of i1 and i2 was still unmatched. After this, we will have xi1=xi2=1 and therefore αi1=αi2=0.75 and therefore αi1+βj=αi2+βj=0.75.

6 Conclusion

An interesting open problem is finding the right competitive ratios for the integral online bipartite matching for (online) degree d unweighted graphs. If we denote the competitive ratios by (d), for fractional, and (d), for integral, respectively, then we have shown that (2)=0.717772. Given that (2)=0.75, it would be interesting to find the values of (d) when d3 and compare them with (d) especially given that we know both (d) and (d) approach 11e as d approaches infinity. We conjecture that (d) and (d) will be different for all d2.

It is also interesting to ask the more general question: given an algorithm that computes fractional solutions for a given class of graphs, how well can we round a fractional solution into a randomized integral solution?

References

  • [1] Susanne Albers and Sebastian Schubert. Online ad allocation in bounded-degree graphs. In Kristoffer Arnsfelt Hansen, Tracy Xiao Liu, and Azarakhsh Malekian, editors, Proc. 18th International Conference on Web and Internet Economics (WINE), volume 13778 of LNCS, pages 60–77. Springer, 2022. doi:10.1007/978-3-031-22832-2_4.
  • [2] Susanne Albers and Sebastian Schubert. Tight bounds for online matching in bounded-degree graphs with vertex capacities. In Shiri Chechik, Gonzalo Navarro, Eva Rotenberg, and Grzegorz Herman, editors, Proc. 30th Annual European Symp. of Algorithms (ESA), volume 244 of LIPIcs, pages 4:1–4:16. Schloss Dagstuhl, 2022. doi:10.4230/LIPICS.ESA.2022.4.
  • [3] Yossi Azar, Ilan Reuven Cohen, and Alan Roytman. Online lower bounds via duality. In Philip N. Klein, editor, Proc. 28th Annual ACM-SIAM Symp. on Discrete Algorithms (SODA), pages 1038–1050, 2017. doi:10.1137/1.9781611974782.66.
  • [4] Claude Berge. Two theorems in graph theory. PNAS, 43(9):842–844, 1957. doi:10.1073/pnas.43.9.842.
  • [5] Guy Blanc and Moses Charikar. Multiway online correlated selection. In Jelani Nelson, editor, Proc. 63rd IEEE Symp. on Foundations of Comp. Science (FOCS), pages 1277–1284, 2022. doi:10.1109/FOCS52979.2021.00124.
  • [6] Niv Buchbinder, Kamal Jain, and Joseph (Seffi) Naor. Online primal-dual algorithms for maximizing ad-auctions revenue. In Lars Arge, Michael Hoffmann, and Emo Welzl, editors, Proc. 15th Annual European Symp. of Algorithms (ESA), volume 4698 of LNCS, pages 253–264. Springer, 2007. doi:10.1007/978-3-540-75520-3_24.
  • [7] Niv Buchbinder and Joseph (Seffi) Naor. The design of competitive online algorithms via a primal-dual approach. Found. Trends Theor. Comput. Sci., 3(2-3):93–263, 2009. doi:10.1561/0400000024.
  • [8] Niv Buchbinder, Joseph (Seffi) Naor, and David Wajc. Lossless online rounding for online bipartite matching (despite its impossibility). In Nikhil Bansal and Viswanath Nagarajan, editors, Proc. 34th Annual ACM-SIAM Symp. on Discrete Algorithms (SODA), pages 2030–2068, 2023. doi:10.1137/1.9781611977554.CH78.
  • [9] Deeparnab Chakrabarty and Gagan Goel. On the approximability of budgeted allocations and improved lower bounds for submodular welfare maximization and GAP. SIAM J. Comput., 39(6):2189–2211, 2010. (Preliminary version in 49th FOCS, 2008). doi:10.1137/080735503.
  • [10] Denis Xavier Charles, Max Chickering, Nikhil R. Devanur, Kamal Jain, and Manan Sanghi. Fast algorithms for finding matchings in lopsided bipartite graphs with applications to display ads. In David C. Parkes, Chrysanthos Dellarocas, and Moshe Tennenholtz, editors, Proc. 11th ACM Conf. Electronic Commerce (EC), pages 121–128. ACM, 2010. doi:10.1145/1807342.1807362.
  • [11] Ilan Reuven Cohen and Binghui Peng. Primal-dual schemes for online matching in bounded degree graphs. In Inge Li Gørtz, Martin Farach-Colton, Simon J. Puglisi, and Grzegorz Herman, editors, Proc. 31st Annual European Symp. of Algorithms (ESA), volume 274 of LIPIcs, pages 35:1–35:17. Schloss Dagstuhl, 2023. doi:10.4230/LIPICS.ESA.2023.35.
  • [12] Ilan Reuven Cohen and David Wajc. Randomized online matching in regular graphs. In Artur Czumaj, editor, Proc. 29th Annual ACM-SIAM Symp. on Discrete Algorithms (SODA), pages 960–979, 2018. doi:10.1137/1.9781611975031.62.
  • [13] Nikhil R. Devanur and Thomas P. Hayes. The adwords problem: online keyword matching with budgeted bidders under random permutations. In John Chuang, Lance Fortnow, and Pearl Pu, editors, Proc. 10th ACM Conf. on Electronic Commerce (EC), pages 71–78. ACM, 2009. doi:10.1145/1566374.1566384.
  • [14] Nikhil R. Devanur, Kamal Jain, and Robert D. Kleinberg. Randomized primal-dual analysis of RANKING for online bipartite matching. In Sanjeev Khanna, editor, Proc. 24th Annual ACM-SIAM Symp. on Discrete Algorithms (SODA), pages 101–107, 2013. doi:10.1137/1.9781611973105.7.
  • [15] Tomer Ezra, Michal Feldman, Nick Gravin, and Zhihao Gavin Tang. Online stochastic max-weight matching: Prophet inequality for vertex and edge arrival models. In Péter Biró, Jason D. Hartline, Michael Ostrovsky, and Ariel D. Procaccia, editors, Proc. 21st ACM Conf. Economics and Comput. (EC), pages 769–787. ACM, 2020. doi:10.1145/3391403.3399513.
  • [16] Matthew Fahrbach, Zhiyi Huang, Runzhou Tao, and Morteza Zadimoghaddam. Edge-weighted online bipartite matching. J. ACM, 69(6):45:1–45:35, 2022. (Preliminary version in 61st FOCS, 2020). doi:10.1145/3556971.
  • [17] Jon Feldman, Monika Henzinger, Nitish Korula, Vahab S. Mirrokni, and Clifford Stein. Online stochastic packing applied to display ad allocation. In Mark de Berg and Ulrich Meyer, editors, Proc. 18th Annual European Symp. of Algorithms (ESA), Part I, volume 6346 of LNCS, pages 182–194. Springer, 2010. doi:10.1007/978-3-642-15775-2_16.
  • [18] Jon Feldman, Nitish Korula, Vahab S. Mirrokni, S. Muthukrishnan, and Martin Pál. Online ad assignment with free disposal. In Stefano Leonardi, editor, Proc. 5th International Workshop on Internet and Network Economics (WINE), volume 5929 of LNCS, pages 374–385. Springer, 2009. doi:10.1007/978-3-642-10841-9_34.
  • [19] Jon Feldman, Aranyak Mehta, Vahab S. Mirrokni, and S. Muthukrishnan. Online stochastic matching: Beating 11e. In Daniel A. Spielman, editor, Proc. 50th IEEE Symp. on Foundations of Comp. Science (FOCS), pages 117–126, 2009. doi:10.1109/FOCS.2009.72.
  • [20] Buddhima Gamlath, Michael Kapralov, Andreas Maggiori, Ola Svensson, and David Wajc. Online matching with general arrivals. In David Zuckerman, editor, Proc. 60th IEEE Symp. on Foundations of Comp. Science (FOCS), pages 26–37, 2019. doi:10.1109/FOCS.2019.00011.
  • [21] Ruiquan Gao, Zhongtian He, Zhiyi Huang, Zipei Nie, Bijun Yuan, and Yan Zhong. Improved online correlated selection. In Nisheeth Vishnoi, editor, Proc. 62nd IEEE Symp. on Foundations of Comp. Science (FOCS), pages 1265–1276, 2021. doi:10.1109/FOCS52979.2021.00123.
  • [22] Gagan Goel and Aranyak Mehta. Online budgeted matching in random input models with applications to adwords. In Shang-Hua Teng, editor, Proc. 19th Annual ACM-SIAM Symp. on Discrete Algorithms (SODA), pages 982–991, 2008. URL: http://dl.acm.org/citation.cfm?id=1347082.1347189.
  • [23] Bernhard Haeupler, Vahab S. Mirrokni, and Morteza Zadimoghaddam. Online stochastic weighted matching: Improved approximation algorithms. In Ning Chen, Edith Elkind, and Elias Koutsoupias, editors, Proc. 7th International Workshop on Internet and Network Economics (WINE), volume 7090 of LNCS, pages 170–181. Springer, 2011. doi:10.1007/978-3-642-25510-6_15.
  • [24] Richard M. Karp, Umesh V. Vazirani, and Vijay V. Vazirani. An optimal algorithm for on-line bipartite matching. In Harriet Ortiz, editor, Proc. 22nd ACM Symp. on Theory of Computing (STOC), pages 352–358, 1990. doi:10.1145/100216.100262.
  • [25] Harold W. Kuhn. The Hungarian method for the assignment problem. Naval Research Logistics Quarterly, 2(1-2):83–97, 1955. doi:10.1002/nav.3800020109.
  • [26] Benny Lehmann, Daniel Lehmann, and Noam Nisan. Combinatorial auctions with decreasing marginal utilities. Games Econ. Behav., 55(2):270–296, 2006. doi:10.1016/J.GEB.2005.02.006.
  • [27] Aranyak Mehta. Online matching and ad allocation. Found. Trends Theor. Comput. Sci., 8(4):265–368, 2013. doi:10.1561/0400000057.
  • [28] Aranyak Mehta, Amin Saberi, Umesh V. Vazirani, and Vijay V. Vazirani. Adwords and generalized online matching. J. ACM, 54(5):22, 2007. (Preliminary version in 46th FOCS, 2005). doi:10.1145/1284320.1284321.
  • [29] Joseph (Seffi) Naor and David Wajc. Near-optimum online ad allocation for targeted advertising. ACM Trans. Economics and Comput., 6(3-4):16:1–16:20, 2018. (Preliminary version in 16th EC, 2015). doi:10.1145/3105447.
  • [30] Yongho Shin and Hyung-Chan An. Making three out of two: Three-way online correlated selection. In Hee-Kap Ahn and Kunihiko Sadakane, editors, Proc. 32nd International Symposium on Algorithms and Computation (ISAAC), volume 212 of LIPIcs, pages 49:1–49:17. Schloss Dagstuhl, 2021. doi:10.4230/LIPICS.ISAAC.2021.49.