Manuscript Offprint
arXiv:2611.12210Tight Competitive Bounds for Online Matching on Forests
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
— Abstract
We study the online matching problem, its fractional relaxation, and the fractional online vertex cover problem on forests whose edges arrive one at a time in an arbitrary order. Matching decisions are irrevocable, and vertex-cover weights can only increase over time. For online matching, we present a randomized algorithm with expected competitive ratio 4/7 against an oblivious adversary, improving the previous 5/9 guarantee. We also present a deterministic algorithm that simultaneously maintains a 4/7-competitive fractional matching and a 7/4-competitive fractional vertex cover. This deterministic algorithm improves the previous 5/9 guarantee for fractional matching and the 11/6 guarantee for fractional vertex cover. We prove that 4/7 is optimal for both randomized and fractional matching, even on growing trees of maximum degree four.
2012 ACM Subject Classification Mathematics of computing → Discrete mathematics; Theory of computation → Online algorithms
Keywords and phrases Online matching, fractional matching, fractional vertex cover, trees, competitive analysis
Funding This work is a result of research conducted within research project number 2023/51/B/ST6/02833 financed by the National Science Centre, Poland (Bartłomiej Bosek, Grzegorz Gutowski, Paweł Putra and Anna Zych-Pawlewicz).
A greedy deterministic algorithm guarantees a solution half the size of a maximum matching, and there is no hope for a deterministic algorithm to beat the competitive ratio of even on a path of length three. Thus, the question of whether one could beat the ratio of using randomization was a central open question in the area for a long time. Recently
Tight Competitive Bounds for Online Matching on Forests
Gamlath, Kapralov, Maggiori, Svensson and Wajc [12] showed that we cannot hope for that either, even on bipartite graphs.
This motivates studying the edge arrival model on more restricted classes of graphs. The most widely considered restriction in the literature is to forests. The pessimistic online bounds for deterministic algorithms also apply to this class; however, we can achieve better guarantees for randomized algorithms. Buchbinder, Segev and Tkach gave a randomized algorithm with competitive ratio [9, 10] and proved that this guarantee is optimal within their MIN-INDEX framework. Their upper bound for unrestricted algorithms is approximately 0.5914, even on trees of maximum degree three. We close this gap at . Our algorithm handles arbitrary edge orders, whereas the matching upper bound already holds on growing trees: after the initial edge, each arrival attaches a new leaf to the existing tree.
In pursuit of this goal, we study the fractional online matching and the fractional vertex cover problem on forests in the edge arrival model. In the fractional online matching problem, each arriving edge receives an irrevocable weight from , so that at any vertex the weights of adjacent edges sum up to at most one. The objective is to maximize the sum of the assigned weights. In the fractional vertex cover problem, vertices receive weights from so that every presented edge is covered, i.e., the weights assigned to its endpoints sum up to at least one. The objective is to minimize the total weight of the vertices, and the decisions are irrevocable in the sense that we may only ever increase the weights assigned to the vertices from one step to the next. For the matching, a competitive ratio means that after every edge arrival the weight of the matching is at least times the offline optimum, whereas for the vertex cover a competitive ratio of means that the weight of the vertex cover is at most times the optimum.
Fractional matching and fractional vertex cover are linear-programming duals, and their offline optima coincide. The online requirements are different, however: matching weights are fixed at arrival, whereas cover weights must remain nondecreasing as constraints are revealed. An offline dual certificate in the analysis of a fractional online matching algorithm does not immediately translate to an online fractional vertex cover algorithm. Indeed, for fractional matching on forests, the result of Buchbinder, Segev and Tkach [10] implies a -competitive algorithm, while for fractional vertex cover on forests, Baligács et al. [1] obtain an -competitive algorithm under edge arrivals. The two algorithms differ substantially. Both solutions [1,10] use weak duality in the analysis, but neither constructs a fractional matching and a fractional vertex cover at the same time in an online manner.
We improve both of the results above with one online algorithm, which constructs both a fractional online matching and a fractional online vertex cover at the same time, providing competitive ratios of and , respectively. We show that no algorithm achieves a constant competitive ratio of for fractional matching. This also implies that no randomized online matching algorithm achieves an expected competitive ratio of , as we discuss in the next section. Our hard instance is a growing tree, implying the same hardness in the easier vertex arrival model, and thus establishing tight competitive ratios for the online matching in the vertex arrival model on forests as well.
For matching, we also show how to adapt the fractional algorithm to obtain a randomized online algorithm with the same competitive ratio.
Our results. We prove the following guarantees.
► Theorem 1. In the edge arrival model on forests, there is a deterministic algorithm that simultaneously maintains a -competitive fractional matching and a -competitive fractional vertex cover.
► Theorem 2. In the edge arrival model on forests, there is a randomized online matching algorithm with expected competitive ratio 4/7 against an oblivious adversary.
► Theorem 3. For every constant there is a growing tree of maximum degree four on which no fractional or randomized online matching algorithm is c-competitive.
Outline. Section 2 summarizes related work. Section 3 defines the problems and the arrival model. Section 4 provides and analyzes the algorithm for both fractional problems. Section 5 constructs and analyzes the randomized matching algorithm. Section 6 proves the matching hardness.
2 Related work
The online matching problem dates back to the breakthrough work of Karp, Vazirani and Vazirani [14] in 1990. The authors studied online matching in an easier one-sided vertex arrival model on bipartite graphs. This setting and its generalizations have applications in ad auctions [7]. In the vertex arrival model, the vertices arrive one at a time together with all the edges connecting to the vertices presented so far. The one-sided version assumes that only the vertices on one side of the bipartition arrive in an online fashion, while the vertices on the other side are known up front to the algorithm. Due to the upper bound of for the competitive ratio of any deterministic algorithm, the authors in [14] turn to randomization and show a widely celebrated RANKING algorithm, which admits a (tight) competitive ratio of . The RANKING algorithm was further studied in several more works [3,11], resulting in a relatively simple primal-dual analysis [11] that provided the basis for future work. Fractional online matching was also studied in the one-sided vertex arrival model, resulting in an elegant water filling algorithm with a -competitive ratio [7]. The water-filling algorithm constructs a feasible dual solution online; for RANKING, the dual variables are also constructed online, but feasibility holds in expectation.
Wang and Wong [19] studied the dual fractional vertex cover problem under vertex arrivals and observed that it generalizes the ski-rental problem. If one restricts vertex weights to , thus obtaining the integral online vertex cover problem, one immediately hits a tight competitive ratio of 2 for deterministic algorithms, attained by a simple greedy algorithm [4,5]. Wang and Wong [19] provide an -competitive algorithm for the fractional variant in the one-sided vertex arrival model. This competitive ratio is the reciprocal of the ratio of the RANKING algorithm. Their algorithm constructs the vertex cover and the matching simultaneously, and the competitive ratio follows naturally from weak duality. More interestingly, the algorithm of Wang and Wong [19] can be applied to the general vertex arrival model, where it achieves a competitive ratio of for the fractional online vertex cover problem, while the best known lower bound is approximately 1.8244 [15]. As a byproduct, from the primal-dual analysis Wang and Wong derive a competitive ratio of for the fractional online matching problem in the general vertex arrival model, later shown tight by Tang [17]. Subsequently, Gamlath, Kapralov, Maggiori, Svensson and Wajc [12] show how to round the weights produced by the algorithm of Wang and Wong to obtain a randomized algorithm for the online matching problem in the general vertex arrival model, achieving a competitive ratio strictly larger than , thus answering a long-standing open problem.
The edge arrival model turns out to be substantially harder for the algorithm. In the same paper [12], it was shown that there is no algorithm for online fractional matching
Tight Competitive Bounds for Online Matching on Forests
achieving a competitive ratio larger than by any constant. Hardness for fractional online matching immediately implies the same hardness for randomized online matching: every randomized online matching induces a fractional one by assigning each edge its probability of being selected. The converse is more delicate: Buchbinder, Naor and Wajc [8] study the constraints that make lossless rounding possible. Just recently, Tang and Zhang showed that also for the fractional vertex cover problem under edge arrivals one cannot hope for a competitive ratio smaller than 2 [18], even on bipartite graphs. These hardness results make structural restrictions essential for improving the competitive guarantees under edge arrivals.
Buchbinder, Segev and Tkach [10] established a -competitive randomized online matching algorithm for forests. Taking the probabilities of accepting the edges as their weights yields a fractional algorithm with the same guarantee. Their MIN-INDEX framework maintains an ordered collection of matchings. Each arriving edge is added to the first matching that can accept it, or rejected if none can. The output matching is chosen according to probabilities fixed in advance. They show that no instantiation of this framework achieves a competitive ratio greater than on forests. For graphs of maximum degree known in advance, they also give a deterministic algorithm that maintains a fractional matching and a fractional vertex cover simultaneously online, with competitive ratio for matching and its reciprocal for vertex cover. For this gives and , respectively, but the matching guarantee tends to as grows.
Buchbinder, Segev and Tkach [10] also give a hardness bound for fractional matching of which holds already for growing trees with maximum degree three. Pashkovich and Snow [16] subsequently attained this bound for fractional online matching on all graphs of maximum degree three, thus closing the problem of fractional online matching for this class of graphs. They also show that no randomized algorithm achieves a competitive ratio larger than 0.5807 on graphs of maximum degree three, and no fractional algorithm achieves a competitive ratio larger than 0.5889 on graphs of maximum degree four. Our results determine the optimal fractional and randomized ratios for forests without degree restrictions. Moreover, our upper bound for fractional matching on forests improves the upper bound of [16] within the class of graphs of maximum degree four, as our construction is in fact a growing tree of maximum degree four. For fractional vertex cover on forests under edge arrivals [1] gave an -competitive algorithm, which our algorithm improves to .
Bromblik [6] established a lower bound of for online fractional vertex cover on trees under edge arrivals. Together with our 7/4-competitive algorithm, this leaves a gap between and for the optimal competitive ratio.
In [1] the authors consider the fractional vertex cover problem also in the incremental model, when the entire edge arrival sequence is known in advance. For that model, they prove an optimal ratio of . Our hardness bound for fractional matching applies also in the incremental model, proving that even if the entire future is known in advance, the fractional matching algorithm still cannot be better than -competitive.
Independently of our work, Bienkowski [2] developed an algorithm for forests under edge arrivals that simultaneously maintains a fractional vertex cover and a fractional matching, with competitive ratios and , respectively. Our fractional algorithm improves these guarantees to and , respectively.
There has been work on online matching on forests with free disposal, where one is allowed to discard edges previously accepted to the matching. In this model, Jiang and Zhang [13] obtained the optimal randomized ratio on growing trees, and a randomized ratio on general forests. These guarantees do not apply to the irrevocable decisions that we consider in this paper.
3 Preliminaries
For a graph , a matching is a set of edges with disjoint endpoints, and a vertex cover is a set of vertices containing at least one endpoint of every edge. A fractional matching assigns weight to each edge such that for every vertex ; its value is . A fractional vertex cover assigns weight to each vertex such that every edge is covered, meaning ; its cost is . On forests, all four problems have the same optimum value, by König's theorem and weak duality.
We consider randomized algorithms for matching and deterministic algorithms for fractional matching and fractional vertex cover.
In the online edge arrival model, an oblivious adversary fixes a graph and an edge order in advance. The algorithm knows and receives the edges one at a time. After arrival , it must maintain a feasible solution for , using only the revealed prefix and its own random choices.
Matching decisions are made upon arrival and are irrevocable: the maintained matching satisfies , with . A fractional matching algorithm assigns each arriving edge an irrevocable weight . A fractional vertex-cover algorithm maintains vertex weights that start at zero and can only increase.
The objective is to maximize matching cardinality or fractional matching value, or to minimize fractional vertex-cover cost. Write for the cardinality, value, or cost of the maintained solution and for the corresponding offline optimum on . An algorithm is -competitive if, for every input and every ,
The expectation is over the algorithm's random choices.
4 Fractional algorithm
Our algorithm is based on linear programming duality between fractional matching and fractional vertex cover. Recall that the fractional matching problem on a graph is the linear program on the left, and the fractional vertex cover problem is its dual, on the right:
Observe that every optimal solution of either linear program assigns weights at most 1. By weak duality, the value of every fractional matching of is at most the cost of every fractional vertex cover of .
The previous 5/9-competitive matching algorithm of Buchbinder, Segev and Tkach [10] and the 11/6-competitive vertex cover algorithm of [1] use duality to prove their competitive guarantees. In these analyses, the dual solution serves as a proof certificate; it is not maintained as a second online solution. The certificates are constructed for each input prefix, and their evolution need not satisfy the online constraints. For example, in the analysis of the matching algorithm of [10], the dual vertex cover may decrease vertex weights when two
Tight Competitive Bounds for Online Matching on Forests
trees are joined. Such decreases violate the online vertex-cover constraints, so this certificate does not yield an online vertex-cover algorithm [18]. Our algorithm uses duality in a stronger, constructive sense: it maintains valid online solutions for both the fractional matching and the fractional vertex cover. At every input prefix, each solution certifies the competitive guarantee of the other. Specifically, for a fixed constant , the maintained fractional matching and fractional vertex cover satisfy the dual inequality
Since is a forest, the matching and vertex-cover linear programs applied to have integral optimal solutions and optimum value . Weak duality and (1) give
Hence the matching is -competitive and the cover is -competitive.
At any time , let the load of a vertex be the total matching weight assigned to revealed edges incident to , i.e., . The crucial idea behind our approach is to relate the two solutions at every vertex, so that the weight of a vertex in the cover is a function of its load . For that purpose, we define a cover function so that . Under the conditions of Lemma 4, we define the match function for by
We can then use the cover function and the match function to define Algorithm 1 – an online algorithm for fractional matching and vertex cover.
Algorithm 1 Fractional matching and vertex cover defined by a cover function
Input: Vertex set , stream of edges forming a forest , cover function (with match function defined by Equation (2))
Output: A fractional matching and a fractional vertex cover of
1 Initialize and for each
2 foreach online edge do
3
4
5
6 end
7 return and
The analysis of Algorithm 1 is organized as follows. First, in Lemma 4, we give conditions on the cover function under which the match function is well-defined and the algorithm maintains valid online solutions. Next, in Lemma 5, we give sufficient conditions on the cover function under which the dual inequality in Equation (1) holds for Algorithm 1 and a fixed . Finally, we define an explicit cover function and verify that it satisfies the conditions. Applying both lemmas, we obtain the competitive guarantees.
► Lemma 4. Suppose that is continuous and nondecreasing, with and . Then Algorithm 1 maintains a valid online fractional matching and a valid online fractional vertex cover after every edge arrival.
Proof. Fix any . Put . Then , and at least one of equals 1. Since and is nonnegative, satisfies all constraints in Equation (2), so the feasible set is nonempty. The function is continuous and nondecreasing on . Thus the feasible set is a nonempty closed subset of the compact interval , and the minimum in Equation (2) is attained. Thus, the value is well-defined.
The initialization and update rules in Algorithm 1 ensure that and for every vertex after arrivals. The value of for an edge never changes once it is assigned when arrives.
All loads are initially zero. For to be a valid online fractional matching, it remains to prove that all loads remain in after every arrival. For an arriving edge , let and be its old endpoint loads. For , the definition of guarantees that satisfies , , and . The algorithm increases the endpoint loads to and leaves all other loads unchanged. Thus all loads remain in , and remains a feasible solution.
The initial graph has no edges, so the initial vertex weights are zero and is a valid online fractional vertex cover. For the same edge , the updated endpoint weights sum to , which by the definition of is at least 1, so the new edge is covered. Since loads only increase and is nondecreasing, vertex weights never decrease, and all earlier edges remain covered. Hence is feasible after every arrival and satisfies the online constraints.
Now, we give sufficient conditions on the cover function that ensure that the dual inequality in Equation (1) holds for a fixed . At any time , let be a component of the forest . We define the surplus of by
In order to maintain the dual inequality in Equation (1), it would suffice to show that the surplus of any component is nonnegative. The surplus of a one-vertex component is 0. For other components, we fix a constant and maintain a surplus of at least s in every component containing at least one edge. An arriving edge in a forest joins two distinct components. We call it an isolated edge if both components are isolated vertices, a leaf edge if exactly one is an isolated vertex, and a join edge otherwise. Intuitively, adding an isolated edge must create surplus at least s, adding a leaf edge must preserve it, and adding a join edge can decrease the combined surplus by at most s.
Lemma 5. Let satisfy the assumptions of Lemma 4, and let and . Suppose that the weight chosen by Algorithm 1 for edge with loads before the arrival satisfies
Then every component T containing an edge satisfies at all times.
In particular, when the conditions of Lemma 5 are met, the algorithm maintains the dual inequality in Equation (1) for this choice of c and s and is therefore c-competitive for fractional matching and -competitive for fractional vertex cover.
Tight Competitive Bounds for Online Matching on Forests
Proof. We prove the bound by induction on the number of edges that have arrived. Initially every component is an isolated vertex and has surplus zero.
An arriving edge joins two distinct components into a component . Let , and put . If , then . Otherwise, continuity of and the minimality of give . Thus the total cover weight increases by exactly , while the matching weight increases by , so
For an isolated edge, both old components have surplus zero and , so . The first bound in Equation (3) gives , and therefore .
For a leaf edge, take to be the new vertex, so and . By the induction hypothesis, , while . The second bound in Equation (3) gives , so .
For a join edge, both old components have surplus at least by the induction hypothesis. The third bound in Equation (3) gives , so .
All other components retain their surpluses, completing the induction.
▶ Definition 6. The cover function is
Figure 1a shows the function. Observe that the four pieces of are linear, with slopes 0, 7/8, 7/6, and 7/4. The pieces agree at their common endpoints and the function is continuous. It is also nondecreasing and convex, with and . By Lemma 4, Algorithm 1 using maintains valid online solutions for both problems. We use to denote the match function associated with by Equation (2). It remains to verify that Lemma 5 also applies to .

(a) Cover function .

(b) Load update functions and .
Figure 1 Functions defining the fractional algorithm.
▶ Lemma 7. For the cover function , the weights chosen by Algorithm 1 satisfy Equation (3) with and .
Proof. We need to verify the three bounds in Equation (3) for isolated, leaf and join edges, with and . Suppose that an edge arrives. Let and be its endpoint loads before the arrival, and let be the weight assigned to . By symmetry, we may assume .
We first express in terms of and . If , then the edge is already covered and . This is impossible for an isolated edge, where . For a leaf edge, and , so the required lower bound in Equation (3) is 0; for a join edge, it is . We may therefore assume . By continuity of and the minimality of , the updated cover weights sum to exactly one:
Both loads increase by , so their difference is unchanged. The updated loads therefore depend only on : they are the unique pair with difference whose cover weights sum to one. Uniqueness follows because is strictly increasing wherever it is positive. Define the load update functions to be uniquely determined functions satisfying , and for every . Figure 1b gives the plots of these functions. The functions are continuous and piecewise linear, with changes of slope at and . The covering equality and Equation (4) give the explicit formulas
We have and , so . The three cases in Equation (3) depend on whether both, exactly one, or neither endpoint is isolated before the arrival:
For an isolated edge, a = b = 0, so d = 0 and .
For a leaf edge, , so and . For , we have and , so the bound in Equation (3) holds. For , comparing with Equation (4) gives .
For a join edge, observe as above that
The slopes of are , and , so increasing its argument by decreases its value by at least . Applying this from to and from 0 to , respectively, yields
Combining these bounds and using and , we obtain
Rearranging yields , as required.
We are now ready to restate and prove the main result for the fractional algorithm.
Tight Competitive Bounds for Online Matching on Forests
► Theorem 1. In the edge arrival model on forests, there is a deterministic algorithm that simultaneously maintains a 4/7-competitive fractional matching and a 7/4-competitive fractional vertex cover.
Proof. Consider Algorithm 1 defined by the cover function . The function satisfies the assumptions of Lemma 4, as checked after its definition. Lemma 7 verifies the payment conditions in Equation (3) for with and . Lemma 5 therefore gives surplus at least in every component containing an edge, while isolated vertices have surplus zero. Summing over components yields Equation (1), and hence both competitive guarantees.
5 Randomized algorithm
We now use the cover function and its match function to obtain a randomized online matching algorithm. For the analysis, we adapt the rounding argument of Jiang and Zhang [13]. Throughout this section, put and , as in Lemma 7. The algorithm maintains a matching and deterministic loads , which will equal the probabilities that the vertices are matched. An arriving edge joins two distinct components of the forest. Since their random choices are independent and the old endpoint loads are and , both endpoints are unmatched with probability . To accept with probability , we must have . The fractional weight can exceed this bound: for example,
We therefore define the capped match function by
and we assign to the edge. When both endpoints are unmatched, we accept the edge with probability . The loads increase by regardless of whether the edge is accepted.
Algorithm 2 Randomized matching
Input: Vertex set , stream of edges forming a forest Output: A matching of 1 Initialize and for each 2 foreach online edge do 3 , 4 , 5 if and neither nor is matched by then 6 | With probability , add to 7 end 8 , 9 end 10 return
The capped edge weights depend only on the revealed input, so the loads, which are sums of incident edge weights, are deterministic. We first prove that each load equals the probability that the corresponding vertex is matched. We then show that the capped weights satisfy the payment bounds in Equation (3) and use these bounds to maintain a surplus against every offline matching.
Lemma 8. Algorithm 2 accepts each arriving edge e with probability .
Proof. All loads start at zero. For endpoint loads , we have
so the updated loads and also lie in [0,1]. Assign an independent random variable to every arriving edge. The matching in a component depends only on the variables assigned to its own edges. Distinct components use disjoint sets of these variables, so their matchings are independent.
We prove by induction that each load equals the probability that is matched. Initially all vertices are unmatched and all loads are zero. Suppose that arrives with old endpoint loads . Its endpoints lie in distinct components, so by independence and the induction hypothesis they are both unmatched with probability . If , the probability of accepting is . If , then and the edge is rejected. Since is accepted only when both endpoints are unmatched, their matching probabilities increase by , to and , respectively. These are exactly the updated loads; all other loads and matching probabilities remain unchanged.
We now show that capping preserves the payment bounds in Equation (3). For isolated and leaf edges, the cap does not change the assigned weight. For join edges, it suffices to show that the cap is itself large enough to satisfy the required payment bound. The following technical lemma gives the estimate needed for this step.
Lemma 9. For all ,
Proof. Since , it suffices to show that
Convexity and the linear pieces in Equation (4) give the two bounds
If , apply the first bound at both a and b to obtain
If , apply the second bound at a and the first at b to obtain
Lemma 7 establishes the payment bounds in Equation (3) for Algorithm 1 using . Its proof gives these bounds for arbitrary endpoint loads. We now show that capping preserves them, yielding the analogous guarantee for Algorithm 2.
Tight Competitive Bounds for Online Matching on Forests
► Lemma 10. For the cover function , the weights chosen by Algorithm 2 satisfy Equation (3) with and .
Proof. We need to verify the three bounds in Equation (3) for isolated, leaf and join edges, with and .
For an isolated edge, and the cap is 1, so .
For a leaf edge, take . The cap is , and by the definition of the match function. Hence .
For a join edge, put . The pointwise join bound gives . By Lemma 9 and nonnegativity, the cap also satisfies . Their minimum therefore satisfies .
As before, put . Capping can leave an edge with , so these weights need not form a vertex cover. We instead compare with an arbitrary matching of a component . In the vertex-weight sum defining , we replace the total weight of the endpoints of each edge of by 1, leaving the weights of unmatched vertices unchanged. Let be the set of vertices matched by , and define the matching surplus
For the empty matching , is the surplus from Section 4. For a maximum matching, nonnegative matching surplus implies , where is the size of a maximum matching of . The next lemma shows that Algorithm 2 maintains matching surplus at least .
► Lemma 11. After every arrival, Algorithm 2 maintains for every component containing an edge and every matching of .
Proof. We proceed by induction on the arrivals. An isolated vertex has load zero and matching surplus zero for its only matching, the empty matching. Suppose that joins components into . Let , be the old loads and put
The uncapped update would increase by exactly , as in the proof of Lemma 5. By Equation (6), . Since is nondecreasing, the actual increases satisfy
Fix a matching of , and let be its restrictions to the old components. We claim that
where the surpluses on the right are taken before the arrival. If , then are unmatched in . Their old cover weights disappear from the sum over unmatched vertices, and the new edge contributes one to . Thus the change in surplus is exactly
If , the size of the comparison matching is unchanged, while the total edge weight increases by . The sum of weights of unmatched vertices increases by at most , by Equation (7). The change in surplus is therefore at least , proving Equation (8) in this case as well.
We now apply the bounds from Lemma 10, with the same accounting as in Lemma 5. For an isolated edge, the old surpluses are zero, , and . For a leaf edge, the old surpluses sum to at least and . For a join edge, the old surpluses sum to at least and . In each case, Equation (8) gives . All other components remain unchanged.
The matching-surplus bound now allows us to prove the main result for randomized matching, which we restate below.
► Theorem 2. In the edge arrival model on forests, there is a randomized online matching algorithm with expected competitive ratio 4/7 against an oblivious adversary.
Proof. Algorithm 2 accepts only edges with two unmatched endpoints and never removes an accepted edge, so it maintains a valid online matching. By Lemma 8 and linearity of expectation,
For a component containing an edge, choose a maximum matching . By Lemma 11 and nonnegativity of the weights ,
Isolated vertices contribute zero to both the total weight and the optimum. Summing over components and using gives .
6 Hardness for fractional matching in the edge arrival model
We now proceed to show our hardness result. We show in this section that any -competitive fractional online matching algorithm in the edge arrival model satisfies . We do so by constructing a family of growing trees of maximum degree four that rules out every competitive ratio greater than .
We move on to presenting the construction. The whole construction proceeds in stages, where is the parameter of our choice. As a result of applying the construction for parameter , we obtain a growing tree referred to as . The construction starts with an initialization stage (Stage 0), then it proceeds through intermediate stages numbered from 1 to , ending up with a completion stage (Stage ). Each edge that we ever add to the tree is presented at a specific stage called stage. After every two intermediate stages a new set of active vertices is exposed, used to proceed with the construction for the next two consecutive stages.
In the initialization stage 0, we present the first edge and we set the active set , so both endpoints of the newly presented edge become active.
We proceed with the construction of the intermediate stages. For each , we define two consecutive stages: Stage and Stage . In Stage we append a private pendant to each active vertex . In Stage , we append a private dummy vertex
Tight Competitive Bounds for Online Matching on Forests
to every active vertex , and to each previously added pendant we append a private pendant . Each pendant introduces a new edge to a vertex it is appended to. Finally, we declare a new set of active vertices , i.e., all the appended pendants but the dummy ones become active for the next iteration.
We conclude the construction with the completion stage , where we append a dummy vertex to every active vertex . This construction is summarized in Table 1 and illustrated in Figure 2.
Every edge after the first attaches a new leaf. A vertex has degree at most two when it becomes active and subsequently receives at most two further incident edges. Hence is a growing tree of maximum degree at most four.
| stage | operations | active set after the stage |
|---|---|---|
| 0 | create() | |
| For every :append() | ||
| For every :append(), then append() | ||
| For every :append() |
Table 1 Stages of the construction and the corresponding active sets. Method create() creates a new edge, while method append() appends a leaf to a tree vertex .

Figure 2 The tree constructed for . Row shows the active vertices , and the hollow vertices are dummies. Every edge is labeled by the number of the stage in which it is presented. The thick edges pair the vertices of each active set.
To analyze this construction, we relate the matching formed by any algorithm to a vertex cover that bounds its competitiveness from above. To do so, we denote as the tree after stage (for ), i.e., is the subtree of consisting of edges with stage(. Let and be the value of the fractional matching algorithm and the size of a maximum matching of . We introduce a sequence of parameters , to be chosen later, that we refer to as stage values. Write and for . We will assign a nonnegative cover weight to each vertex . We will maintain the invariant that for every stage and every edge in it holds that
For every with , the weights satisfy the vertex-cover LP constraints from Section 4 on . Our proof follows the LP-duality approach of Gamlath et al. [12, Section 2], combining matching feasibility with competitive guarantees at stage boundaries. Baligács et al. [1, Section 3.2] use a related argument for incremental vertex cover.
▶ Lemma 12. Under condition (9), any fractional matching algorithm satisfying after every stage satisfies
Proof. Let be the weight assigned to edge by the fractional matching algorithm. Then, contributes to for every stage . Exchanging the order of summation and telescoping the coefficients gives
Since , the guarantees after the stages give
The denominator is positive because and . Dividing by it gives (10).
6.1 Assignment of stage values and cover weights
To complete the argument, it remains to choose the stage values and assign values appropriately. Note that for it holds that , as we have and . For , let . Then , and each vertex in will receive weight .
Let , and let for the vertices connected via an edge in Stage 0. Clearly, condition (9) is satisfied for , which consists of a single edge . For each , we set the stage values as and , and we also assign cover values to newly added pendants: for every we let , and . Finally, we let , and for any vertex connected to the tree in the completion stage we let . The stage values are displayed in Table 2 in the middle column, and we present the endpoint sums for the edges of the corresponding stage in the rightmost column. Each edge added in stage satisfies . The definitions above and show that the stage values are nonincreasing. Thus an edge added in stage satisfies , establishing (9) for every edge of .
To use Lemma 12, we now need to bound the term . In order to compute the denominator, we let be the increase in the optimum matching size in
Tight Competitive Bounds for Online Matching on Forests
| stage | stage value | edge and endpoint sum |
|---|---|---|
| 0 | 2 | |
Table 2 Stage values and endpoint sums.
| stage | increase in | |
|---|---|---|
| 0 | 2 | 2 |
| 1 | ||
| 2 | 1 | |
| 1 | 0 |
Table 3 Values and the increase in in each stage .
stage , with . Since and , regrouping the sum by gives , which we compute stage by stage.
At the end of every stage, has a perfect matching. We maintain one that, after every even stage , contains a perfect matching on . Initially this is the edge . In stage , replace each matching edge on by the two edges to its endpoints' new leaves. In stage , replace each by and . In the completion stage, replace each matching edge on by the two edges to its endpoints' dummy leaves.
Thus . Counting the new vertices gives
Multiplying by the corresponding stage values gives 2, , 2, and 1, respectively, as in Table 3.
Each intermediate stage adds vertices of weight . The additional dummy vertices in stage have weight zero, so each intermediate stage increases the total cover weight by . These increases are listed in the third column of Table 3.
We are now ready to restate and prove our hardness result.
► Theorem 3. For every constant there is a growing tree of maximum degree four on which no fractional or randomized online matching algorithm is -competitive.
Proof. Consider a -competitive fractional matching algorithm in the edge arrival model, run on with edges presented in the order of the construction stages. By Lemma 12, it holds that . From Table 3, we get and . Thus . For every , choose sufficiently large that . Hence no fractional matching algorithm can satisfy the competitive guarantee at every prefix of this fixed input. For a randomized algorithm, its expected edge weights form a fractional matching, so the same argument applies.
Incremental matching. The hardness bound also holds when the entire edge arrival sequence is known in advance, provided that matching decisions remain irrevocable and the competitive guarantee is required after every prefix. Indeed, the proof of Lemma 12 uses only the feasibility of the fixed edge weights, not how they were chosen. Together with Theorems 1 and 2, this gives the optimal ratio 4/7 for fractional and randomized matching on forests in the analogue of the incremental model studied by Baligács et al. [1]. For comparison, they prove an optimal ratio of 3/2 for incremental fractional vertex cover; offline matching-cover duality does not imply reciprocal competitive ratios for these evolving solutions.
AI methodology. We used AI agents to assist with the research and preparation of this paper, primarily models from the ChatGPT and Claude suites, with occasional use of DeepSeek 3.1-Flash and Xiaomi MiMo-v2.6-pro. Notably, the results described in Sections 4, 5, and 6 were discovered by AI agents after significant guidance and refined by the authors to be as simple and clear as possible. The authors have verified the correctness and originality of the results and the accuracy of the references.
References
1 Júlia Baligács, Bartłomiej Bosek, Yann Disser, Andreas Emil Feldmann, Grzegorz Gutowski, Katarzyna Kępińska, Paweł Putra, and Anna Zych-Pawlewicz. Online and incremental fractional vertex cover on trees. In ESA 2026: 34th Annual European Symposium on Algorithms, volume 388 of LIPIcs, pages 158:1–158:15, 2026. arXiv:2608.24630, doi:10.4230/LIPIcs.ESA.2026.158.
2 Marcin Bienkowski. A 1.764-competitive algorithm for online fractional vertex cover on forests. Unpublished manuscript, 2026.
3 Benjamin Birnbaum and Claire Mathieu. On-line bipartite matching made simple. SIGACT News, 39(1):80–87, March 2008. doi:10.1145/1360443.1360462.
4 Joan Boyar, Lene M. Favrholdt, Michal Kotrbčik, and Kim S. Larsen. Relaxing the irrevocability requirement for online graph algorithms. In WADS 2017: 15th International Symposium on Algorithms and Data Structures, volume 10389 of Lecture Notes in Computer Science, pages 217–228, 2017. doi:10.1007/978-3-319-62127-2_19.
5 Joan Boyar, Lene M. Favrholdt, Michal Kotrbčik, and Kim S. Larsen. Relaxing the irrevocability requirement for online graph algorithms. Algorithmica, 84(7):1916–1951, July 2022. doi:10.1007/s00453-022-00944-w.
6 Bartosz Bromblik. Fractional vertex cover online on trees. BSc thesis, Jagiellonian University, 2026. Analytical Computer Science.
7 Niv Buchbinder, Kamal Jain, and Joseph (Seffi) Naor. Online primal-dual algorithms for maximizing ad-auctions revenue. In ESA 2007: 15th Annual European Symposium on Algorithms, volume 4698 of LNCS, pages 253–264, 2007. doi:10.1007/978-3-540-75520-3_24.
8 Niv Buchbinder, Joseph (Seffi) Naor, and David Wajc. Lossless online rounding for online bipartite matching (despite its impossibility). In SODA 2023: 34th Annual ACM-SIAM Symposium on Discrete Algorithms, pages 2030–2068, 2023. arXiv:2106.04863, doi:10.1137/1.9781611977554.ch78.
9 Niv Buchbinder, Danny Segev, and Yevgeny Tkach. Online algorithms for maximum cardinality matching with edge arrivals. In ESA 2017: 25th Annual European Symposium on Algorithms, volume 87 of LIPIcs, pages 22:1–22:14, 2017. doi:10.4230/LIPIcs.ESA.2017.22.
10 Niv Buchbinder, Danny Segev, and Yevgeny Tkach. Online algorithms for maximum cardinality matching with edge arrivals. Algorithmica, 81(5):1781–1799, 2019. doi:10.1007/s00453-018-0505-7.
Tight Competitive Bounds for Online Matching on Forests
11 Nikhil R. Devanur, Kamal Jain, and Robert D. Kleinberg. Randomized primal-dual analysis of RANKING for online bipartite matching. In SODA 2013: 24th Annual ACM-SIAM Symposium on Discrete Algorithms, pages 101–107, 2013. doi:10.1137/1.9781611973105.7.
12 Buddhima Gamlath, Michael Kapralov, Andreas Maggiori, Ola Svensson, and David Wajc. Online matching with general arrivals. In FOCS 2019: 60th Annual IEEE Symposium on Foundations of Computer Science, pages 26–37, 2019. arXiv:1904.08255, doi:10.1109/FOCS.2019.00011.
13 Tianle Jiang and Yuhao Zhang. Edge arrival online matching: The power of free disposal on acyclic graphs. In WINE 2024: 20th International Conference on Web and Internet Economics, volume 15534 of LNCS, pages 591–608, 2026. arXiv:2410.21727, doi:10.1007/978-3-032-08560-3_33.
14 Richard M. Karp, Umesh V. Vazirani, and Vijay V. Vazirani. An optimal algorithm for on-line bipartite matching. In STOC 1990: 22nd Annual ACM Symposium on Theory of Computing, pages 352–358, 1990. doi:10.1145/100216.100262.
15 Tianhang Lu. A new lower bound for online vertex cover under vertex arrivals, 2026. arXiv:2608.09210.
16 Kanstantsin Pashkovich and Thomas Snow. Online algorithm for fractional matchings with edge arrivals in graphs of maximum degree three. In WAOA 2025: 23rd International Workshop on Approximation and Online Algorithms, volume 16077 of LNCS, pages 198–212, 2025. arXiv:2602.07355, doi:10.1007/978-3-032-06706-7_14.
17 Zhihao Gavin Tang. Optimal competitive ratio of two-sided online bipartite matching, 2026. arXiv:2602.18049.
18 Zhihao Gavin Tang and Yuhao Zhang. A tight bound on online vertex cover under edge arrivals, 2026. arXiv:2608.04994.
19 Yajun Wang and Sam Chiu-wai Wong. Two-sided online bipartite matching and vertex cover: Beating the greedy algorithm. In ICALP 2015: 42nd International Colloquium on Automata, Languages, and Programming, volume 9134 of LNCS, pages 1070–1081, 2015. arXiv:1305.1694, doi:10.1007/978-3-662-47672-7_87.