Deterministic Dynamic Matching in O(1) Update Time

We consider the problems of maintaining an approximate maximum matching and an approximate minimum vertex cover in a dynamic graph undergoing a sequence of edge insertions/deletions. Starting with the seminal work of Onak and Rubinfeld (in: Proceedings of the ACM symposium on theory of computing (STOC), 2010), this problem has received significant attention in recent years. Very recently, extending the framework of Baswana et al. (in: Proceedings of the IEEE symposium on foundations of computer science (FOCS), 2011) , Solomon (in: Proceedings of the IEEE symposium on foundations of computer science (FOCS), 2016) gave a randomized dynamic algorithm for this problem that has an approximation ratio of 2 and an amortized update time of O(1) with high probability. This algorithm requires the assumption of an oblivious adversary, meaning that the future sequence of edge insertions/deletions in the graph cannot depend in any way on the algorithm’s past output. A natural way to remove the assumption on oblivious adversary is to give a deterministic dynamic algorithm for the same problem in O(1) update time. In this paper, we resolve this question. We present a new deterministic fully dynamic algorithm that maintains a O(1)-approximate minimum vertex cover and maximum fractional matching, with an amortized update time of O(1). Previously, the best deterministic algorithm for this problem was due to Bhattacharya et al. (in: Proceedings of the ACM-SIAM symposium on discrete algorithms (SODA), 2015); it had an approximation ratio of (2+ε)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$(2+\varepsilon )$$\end{document} and an amortized update time of O(logn/ε2)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$O(\log n/\varepsilon ^2)$$\end{document}. Our result can be generalized to give a fully dynamic O(f3)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$O(f^3)$$\end{document}-approximate algorithm with O(f2)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$O(f^2)$$\end{document} amortized update time for the hypergraph vertex cover and fractional hypergraph matching problem, where every hyperedge has at most f vertices.

Keywords Dynamic algorithms · Data structures · Graph algorithms · Matching · Vertex cover

Introduction
Computing a maximum cardinality matching is a fundamental problem in computer science with applications, for example, in operations research, computer science, and computational chemistry. In many of these applications the underlying graph can change. Thus, it is natural to ask how quickly a maximum matching can be maintained after a change in the graph. As nodes usually change less frequently than edges, dynamic matching algorithms usually study the problem where edges are inserted and deleted, which is called the (fully) dynamic matching problem. 1 The goal of a dynamic matching algorithm is to maintain either an actual matching (called the matching version) or the value of the matching (called the value version) as efficiently as possible.
Unfortunately, the problem of maintaining even just the value of the maximum cardinality matching is hard: There is a conditional lower bound that shows that no (deterministic or randomized) algorithm can achieve at the same time an amortized update time of O(m 1/2−ε ) and a query (for the size of the matching) time of O(m 1−ε ) for any small ε > 0 [15] (see [1] for conditional lower bounds using different assumptions). The best upper bound is Sankowski's randomized algorithm [21] that solves the value problem in time O(n 1.495 ) per update and O(1) per query. Thus, it is natural to study the dynamic approximate maximum matching problem, and there has been a large body [3,7,8,14,17,18,22] of work on it and its dual, the approximate vertex cover problem, in the last few years.
Dynamic algorithms can be further classified into two types: Algorithms that require an oblivious (aka non-adaptive) adversary, i.e., an adversary that does not base future updates and queries on the answers to past queries, and algorithms that work even for an adaptive adversary. Obviously, the earlier kind of algorithms are less general than the later. Unfortunately, the known randomized dynamic approximate matching and vertex cover algorithms do not work with an adaptive adversary [3,18,22]. Solomon [22] gives the best such randomized algorithm: It achieves O(1) amortized update time (with high probability) and O(1) query time for maintaining a 2-approximate maximum matching and a 2-approximate minimum vertex cover. He also extends this result to the dynamic distributed setting (à la Parter, Peleg, and Solomon [19]) with the same approximation ratio and update cost.
Our Result In this paper we present the first deterministic algorithm that maintains an O(1)-approximation to the size of the maximum matching in O(1) amortized update time and O(1) query time. We also maintain an O(1)-approximate vertex cover in the same update time. Note that this is the first deterministic dynamic algorithm with constant update time for any non-trivial dynamic graph problem. This is significant as for other dynamic problems such as the dynamic connectivity problem or the dynamic planarity testing problem there are non-constant lower bounds in the cell probe model on the time per operation [16,20]. Thus, our result shows that no such lower bound can exist for the dynamic approximate matching problem.
Previous Work There has been prior work on deterministic algorithms for dynamic approximate matching, but they all have (poly(log n)) update time. One line of work concentrated on reducing the approximation ratio as much as possible, or at least below 2: Neiman and Solomon [17] achieved an update time O( √ m) for maintaining a 3/2-approximate maximum matching and 2-approximate minimum vertex cover. This result was improved by Gupta and Peng [14] who gave an algorithm with update time O( √ m/ε 2 ) for maintaining a (1+ε)-approximate maximum matching. Recently, Bernstein and Stein [4] gave an algorithm with O(m 1/4 /ε 2 ) amortized update time for maintaining a (3/2 + ε)-approximate maximum matching. Another line of work, and this paper fits in this line, concentrated on getting a constant approximation while reducing the update time to polylogarithmic: Bhattacharya, Henzinger and Italiano [7] achieved an O(log n/ε 2 ) update time for maintaining a (2+ε)-approximate maximum fractional matching and a (2 + ε)-approximate minimum vertex cover. Note that any fractional matching algorithm solves the value version of the dynamic matching problem while degrading the approximation ratio by a factor of 3/2 [8]. Thus, the algorithm in [7] maintains a (3 + ε)-approximation of the value of the maximum matching. The fractional matching in this algorithm was later "deterministically rounded" by Bhattacharya, Henzinger and Nanongkai [8] to achieve a O(poly(log n, 1/ε)) update time for maintaining a (2 + ε)-approximate maximum matching. Very recently, a third line of work has focussed on getting small constant approximation in O(poly log n) worst case update time. Bhattacharya, Henzinger and Nanongkai [9] showed how to maintain a (2 + ε)-approximate maximum fractional matching and a (2 + ε)-approximate minimum vertex cover in O(log 3 n/ε 4 ) worst case update time. Subsequently, Charikar and Solomon [12] and Arar, Chechik, Cohen, Stein and Wajc [2] showed how to maintain a (2+ε)-approximate maximum (integral) matching in O(poly log(n, 1/ε)) worst case update time.
Our method also generalizes to the hypergraph vertex (set) cover and hypergraph fractional matching problem which was considered by [6]. In this problem the hyperedges of a hypergraph are inserted and deleted over time. f indicates the maximum cardinality of any hyperedge. The objective is to maintain a hypergraph vertex cover, that is, a set of vertices that hit every hyperedge. Similarly a fractional matching in the hypergraph is a fractional assignment (weights) to the hyperedges so that the total weight faced by any vertex is at most 1. We give an O( f 3 )-approximate algorithm with amortized O( f 2 ) update time; compare this with the O( f 2 )-approximate algorithm due to Bhattacharya et al. [6] whose amortized update time was O( f · log(m + n)); we trade-off O( f ) in the approximation factor with O(log n) in the update time.
Subsequent Work Very recently, after the publication of the conference version of our paper, Bhattacharya and Kulkarni [10] have shown how to maintain a (2 + ε)approximate minimum vertex cover deterministically in a dynamic graph in O(1/ε 2 ) amortized update time. When f = 2, this improves upon the approximation guarantee of our result (which is a large constant). Arguably, however, our analysis in this paper is more intuitive and easy to follow, compared to the analysis in [10] which uses an extremely intricate potential function. Also, for technical reasons, the analysis in [10] holds only for simple graphs (with f = 2). In other words, the result in [10] does not subsume our result on hypergraph vertex (set) cover and fractional matching.

Our Techniques
Our algorithm builds and simplifies the framework of hierarchical partitioning of vertices proposed by Onak and Rubinfeld [18], which was later enhanced by Bhattacharya, Henzinger and Italiano [7] to give a deterministic fully-dynamic (2 + δ)-approximate vertex cover and maximum matching in O(log n/δ 2 )-amortized update time. The hierarchical partition divides the vertices into L := O(log n)-many levels and maintains a fractional matching and vertex cover. To prove that the approximation factor is good, Bhattacharya et. al. [7] also maintain approximate complementary slackness conditions. An edge insertion or deletion can disrupt these conditions (and indeed at times the feasibility of the fractional matching), and a fixing procedure maintains various invariants. To argue that the update time is bounded, [7] gives a rather involved potential function argument which proves that the update time bounded by O(L), the number of levels, and is thus O(log n). It seems unclear whether the update time can be argued to be a constant or not.
Our algorithm follows the same approach as Bhattacharya et. al. [7], maintaining invariants for the set of edges incident to a node in the hierarchical graph decomposition, calling nodes that violate them dirty and fixing all dirty nodes after each edge insertion or deletion. To fix dirty nodes the algorithm moves them up or down in the hierarchy. All the work in the algorithm consists of inserting and deleting edges and moving nodes up and down the hierarchy. Our algorithm and analysis which we sketch below is very different and simpler than the potential-function based analysis in [7].
To achieve an amortized constant running time, however, we need to develop a number of technical innovations: • We introduce a new state, called Super-Clean , that fulfills much stricter invariants, not only on the total set of edges incident to a node, but also on the subset of these edges whose other endpoint lies at a higher level in the hierarchy. The fact that an upper bound on this new type of edges (a) can be achieved by the update algorithms and (b) can be exploited to show a constant bound on the amortized running time is the crucial new insight in this paper. Accordingly, we suitably modify the subroutines that move nodes up and down. We show that one of these subroutines, namely the one that moves nodes down the hierarchy, ensures the strict invariants of the Super-Clean state are fulfilled after it runs; however, the strict invariants need not hold when a node moves up. To analyze, we show that the total time of the "down-movements" is linear in the number T of the update operations; however, arguing about the "up-movements" is trickier. Intuitively, one down-movement might drop a vertex from some level i down to level 0, but it might take i up-movements for the node to achieve level i again. Thus, there might be L times as many up-movements as there are down-movements, and, hence a naive argument may count the total cost for all up-movements to be up to L times the total cost of all down-movements. But this would only result in an O(LT ) total time, which would only give a logarithmic amortized time. We show, however, by using the stricter conditions of the Super-Clean state, that this is not the case and we can indeed bound the total cost of all up-movements up to level i by the cost of the single down-movement from i. • To analyze the up-movements, we partition the sequence of operations we perform into epochs. Note that Solomon [22] also used epochs, but with a very different definition of epochs: In [22] an epoch of an edge is a maximal time interval that an edge remains matched. For us, an epoch of a vertex is a maximal time period during which the vertex remains at the same level of the hierarchy. Since a vertex only becomes Super-Clean when it moves down, we need to group together consecutive epochs where the vertex moves only up. We call such a consecutive sequence of epochs a phase and the crucial part in our analysis is to analyse the cost of the algorithm in each phase. At a high level it works as follows: The number of phases is linear in the number of down-movements plus all the edges that exist at the end. Additionally the way the invariants are set up, the cost of all the epochs in a given phase are geometrically increasing and, thus, the total cost of a phase is dominated by the last epoch in that phase. We then show that the cost of the last epochs of all phases can be "charged" to the cost of all down-movements.
As these technique easily generalize to the hypergraph setting and, thus, we state all our results in the hypergraph setting. It would be interesting to see other scenarios where approximation ratios can be slightly traded in for huge improvements in the update time.
Remark Independently of our work, Gupta et al. [13] has obtained a O( f 3 )approximation algorithm for maximum fractional matching and minimum vertex cover in a hypergraph in O( f 2 ) amortized update time. Here, the symbol f denotes the maximum number of nodes that can be incident on a hyperedge. Their algorithm and analysis are also very similar to ours using an asymmetry between how one treats UP and DOWN moves, and using the notion of epochs like we do.

Notations and Preliminaries
Since the hypergraph result implies the graph result, henceforth we consider the former problem. The input hypergraph G = (V , E) has |V | = n nodes. Initially, the set of hyperedges is empty, i.e., E = ∅. Subsequently, an adversary inserts or deletes hyperedges in the hypergraph G = (V , E). The node-set V remains unchanged with time. Each hyperedge contains at most f nodes. We say that f is the maximum frequency of a hyperedge. If a hyperedge e has a node v as one of its endpoints, then we write v ∈ e. For every node v ∈ V , we let E v = {e ∈ E : v ∈ e} denote the set of hyperedges that are incident on v.
A matching is a subset of hyperedges M ⊆ E that do not share any common endpoint. The size of a matching M is given by |M|. In a fractional matching, each hyperedge e ∈ E receives a (possibly fractional) weight w(e) ≥ 0 subject to the following constraint: The total weight W v = e∈E v w(e) received by every node v ∈ V from all the hyperedges incident on v is at most 1. The size of a fractional matching is given by the sum of the weights of all the hyperedges in G . Note that if w(e) ∈ {0, 1} for all e ∈ E, then the fractional matching becomes a simple matching M ⊆ E, where M is the subset of hyperedges e with w(e) = 1. Finally, a vertex cover is a subset of nodes V ⊆ V such that every hyperedge e ∈ E has at least one endpoint in V . The size of the vertex cover is given by |V |. From LP-duality, it follows that in any hypergraph G = (V , E) the size of the maximum fractional matching is at most the size of the minimum vertex cover (see Appendix A).
We consider a fully dynamic setting, where the hypergraph G = (V , E) is getting updated via a sequence of edge insertions/deletions. In this setting, our goal is to maintain an approximate maximum fractional matching and an approximate minimum vertex cover in G . Our main result is stated in Theorem 2.1.

Theorem 2.1 We can maintain an O( f 3 ) approximate maximum fractional matching and an O( f 3 ) approximate minimum vertex cover in the input hypergraph
Throughout the rest of this paper, we fix two parameters α and β as follows. β = 6, and α = 1 + 28 f 2 β 2 . (1) We will maintain a hierarchical partition of the node-set We define the level of a hyperedge e ∈ E to be the maximum level among its endpoints, i.e., (e) = max v∈e (v). The levels of nodes (and therefore hyperedges) induce the following weights on hyperedges: w(e) := β − (e) for every hyperedge e ∈ E. For all nodes v ∈ V , let W v := e∈E v w(e) be the total weight received by v from its incident hyperedges. We will satisfy the following invariant after processing a hyperedge insertion or deletion.

Corollary 2.3 Under Invariant 2.2, the nodes in levels
Then we also have (e) = 0 and w(e) = 1/β (e) = 1/β 0 = 1. So for every node v ∈ e, we get: Proof Consider the set of nodes T = {v ∈ V : (v) > 0}. By Corollary 2.3, the set T forms a vertex cover in G . We now compare the size of this vertex cover with the size of the fractional matching {w(e)} as follows.
In the above derivation, the first inequality holds since W v > 1/(αβ 2 ) for all v ∈ T under Invariant 2.2. The third inequality holds since every node in G is incident upon at most f hyperedges. Thus, the set T forms a valid vertex cover in G and the weights {w(e)} form a valid fractional matching in G such that the size of the vertex cover T is at most f αβ 2 times the size of the fractional matching {w(e)}. Since the size of the maximum fractional matching in G is upper bounded by the size of the minimum vertex cover in G , we conclude that the fractional matching {w(e)} is a f αβ 2 -approximate maximum fractional matching in G , and furthermore, the set of nodes T form a f αβ 2 -approximate minimum vertex cover in G .
We introduce some more notations. For any vertex v, let W + v := e∈E v : (e)> (v) w(e) be the total up-weight received by v, that is, weight from those incident hyperedges whose levels are strictly greater than (v). For all levels i ∈ {0, 1, . . . , L}, we let W v→i and W + v→i respectively denote the values of W v and W + v if the node v were to go to level i and the levels of all the other nodes were to remain unchanged. More precisely, for every hyperedge e ∈ E and node v ∈ e, we define v (e) = max u∈e:u =v (u) to be the maximum level among the endpoints of e that are distinct from v. Then we have: . Our algorithm maintains a notion of time such that in each time step the algorithm performs one elementary operation. We let W v (t) denote the weight faced by v right before the operation at time t. Similarly define W v→i (t), W + v (t), and W + v→i (t). Different States of a Node Before the insertion/deletion of a hyperedge in G , all nodes satisfy Invariant 2.2. When a hyperedge is inserted (resp. deleted), it increases (resp. decreases) the weights faced by its endpoints. Accordingly, one or more endpoints can violate Invariant 2.2 after the insertion/deletion of a hyperedge. Our algorithm fixes these nodes by changing their levels, which may lead to new violations, and so on and so forth. To describe the algorithm, we need to define certain states of the nodes.
A node is Dirty if it is either Down-Dirty or Up-Dirty.
A node that is not Dirty is Clean. Invariant 2.2 is satisfied if and only if no node is Dirty. Whenever a node becomes Dirty, we use one of two subroutines to fix the node, i.e., to make it clean. However, for the running time analysis to go through, we need that the weight of node v after it was fixed has a "slack" (or gap) both with regard to the upper and the lower bound of the allowed weight. More specifically, right after a node v was fixed, it holds that 1/β 2 < W v ≤ 1/β. But this fact alone still does not suffice to achieve constant running time. Instead we show that when a node was fixed by one of our subroutines, an even stronger condition is fulfilled, and we call a node fulfilling that condition to be a Super-Clean node. Definition 2.6 A node v ∈ V is Super-Clean iff one of the following conditions hold: Note that a Super-Clean node v with (v) > 0 fulfills a stronger upper bound on the weight W v then a Clean node and additionally it fulfills an upper bound on the . We will maintain the following data structures.
1. For every level i ∈ {0, 1, . . . , L} and node v ∈ V , we store the set of hyperedges E v,i as a doubly linked list, and also maintain a counter that stores the number of hyperedges in E v,i . 2. For every node v ∈ V , we store the weights W v and W + v , its level (v) and an indicator variable for each of the states Down-Dirty, Up-Dirty, Dirty and Super-Clean. 3. For each hyperedge e ∈ E, we store the values of its level (e) and therefore its weight w(e). Finally, using appropriate pointers, we ensure that a hyperedge can be inserted into or deleted from any given linked list in constant time.
We now state two lemmata that will be useful in analysing the update time of our algorithm. Proof If a hyperedge e is not incident on the node v, then the data structures associated with e are not affected as v moves up from level i to level j. Further, among the hyperedges e ∈ E v , only the ones with v (e) < j get affected (i.e., the data structures associated with them need to be changed) as v moves up from level i to level j. Note that just before the node v moves up from level i to level j, the set of hyperedges e ∈ E v with v (e) < j is given by  Proof If a hyperedge e is not adjacent to the node v, then the data structures associated with e are not affected as v moves down from level i to level j. Further, among the hyperedges e ∈ E v , only the ones with v (e) ≤ i get affected (i.e., the data structures associated with them need to be changed) as v moves down from level i to level j. Finally, for every hyperedge that gets affected, we need to spend O( f ) time to update the data structures for its f endpoints.

The algorithm: Handling the Insertion/Deletion of a Hyperedge
Initially, the graph G is empty, every node is at level 0, and Invariant 2.2 holds. By induction, we will ensure that the following property is satisfied just before the insertion/deletion of a hyperedge.
Insertion of a hyperedge e When a hyperedge e is inserted into the input graph, it is assigned a level (e) = max v∈e (v) and a weight w(e) = β − (e) . The hyperedge gets inserted into the linked lists E v, (e) for all nodes v ∈ e. Furthermore, for every node v ∈ e, the weights W v increases by w(e). For every endpoint v ∈ e, if (v) < (e), then the weight W + v increases by w(e). As a result of these operations, one or more endpoints of e can now become Up-Dirty and Property 3.1 might no longer be satisfied. Hence, in order to restore Property 3.1 we call the subroutine described in Fig. 1.
Deletion of a hyperedge e When a hyperedge e is deleted from the input graph, we erase all the data structures associated with it. We remove the hyperedge from the linked lists E v, (e) for all v ∈ e, and erase the values w(e) and (e). For every node v ∈ e, the weight W v decreases by w(e). Further, for every endpoint v ∈ e, if (v) < (e), then we decrease the weight W + v by w(e). As a result of these operations, one or more endpoints of e can now become Down-Dirty, and Property 3.1 might get violated. Hence, in order to restore Property 3.1 we call the subroutine described in Fig. 1. The algorithm is simple -as long as some Dirty node remains, it runs either FIX-UP-DIRTY or FIX-DOWN-DIRTY to take care of Up-Dirty and Down-Dirty nodes respectively. One crucial aspect is that we prioritize Up-Dirty nodes over Down-Dirty ones as it allows us to upper bound the weight of every node by 2, since any individual weight increase increases the weight of a node by at most 1 and the call FIX-UP-DIRTY does not increase the weight of any node, while FIX-DOWN-DIRTY might do so. Thus, as long as we are fixing Up-Dirty nodes as soon as they become Up-Dirty, no node will ever have weight 2 or larger, a fact that we will exploit in the running time analysis. FIX-DOWN-DIRTY (v) Suppose that (v) = i when the subroutine is called at time t. By definition, we have i > 0 and W v (t) ≤ 1/(αβ 2 ). We need to increase the value of W v if we want to ensure that v no longer remains Dirty. This means that we should decrease the level of v, so that some of the hyperedges incident on v can increase their weights. Accordingly, we find the largest possible level j ∈ {1, . . . , (i − 1)} such that W v→ j (t) > 1/β 2 , and move the node v down to this level j. If no such level exists, that is, if even W v→1 (t) ≤ 1/β 2 , then we move the node v down to level 0. Note that in this case there is no hyperedge e ∈ E v with v (e) = 0 for such a hyperedge would have w(e) = β −1 > 1/β 2 when v is moved to level 1. In particular, we get W v→0 (t) = W v→1 (t).
since weights of hyperedges can increase by at most a factor β when one end point drops exactly one level. This implies W v→ j (t) ≤ 1/β. Together we get that after time t when v is fixed to level j, we have 1/β 2 < W v ≤ 1/β. Now we argue about the up-weights. Note that every hyperedge e that contributes to W + v→ j (t) must have v (e) ≥ ( j + 1). The weight of such a hyperedge remains unchanged as v moves from level ( j+1) to j. We infer that W + v→ j (t) ≤ W v→( j+1) (t) ≤ 1/β 2 . Therefore after time t when v is fixed at level j, we have W + v ≤ 1/β 2 . In sum, v becomes Super-Clean after time t.
FIX-UP-DIRTY (v) Suppose that (v) = i when the subroutine is called at time t. At this stage, we have either {i = 0, W v (t) > 1/β 2 } or {i > 1, W v (t) ≥ 1}. We need to increase the level of v so as to reduce the weight faced by it. Accordingly, we find the smallest possible level j ∈ {i + 1, . . . , L} where W v→ j (t) ≤ 1/β and move v up to level j. Such a level j always exists because W v→L (t) ≤ n f · β −L ≤ 1/β.

Claim 3.3 After a call to the subroutine FIX-DOWN-DIRTY(v) at time t, we have
Proof Suppose that the node v moves up from level i to level j > i. We now consider four possible cases.
Since j ∈ {i + 1, . . . , L} is the minimum possible level where W v→ j (t) ≤ 1/β, and since W v→i (t) ≥ 1 > 1/β, we infer that W v→( j−1) (t) > 1/β. As the node v moves up from level ( j − 1) to level j, the weight it faces can drop by at most a factor of β. Hence, we get: Therefore after time t when the node v moves to level j, we have 1/β 2 < W v ≤ 1/β. • Case 2. We have i = 0, and there is an edge e ∈ E v with v (e) = 0 at time t.In this case we have W v→i (t) ≥ 1 in the beginning of time-step t, since the edge e ∈ E v with v (e) = 0 has weight w(e) = 1. The rest of the proof is similar to Case 1.
• Case 3. We have i = 0, there is no edge e ∈ E v with v (e) = 0 at time t, and j = 1. The value of W v does not change as v moves up from level i = 0 to level j = 1. Thus, we get: W v→ j (t) = W v→0 (t) > 1/β 2 , for the node v is Up-Dirty at level i = 0 at time t. Since the node does not move further up than level j, we get: Since the node v does not stop at level 1, we get: W v→1 (t) > 1/β. Hence, we infer that j ∈ {2, . . . , L} is the minimum possible level where W v→ j (t) ≤ 1/β. Since the node v had to rise above level j − 1, we infer that W v→( j−1) (t) > 1/β. Next, since the weight of the node v can drop by at most a factor of β when it rises from level j − 1 to level j, we get: It is clear that if and when FIX-DIRTY() terminates, we are in a state which satisfies Invariant 2.2. In the next section we show that after T hyperedge insertions and deletions, the total update time is indeed O( f 2 · T ) and so our algorithm has O( f 2 )-amortized update time.

Analysis of the Algorithm
Starting from an empty graph G = (V , E), fix any sequence of T updates. The term "update" refers to the insertion or deletion of a hyperedge in G . We show that the total time taken by our algorithm to handle this sequence of updates is O( f 2 · T ). We also show that our algorithm has an approximation ratio of O( f 3 ).

Relevant Counters
We define three counters C up , C down and I down . The first two counters account for the time taken to update the data structures while the third accounts for the time taken to find the index j in both FIX-DOWN-DIRTY(v) and FIX-UP-DIRTY(v). Initially, when the input graph is empty, all the three counters are set to zero. Subsequently, we increment these counters as follows.
1. Suppose node v moves from level i to level j > i upon a call of FIX-UP-DIRTY(v). Then for every hyperedge e ∈ E v with v (e) ≤ j − 1, we increment C up by one. 2. Suppose node v moves from level i to level j < i upon a call of FIX-DOWN-DIRTY(v). Then for every hyperedge e ∈ E v with v (e) ≤ i, we increment the value of C down by one. Furthermore, we increment the value of I down by β i−2 /α.

Remark
We will see in Sect. 4.5 that the time complexity of finding the appropriate index j during FIX-UP-DIRTY is subsumed by the increment in I down during FIX-DOWN-DIRTY (we will crucially exploit the fact that each sequence of up moves will be followed by a down move since the final graph is empty graph).
We now explain why we increment I down during a call to FIX-DOWN-DIRTY which moves a node v down from level i to level j < i. Note that in order to compute the new level of v, it suffices to process all the hyperedges whose other endpoints are at levels ≤ i. Each of these hyperedges has weight β −i . Furthermore, given that the node was down-dirty, its current weight is less than 1/(β 2 α). Hence, the number of hyperedges we need to scan to find the level j is upper bounded by β i−2 /α. The next lemma upper bounds the total time taken by our algorithm in terms of the values of these counters. The proof of Lemma 4.1 appears in Sect. 4.5.

Lemma 4.1
Our algorithm takes ( f · (C up +C down + T ) + f 2 I down ) time to handle a sequence of T updates.
We will show that C up = ( f ) · T and C down + I down = O(1) · T , which will imply an amortized update time of O( f 2 ) for our algorithm. Towards this end, we now prove three lemmata that relate the values of these three counters. The proofs can be found in the next subsections.
The first lemma follows immediately from the fact that at most β i−2 /α edges fulfill the condition v (e) ≤ i when node v moves down, and thus, I down is incremented by at most as much as C down .

Lemma 4.2 We have: C down ≤ I down .
The next lemma exploits the gap between the weight when a node v reaches a level i and when v moves down: When v is placed on level i we have W v > 1/β 2 , when it is Down-Dirty it holds that W v ≤ 1/(αβ 2 ). This "slack" suffices to upper bound I down by a function linear in T and C up . Thus, this proof compares the weight of node v at the beginning and at the end of a time interval during which v remains at the same level. Note that we picked α such that the constant is much smaller than 1 and even a function of 1/ f .

Lemma 4.3 We have: I down
Note that when in prior work such as [7] the "slack" was exploited by comparing the weight of v at two different points in time, node v had to be at the same level from time t 1 on until time t and the whole weight of v on this level was used in the comparison.
In order to prove the next lemma we compares the weight of v at two points in time even though v is at different levels at these points in time. More specifically, we use the following new three ideas: (1) We break, for each node v, the sequence of operations into subsequences and then argue over a maximal subsequence of operations during which the level of v only increases, called phase. When we compare the weight of v, we use as t 1 the beginning of the phase and as t a later point in time during the phase. Thus, v will be t different levels at these points in time. (Note that both the definition of a phase and its subintervals, called epochs, are different from the epochs introduced in [22].) (2) We use a reference level i * , on which v might never be during the phase and compare the weight of v at time t 1 if it were at a level i * with the weight of v if it were at level i * at time t.
(3) In this comparison we use, however, not the complete weight of v, but only the weight of v to upper levels, i.e. we use the weight W + v→i * . When doing so, we use the strong properties that are guaranteed by the Super-Clean state.
These ideas enable us finally to upper bound C up by a function linear in T and C down .

Epochs, Jumps and Phases
Fix any node v ∈ V . An epoch of this node is a maximal time-interval during which the node stays at the same level. An epoch ends when either (a) the node v moves up to a higher level due to a call to FIX-UP-DIRTY, or (b) the node v moves down to a lower level due to a call to the subroutine FIX-DOWN-DIRTY. These events are called jumps. Accordingly, there are Up-Jumps and Down-Jumps. Next, we define a phase of a node to be a maximal sequence of at least two consecutive epochs where the level of v keeps on increasing, i.e., where all but the last epoch end in an Up-Jump. We use v to denote a phase of a node v and we will analyse each such phase. Suppose that a phase v consists of k > 1 consecutive epochs of v at levels i 1 , . . . , i k ∈ {0, 1, . . . , L}. Then we have: i 1 < i 2 < · · · < i k . By definition, the epoch immediately before v must have level larger than i 1 implying FIX-DOWN-DIRTY(v) landed v at level i 1 . Similarly, the epoch subsequent to i k is smaller than i k implying FIX-DOWN-DIRTY(v) is called again.

Proof of Lemma 4.2
Suppose that a node v moves down from level i to level j < i at time t due to a call to the subroutine FIX-DOWN-DIRTY(v). Let down and down I respectively denote the increase in the counters C down and I down due to this event. We will show that down ≤ down I , which will conclude the proof of the lemma. By definition, we have: , we increase the value of up by one each time we observe that a hyperedge e ∈ E v increases its level (e) to something larger than i. Note that (v) = i throughout the time-interval [t 1 , t 2 ]. Hence, each time we observe an unit increase in T + up , this decreases the value of W v by at most β −i . Just before time t 1 , the node v made either an Up-Jump, or a Down-Jump. Hence, Claims 3.3 and 3.2 imply that W v→i (t 1 ) > 1/β 2 . As W v (t 2 ) ≤ 1/(αβ 2 ) at time t 2 , we infer that W v has dropped by at least (1 − 1/α) · β −2 during the time-interval [t 1 , t 2 ]. In order to account for this drop in W v , the value of T + up must have increased by at least Hence, (5) gives us: Each time the value of I down increases due to FIX-DOWN-DIRTY on some node, inequality (6) applies. If we sum all these inequalities for all nodes v, then the left hand side (LHS) will be exactly equal to the final value of I down , and the right hand side (RHS) will be at most The factor f appears in front of T because each hyperedge deletion can contribute f times to the sum T , once for each of its endpoints. Similarly, the factor ( f − 1) appears in front of C up because whenever the level of an hyperedge e moves up due to the increase in the level (v) of some endpoint v ∈ e, this contributes at most ( f − 1) times to the sum up , once for every other endpoint u ∈ e, u = v. Since LHS ≤ RHS, we get: This concludes the proof of the lemma.

Proof of Lemma 4.4
To upper bound C up by a function linear in T and C down we analyse the increase in C up caused by each node v and each phase of v individually. Thus, we first need to define suitable variables. Fix a node v and consider a phase v where v goes through levels i 1 < i 2 < · · · < i k . Thus, the node v enters the level i 1 at time t 1 (say) due to a call to FIX-DOWN-DIRTY(v). For r ∈ [2, k], the node v performs an Up-Jump at time t r (say) from the level i r −1 to the level i r , due to a call to FIX-UP-DIRTY(v). This implies that t 1 < t 2 < · · · < t k . The phase ends, say, at time t k+1 > t k when the node v again performs a Down-Jump from the level i k due to a call to FIX-DOWN-DIRTY(v). As we will argue in this proof about the weight of v at various levels we use the notation W v→i 1 (t 1 ) to denote the weight of v on level i 1 at time t 1 as this notation clearly shows the three parameters that the weight depends on (v, i 1 , and t 1 ), even if we could simply use W v (t 1 ) if the level of v at time t 1 is i 1 .
Let up denote the total increase in the value of the counter C up during the phase v , that happens because of the node v. For r ∈ [2, k], let up r denote the increase in the value of the counter C up due to the Up-Jump of v at time t r . Thus, we have: We define two more counters: T , down . The former counter equals the number of hyperedge insertions/deletions incident on v during the time-interval [t 1 , t k ]. The latter counter equals the increase in the value of C down due to the hyperedges incident on v during the time-interval [t 1 , t k ]. Thus, T and down are functions of v, t 1 and t k , but we omit these parameters to simplify the notation in this proof. (Alternately, these two counters can be defined as follows. At time t 1 , we set T ← 0 and down ← 0. Subsequently, whenever at any time t ∈ [t 1 , t k ], a hyperedge incident on v gets inserted into or deleted from the input graph, we increment the value of T by one. Further, whenever at any time t ∈ [t 1 , t k ], a hyperedge e incident on v gets its level decreased because of a Down-Jump of some node u ∈ e, u = v, we increment the value of down by one. ) Before proceeding with the proof we first state a crucial property of W v→i 1 (t 1 ) that we will use repeatedly below. Since v enters the level i 1 at time t 1 due to a call to FIX-DOWN-DIRTY(v), Claim 3.2 implies that the node v is Super-Clean at level i 1 at time t 1 . We now recall the definition of a Super-Clean node from Definition 2.6. There are two cases to consider, depending on the value of i 1 .
Case 2. i 1 = 0. In this case, Definition 2.6 implies that W v→i 1 (t 1 ) ≤ 1/β 2 ≤ 1/β. Furthermore, Definition 2.6 also implies that W + v→i 1 (t 1 ) ≤ W v→i 1 (t 1 ) ≤ 1/β 2 . We therefore obtain the following strict bounds on W v : Our main goal is to upper bound up in terms of the final values of the counters T and down . To achieve this we upper bound in the next claim up r by β i r −1 and in the following claim we lower bound T + down by a function of β i r −1 . In the proof of the next claim we use the fact that we have an upper bound of 1/β on W v right after an Up-Jump and we know the exact weight of all edges that contribute to up r for the Up-Jump. As these edges also contribute to W v→i r (t r + 1), the upper bound to W v→i r (t r + 1) bounds the number of such edges and thus up r .

Claim 4.6 For
Proof By Claim 3.3 we have W v→i r (t r + 1) ≤ 1/β, that is, the total weight incident on v after it has gone through FIX-UP-DIRTY at time t r is at most 1/β. Now, each hyperedge e ∈ E v which contributes to up r has weight, right after time t r , precisely  For the rest of the proof, we suppose that k > 2, which implies that i k−1 ≥ i 2 > i 1 ≥ 0. Thus, we get: k > 2 and i k−1 > 0.
Summing over the inequalities from Claim 4.6, we get: Since the node v performs an Up-Jump at time t k−1 from level i k−1 > 0 (see Eq. (9)), the node must be Up-Dirty at that time. It follows that the value of W v→i k−1 increases by at least (1 − 1/β). This can be either due to (a) some hyperedge incident to v being inserted, or (b) some hyperedge e ∈ E v gaining its weight because of some endpoint u ∈ e, u = v, going down. The former increases T and the latter increases down . Furthermore, the increase in W v→i k−1 due to every such hyperedge is at most β −i k−1 . This gives us the following lower bounds: The claim follows from Eq. (11).
It now remains to upper bound up k . This is done in Claim 4.8, whose proof appears in Sect. 4.4.1.

Claim 4.8 We have:
Putting it all together from Eqs. 1, 7 and Claims 4.7, 4.8, we get: . The coefficient f before T comes from the fact that every hyperedge insertion can contribute f times to the RHS, once for each of its endpoints. The coefficient ( f − 1) before C down comes from the fact that whenever the level of a hyperedge e decreases due to the Down-Jump of a node u ∈ e, this event contributes at most ( f − 1) times to the RHS: once for every other endpoint v ∈ e, v = u. Thus, we get:

Proof of Claim 4.8
To prove an upper bound of 6β 2 ) · ( T + down ) for up k we consider two cases. One case arises if levels i k and i k−1 are "close", the other one when they are far. The first case follows the proof pattern of Claim 4.7, which showed the bound for up k−1 . This is possible since the weight of edges contributing to up k are within β 3 of the weight of edges contributing to up k−1 as i k and i k−1 are "close". Thus, the same arguments as in Claim 4.7 can be used to show the desired bound for up k . If, however, i k and i k−1 are far, a new approach is needed, which we will explain in Case 2 below.
The proof in this case consists of three steps: (1) First we show that at any point in time the weight of any node is less than 2. This holds due to our subroutine FIX-DIRTY. (2) Using this upper bound on W v show that W + v→(i k −3) (t k ) > 1/(2β). It is interesting that we can show this bound, even though v is not at level i k − 3 at time t k . We show that claim by contradiction: If that weight were at most 1/(2β), then the weight of v on level i k − 1 were less than 1/β, since, as we show, the difference between W v→(i k −1) (t k ) and W + v→(i k −3) (t k ) is at most 2/β 2 . But then the Up-jump would have placed v on level i k − 1 and not on level i k .
(3) Using the previous bound we show that W + v→(i k −3) increases from t 1 to t k by at least 1/(2β) − 1/β 2 . Here we use the fact that v was Super-Clean at time t 1 , which implies that W + v→i 1 (t 1 ) ≤ 1/β 2 and the fact that W + v→(i k −3) (t 1 ) ≤ W + v→i 1 (t 1 ). In previous situations there were two reasons why the weight of v increased over a certain time interval, one of them can be contributed to an increase in T and the other to an increase in down . Here, however, there are three such cases and the third one can neither be contributed to an increase in T nor to an increase in down . However, we can show that all events of the third type can lead to an increase of W + v→(i k −3) of at most 1/β 2 during the time interval [t 1 , t k ]. Thus, at least 1/(2β) − 2/β 2 of the increase of W + v→(i k −3) can be contributed to either an increase in T or an increase in down and the same arguments at in 4.7 show the desired bound.
We start by noting that the weight of a node is always less than 2 at every time. Claim 4. 9 We have: W v (t) < 2 at every time t.
Proof The crucial observation is that fixing an Up-Dirty node u never increases the weight of any node. Furthermore, a Down-Dirty node gets fixed only if no other node is Up-Dirty (see Fig. 1).
In the beginning of time-step t = 0, the input graph is empty, and we clearly have W v (t) = 0 < 1. By induction, suppose that W v (t) < 1 in the beginning of some time-step t. Now, during time-step t, the weight W v can increase only if one of the following events occur: • A hyperedge containing v gets inserted into the graph. This increases the value of W v by at most one. Thus, we have W v (t + 1) < 2. • We call the subroutine FIX-DOWN-DIRTY(u) for some node u. Note that fixing a Down-Dirty node u can increase the weight W u by at most one, and hence this can increase the weight of a neighbour of u also by at most one. It again follows that W v (t + 1) < 2.
If W v (t + 1) < 1, then we are back in the same situation as in time-step t. Otherwise, if 1 ≤ W v (t + 1) < 2, then v is Up-Dirty in the beginning of time-step t + 1. In this case, no Down-Dirty node gets fixed (and no hyperedge gets inserted) until we ensure that W v becomes smaller than one. Hence, the value of W v always remains smaller than 2.
Claim 4. 10 We have: W + v→(i k −3) (t k ) > 1/(2β). Proof Suppose that the claim does not hold. Then we get: The first inequality holds since the weights of the hyperedges e ∈ E v with v (e) ≤ i k − 3 get scaled by at least a factor of 1/β 2 when v moves from level i k − 3 to i k − 1, and the rest can only go down. The second inequality holds since W v→(i k −3) (t k ) ≤ W v→i k−1 (t k ) < 2 by Claim 4.9 and the assumption W + v→(i k −3) (t k ) ≤ 1/(2β). The last inequality holds since β = 6 by Eq. (1).
Note, however, that W v→(i k −1) (t k ) > 1/β, since node v does not stop at level i k − 1 while making the Up-Jump at time t k . Thus, assuming that the claim does not hold leads to a contradiction. Claim 4.10 states that W + v→(i k −3) (t k ) > 1/(2β). Since i k−1 < i k − 3, Eq. (8) implies that W + v→(i k −3) (t 1 ) ≤ W + v→i k−1 (t 1 ) ≤ W + v→i 1 (t 1 ) ≤ 1/β 2 . Thus during the time taken for the latter is proportional ( f · C down ), where C down denotes the increase in the value of the counter C down due to this event. Further, the value of C up remains unchanged. For finding the index j < i, it suffices to focus on the edges E v,i = {e ∈ E v : v (e) ≤ i} since these are the only edges that can potentially change weight as v goes down. Therefore, this takes time (|{e ∈ E v : v (e) ≤ i}|). Since each of these edges had w(e) = β −i and since W v ≤ 1 αβ 2 before the FIX-DOWN-DIRTY(v) call, we have |{e ∈ E v : v (e) ≤ i}| ≤ β i−2 /α which is precisely I down , where I down is the increase in the value of the counter I down due to this event. Therefore, the time taken to find the index j is ( I down ).
Case 2. The subroutine FIX-UP-DIRTY(v) is called which moves the node v from level i to level j > i, say. Once again, we need to account for the time to find the relevant index j and the time taken to update the relevant data structures, and once again by Lemma 2.7 the time taken for the latter is ( f · C up ). Further, the value of C down remains unchanged. We now account for the time taken to find the index j.

Claim 4.11 j can be found in time ( j − i).
Proof To see this note that for k ≥ i, since (a) edges not incident on v are immaterial, (b) the edges incident on v whose levels are already ≥ k do not change their weight, and (c) edges whose levels are < k have their weight go from β − to β −k . The above implies that for k ≥ i, That is, W v→(k+1) can be evaluated from W v→k (t) in (1) time since we store |E v,k | in our data structure. The claim follows.
Note that in Claim 4.11 the time taken to find the index j can be as large as (log n). To account for this time, we again fix a vertex v and a phase v where the level of v changes from i 1 to say i k . The total time for finding indices is (i k − i 1 ). After this, there must be a DOWN-JUMP due to a call to FIX-DOWN-DIRTY(v) since the final graph is empty. Thus, we can charge the time taken in finding indices in this phase v to I down in the FIX-DOWN-DIRTY(v) call right at the end of this phase. We can do so since I down = β i k −2 /α = 1 f 2 (i k ) since β = (1) and α = ( f 2 ) by (1). Therefore, the total time taken to find indices in the FIX-UP-DIRTY(v) calls in all is at most f 2 I down .
To summarize, the time taken to initialize and update the data structures is at most f · C up + C down + T , and the total time taken to find indices is at most ( f 2 · I down ). This proves Lemma 4.1.
Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.

A Duality Between Maximum Fractional Matching and Minimum Vertex Cover
Let y v ∈ {0, 1} be an indicator variable which denotes if the node v ∈ V is picked in the vertex cover. The LP-relaxation for minimum vertex cover is as follows.
Minimize v∈V x v such that: v∈e x v ≥ 1 for all e ∈ E.
x v ≥ 0 for all v ∈ V .
In the above LP, the first constraint encodes the fact that for every hyperedge we have to pick at least one node incident on it. The dual of the above LP is the following.
Maximize e∈E y e such that: e∈E:v∈e y e ≤ 1 for all v ∈ V . y e ≥ 0 for all e ∈ E.
Note that the dual LP precisely encodes the maximum fractional problem: We have to assign a weight y e ≥ 0 to every hyperedge e ∈ E in such a way that the total weight received by any node v from all its incident hyperedges is at most 1. The goal is to maximize the total weight assigned to all the hyperedges. Hence, the size of the maximum fractional matching in a hypergraph is at most the size of its minimum vertex cover.