Fully Dynamic MIS in Uniformly Sparse Graphs

We consider the problem of maintaining a maximal independent set (MIS) in a dynamic graph subject to edge insertions and deletions. Recently, Assadi, Onak, Schieber and Solomon (STOC 2018) showed that an MIS can be maintained in sublinear (in the dynamically changing number of edges) amortized update time. In this paper we significantly improve the update time for uniformly sparse graphs. Specifically, for graphs with arboricity $\alpha$, the amortized update time of our algorithm is $O(\alpha^2 \cdot \log^2 n)$, where $n$ is the number of vertices. For low arboricity graphs, which include, for example, minor-free graphs as well as some classes of `real world' graphs, our update time is polylogarithmic. Our update time improves the result of Assadi et al. for all graphs with arboricity bounded by $m^{3/8 - \epsilon}$, for any constant $\epsilon>0$. This covers much of the range of possible values for arboricity, as the arboricity of a general graph cannot exceed $m^{1/2}$.


Introduction
The importance of the maximal independent set (MIS) problem is hard to overstate. In general, MIS algorithms constitute a useful subroutine for locally breaking symmetry between several choices. The MIS problem has intimate connections to a plethora of fundamental combinatorial optimization problems such as maximum matching, minimum vertex cover, and graph coloring. As a prime example, MIS is often used in the context of graph coloring, as all vertices in an independent set can be assigned the same color. As another important example, Hopcroft and Karp [11] gave an algorithm to compute a large matching (approximating the maximum matching to within a factor arbitrarily close to 1) by applying maximal independent sets of longer and longer augmenting paths. The seminal papers of Luby [18] and Linial [17] discuss additional applications of MIS. A non-exhaustive list of further direct and indirect applications of MIS includes resource allocation [24], leader election [7], the construction of network backbones [16,12], and sublineartime approximation algorithms [22].
In the 1980s, questions concerning the computational complexity of the MIS problem spurred a line of research that led to the celebrated parallel algorithms of Luby [18], and Alon, Babai, and Itai [1]. These algorithms find an MIS in O(log n) rounds without global coordination. More recently, Fischer and Noever [8] gave an even simpler greedy algorithm that considers vertices in random order and takes O(log n) rounds with high probability (see also an earlier result of Blelloch, Fineman, and Shun [4]).
In this work we continue the study of the MIS problem by considering the dynamic setting, where the underlying graph is not fixed, but rather evolves over time via edge updates. Formally, a dynamic graph is a graph sequence G = (G 0 , G 1 , . . . , G M ) on n fixed vertices, where the initial graph is G 0 = (V, ∅) and each graph G i = (V, E i ) is obtained from the previous graph G i−1 in the sequence by either adding or deleting a single edge. The basic goal in this context is to maintain an MIS in time significantly faster than it takes to recompute it from scratch following every edge update.
In STOC'18, Assadi, Onak, Schieber, and Solomon [2] gave the first fully dynamic algorithm for maintaining an MIS with sub-linear (amortized) update time. Their update time is min{m 3/4 , ∆}, where m is the (dynamically changing) number of edges and ∆ is a fixed bound on the maximum degree of the graph. Achieving an update time of O(∆) is simple, and the main technical contribution of [2] is in further reducing the update time to O(m 3/4 ), which improves over the simple O(∆) bound for sufficiently sparse graphs.

Our contribution
We focus on graphs that are "uniformly sparse" or "sparse everywhere", as opposed to the previous work by Assadi et al. [2] that considers unrestricted sparse graphs. We aim to improve the update time of [2] as a function of the "uniform sparsity" of the graph. This fundamental property of graphs has been studied in various contexts and under various names over the years, one of which is arboricity [19,20,23]: Thus a graph has bounded arboricity if all its induced subgraphs have bounded density. The family of bounded arboricity graphs contains, bounded-degree graphs, all minor-closed graph classes (e.g., bounded genus graphs and planar graphs in particular, graphs with bounded treewidth), and randomly generated preferential attachment graphs. Moreover, it is believed that many realworld graphs such as the world wide web graph and social networks also have bounded arboricity [9].
A dynamic graph of arboricity α is a dynamic graph such that all graphs G i have arboricity bounded by α. We prove the following result.

Arboricity and the dynamic edge orientation problem
Our algorithm utilizes two properties of arboricity α graphs: 1. Every subgraph contains a vertex of degree at most 2α.
2. There exists an α out-degree orientation, i.e., an orientation of the edges such that every vertex has out-degree at most α.
The first property follows from Definition 1.1 and the second property is due to a well-known alternate definition by Nash-Williams [20]. It is known that a bounded out-degree orientation of bounded arboricity graphs can be maintained efficiently in dynamic graphs. Brodal and Fagerberg [5] initiated the study of the dynamic edge orientation problem and gave an algorithm that maintains an O(α) out-degree orientation with an amortized update time of O(α + log n) in any dynamic n-vertex graph of arboricity α; our algorithm uses the algorithm of [5] as a black box. (Refer to [14,10,13,3] for additional results on the dynamic edge orientation problem.)

A comparison to Assadi et al.
As noted already by Assadi et al. [2], a central obstacle in maintaining an MIS in a dynamic graph is to maintain detailed information about the 2-hop neighborhood of each vertex. Suppose an edge is added to the graph and as a result, one of its endpoints v is removed from the MIS. In this case, to maintain the maximality of the MIS, we need to identify and add to the MIS all neighbors of v that are not adjacent to a vertex in the MIS. This means that for each of v's neighbors, we need to know whether it has a neighbor in the MIS (other than v). Dynamically maintaining complete information about the 2-hop neighborhood of each vertex is prohibitive.
To overcome this hurdle, we build upon the approach of Assadi et al. [2] and maintain incomplete information on the 2-hop neighborhoods of vertices. Consequently, we may err by adding vertices to the MIS even though they are adjacent to MIS vertices. To restore independence, we need to remove vertices from the MIS. The important property that we maintain, following [2], is that the number of vertices added to the MIS following a single update operation will be significantly higher than the number of removed vertices. Like [2], we analyze our algorithm using a potential function defined as the number of vertices not in the MIS. The underlying principle behind achieving a low amortized update time is to ensure that if the process of updating the MIS takes a long time, then the size of the MIS increases substantially as a result. On the other hand, the size of the MIS may decrease by at most one following each update. Our algorithm deviates significantly from Assadi et al. in several respects, described next.
I: An underlying bounded out-degree orientation. We apply the algorithm of [5] for efficiently maintaining a bounded out-degree orientation. Given such an orientation, we can maintain complete information about the 2-hop out-neighborhoods of vertices (i.e., the 2-hop neighborhoods restricted to the outgoing edges of vertices), which helps significantly in the maintenance of the MIS. More specifically, the usage of a bounded out-degree orientation enables us to reduce the problem to a single nontrivial case, described in Section 3.1.
II: An intricate chain reaction. To handle the nontrivial case efficiently, we develop an intricate "chain reaction" process, initiated by adding vertices to the MIS that violate the independence property, which then forces the removal of other vertices from the MIS, which in turn forces the addition of other vertices, and so forth. Such a process may take a long time. However, by employing a novel partition of a subset of the in-neighborhood of each vertex into a logarithmic number of "buckets" (see point III) together with a careful analysis, we limit this chain reaction to a logarithmic number of steps; upper bounding the number of steps is crucial for achieving a low update time. We note that such an intricate treatment was not required in [2], where the chain reaction was handled by a simple recursive procedure.
III: A precise bucketing scheme. In order to achieve a sufficient increase in the size of the MIS, we need to carefully choose which vertices to add to the MIS so as to guarantee that at every step of the aforementioned chain reaction, even steps far in the future, we will be able to add enough vertices to the MIS. We achieve this by maintaining a precise bucketing of a carefully chosen subset of the in-neighborhood of each vertex, where vertices in larger-indexed buckets are capable of setting off longer and more fruitful chain reactions. At the beginning of the chain reaction, we add vertices in the larger-indexed buckets to the MIS, and gradually allow for vertices in smaller-indexed buckets to be added.
IV: A tentative set of MIS vertices. In contrast to the algorithm of Assadi et al., here we cannot iteratively choose which vertices to add to the MIS. Instead, we need to build a tentative set of all vertices that may potentially be added to the MIS, and only later prune this set to obtain the set of vertices that are actually added there. If we do not select the vertices added to the MIS in such a careful manner, we may not achieve a sufficient increase in the size of the MIS. To guarantee that the number of vertices actually added to the MIS (after the pruning of the tentative set) is sufficiently large, we make critical use of the first property of bounded arboricity graphs mentioned in Section 1.2.1.

A comparison to other previous work
Censor-Hillel, Haramaty, and Karnin [6] consider the problem of maintaining an MIS in the dynamic distributed setting. They show that there is a randomized algorithm that requires only a constant number of rounds in expectation to update the maintained MIS, as long as the sequence of graph updates does not depend on the algorithm's randomness. This assumption is often referred to as oblivious adversary. As noted by Censor-Hillel et al., it is unclear whether their algorithm can be implemented with low total work in the centralized setting. This shortcoming is addressed by Assadi et al. [2] and by the current paper.
Kowalik and Kurowski [15] employ a dynamic bounded out-degree orientation to answer shortest path queries in (unweighted) planar graphs. Specifically, given a planar graph and a constant k, they maintain a data structure that determines in constant time whether two vertices are at distance at most k, and if so, produces a path of such length between them. This data structure is fully dynamic with polylogarithmic amortized update time. They show that the case of distance k queries (for a general k ≥ 2) reduces in a clean way to the case of distance 2 queries. Similarly to our approach, Kowalik and Kurowski maintain information on the 2-hop neighborhoods of vertices, but the nature of the 2-hop neighborhood information necessary for the two problems is inherently different. For answering distance 2 queries it is required to maintain complete information on the 2-hop neighborhoods, whereas for maintaining an MIS one may do with partial information. On the other hand, the 2-hop neighborhood information needed for maintaining an MIS must be more detailed, so as to capture the information as it pertains to the 1-hop neighborhood. Such detailed information is necessary for determining the vertices to be added to the MIS following the removal of a vertex from the MIS.

Dynamic MIS vs. dynamic maximal matching
In the maximal matching problem, the goal is to compute a matching that cannot be extended by adding more edges to it. The problem is equivalent to finding an MIS in the line graph of the input graph. Despite this intimate relationship between the MIS and maximal matching problems, (efficiently) maintaining an MIS appears to be inherently harder than maintaining a maximal matching. As potential evidence, there is a significant gap in the performance of the naive dynamic algorithms for these problems. (The naive algorithms just maintain for each vertex whether it is matched or in the MIS.) For the maximal matching problem, the naive algorithm has an update time of O(∆). This is because the naive algorithm just needs to inspect the neighbors of a vertex v, when v becomes unmatched, to determine whether it can to be matched. For the MIS problem, when a vertex v is removed from the MIS, the naive algorithm needs to inspect not only the neighbors of v, but also the neighbors of v's neighbors to determine which vertices need to be added to the MIS; as a result the update time is O(min{m, ∆ 2 }). Furthermore, the worst-case number of MIS changes (by any algorithm) may be as large as Ω(∆) [6,2], whereas the worst-case number of changes to the maximal matching maintained by the naive algorithm is O(1). Lastly, the available body of work on the dynamic MIS problem is significantly sparser than that on the dynamic maximal matching problem.
It is therefore plausible that it may be hard to obtain, for the dynamic MIS problem, a bound better than the best bounds known for the dynamic maximal matching problem. In particular, the state-of-the-art dynamic deterministic algorithm for maintaining a maximal matching has an update time of O( √ m) [21], even in the amortized sense. Hence, in order to obtain deterministic update time bounds sub-polynomial in m, one may have to exploit the structure of the graph, and bounded arboricity graphs are a natural candidate. A maximal matching can be maintained in graphs of arboricity bounded by α with amortized update time O(α + √ α log n) [21,10]; as long as the arboricity is polylogarithmic in n, the amortized update time is polylogarithmic. In this work we show that essentially the same picture applies to the seemingly harder problem of dynamic MIS.

Algorithm overview
Using a bounded out-degree orientation of the edges, a very simple algorithm suffices to handle edge updates that fall into certain cases. The nontrivial case occurs when we remove a vertex v from the MIS and need to determine which vertices in v's in-neighborhood have no neighbors in the MIS, and thus need to be added to the MIS. The in-neighborhood of v could be very large and it would be costly to spend even constant time per in-neighbor of v. Furthermore, it would be costly to maintain a data structure that stores for each vertex in the MIS which of its in-neighbors have no other neighbors in the MIS. Suppose we stored such a data structure for a vertex v. Then the removal of a vertex u from the MIS could cause the entirety of the common neighborhood of u and v to change their status in v's data structure. If this common neighborhood is large, then this operation is costly.
To address this issue, our algorithm does not even attempt to determine the exact set of neighbors of v that need to be added to the MIS. Instead, we maintain partial information about which vertices will need to be added to the MIS. Then, when we are unsure about whether we need to add a specific vertex to the MIS, we simply add it to the MIS and remove its conflicting neighbors from the MIS, which triggers a chain reaction of changes to the MIS. Despite the fact that this chain reaction may take a long time to resolve, we obtain an amortized time bound by using a potential function: the number of vertices not in the MIS. That is, we ensure that if we spend a lot of time processing an edge update, then the size of the MIS increases substantially as a result.
The core of our algorithm is to carefully choose which vertices to add to the MIS at each step of the chain reaction to ensure that the size of the MIS increases sufficiently. To accomplish this, we store an intricate data structure for each vertex which includes a partition of a subset of its in-neighborhood into numbered buckets. The key idea is to ensure that whenever we remove a vertex from the MIS, it has at least one full bucket of vertices, which we add to the MIS.
When we remove a vertex from the MIS whose top bucket is full of vertices, we begin the chain reaction by adding these vertices to the MIS (and removing the conflicting vertices from the MIS). In each subsequent step of the chain reaction, we process more vertices, and for each processed vertex, we add to the MIS the set of vertices in its topmost full bucket. To guarantee that every vertex that we process has at least one full bucket, we utilize an invariant (the "Main Invariant") which says that for all i, when we process a vertex whose bucket i is full, then in the next iteration of the chain reaction we will only process vertices whose bucket i − 1 is full. This implies that if the number of iterations in the chain reaction is at most the number of buckets, then we only process vertices with at least one full bucket. To bound the number of iterations of the chain reaction, we prove that the number of processed vertices doubles at every iteration. This way, there cannot be more than a logarithmic number of iterations. Thus, by choosing the number of buckets to be logarithmic, we only process vertices with at least one full bucket, which results in the desired increase in the size of the MIS.

Algorithm setup
Our algorithm uses a dynamic edge orientation algorithm as a black box. For each vertex v, let

The trivial cases
Let M be the MIS that we maintain. For certain cases of edge updates, there is a simple algorithm to update the M. Here, we introduce this simple algorithm and then describe the case that this algorithm does not cover.
The data structure is simply that each vertex v stores (i) the set M − (v) of v's in-neighbors that are in M, and (ii) a partition of its in-neighborhood into resolved vertices and unresolved vertices. To maintain this data structure, whenever a vertex v enters or exits M, v notifies its 2-hop out-neighborhood. Additionally, following each update to the edge orientation, each affected vertex notifies its 2-hop out-neighborhood.

Delete(u,v):
• It cannot be the case that both u and v are in M since M is an independent set.
• If neither u nor v is in M then both must already have neighbors in M and we do nothing.
• If u ∈ M and v ∈ M, then we may need to add v to M. Insert(u,v): • If it is not the case that both u and v are in M, then we do nothing and M remains maximal.
• If both u and v are in M we remove v from M. Now, some of v's neighbors may need to be added to M, specifically, those with no neighbors in M. For each unresolved vertex we know not to add w to M. On the other hand, for each unresolved vertex w ∈ N − (v), we do not know whether to add w to M and it could be costly to scan N + (w) for all such w. This simple algorithm does not handle the case where v has many unresolved in-neighbors.
In summary, the nontrivial case occurs when we delete a vertex v from M and v has many unresolved in-neighbors.

Data structure
As in the trivial cases, each vertex v maintains M − (v) and a partition of N − (v) into resolved vertices and unresolved vertices. In addition, we further refine the set of unresolved vertices. One important subset of the unresolved vertices in N − (v) is the active set of v, denoted A v . As motivated in the algorithm overview, A v is partitioned into b buckets A v (1), . . . , A v (b) each of size at most s. We will set b and s so that b = Θ(log n) and s = Θ(α).
The purpose of maintaining A v is to handle the event that v is removed from M. When v is removed from M, we use the partition of A v into buckets to carefully choose which neighbors of v to add to M to begin a chain reaction of changes to M. For the rest of the vertices in A v , we scan through them and update the data structure to reflect the fact that v ∈ M. This scan of A v is why it is important that each active set is small (size O(α log n)).
One important property of active sets is that each vertex is in the active set of at most one vertex. For each vertex v, let a(v) denote the vertex whose active set contains v.
For each vertex v the data structure maintains the following partition of N − (v): • R v (the residual set ) is the set of unresolved vertices in N − (v) not in the active set of any vertex.
We note that while Z v depends only on M and the orientation of the edges, the other three sets depend on internal choices made by the algorithm. In particular, for each vertex v, the algorithm picks at most one vertex a(v) for which v ∈ A a(v) and this choice uniquely determines for every vertex u ∈ N + (v), which set (A u , P u , or R u ) v belongs to.
We now outline the purpose of the passive set and the residual set. Suppose a vertex v is removed from M. We do not need to worry about the vertices in P v because we know that all of these vertices are in the active set of a vertex in M and thus none of them need to be added to M. On the other hand, we do not know whether the vertices in R v need to be added to M. We cannot afford to scan through them all and we cannot risk not adding them since this might cause M to not be maximal. Thus, we add them all to M and set off a chain reaction of changes to M. That is, even though our analysis requires that we carefully choose which vertices of A v to add to M during the chain reaction, it suffices to simply add every vertex in R v to M (except for those with edges to other vertices we are adding to M).

Invariants
We maintain several invariants of the data structure. The invariant most central to the overall argument is the Main Invariant (Invariant 6), whose purpose is outlined in the algorithm overview. The first four invariants follow from the definitions.
The next invariant says that the active set of a vertex is filled from lowest bucket to highest bucket and only then is the residual set filled.

Invariant 5. (Full Invariant). For all vertices v and all
The next invariant, the Main Invariant, says that if we were to move v from A a(v) to the active set of a different vertex u by placing v in the lowest non-full bucket of A u , then B(v) would not decrease.

Algorithm phases
The algorithm works in four phases. During all phases, for each vertex v we maintain M − (v). Otherwise, the data structure is completely static during phases 1 and 3.

Algorithm for updating M
When an edge (u, v) is deleted, we run the procedure Delete(u,v) specified in the trivial cases section. When an edge (u, v) is inserted and it is not the case that both u and v are in M, then we do nothing and M remains maximal. In the case that both u and v are in M, we need to remove either u or v from M which may trigger many changes to M. For the rest of this section we consider this case of an edge insertion (u, v).
The procedure of updating M happens in two stages. In the first stage, we iteratively build two sets of vertices, S + and S − . Intuitively, S + is a subset of vertices that we intend to add to M and S − is the set of vertices that we intend to delete from M. The aforementioned chain reaction of changes to M is captured in the construction of S + and S − . In the second stage we make changes to M according to S + and S − . In particular, the set of vertices that we add to M contains a large subset of S + as well as some additional vertices, and the set of vertices that we remove from M is a subset of S − . In accordance with our goal of increasing the size of M substantially, we ensure that S + is much larger than S − .
Why is it important to build S + before choosing which vertices to add to M? The answer is that it is important that we add a large subset of S + to M since our goal is to increase the size of M substantially. We find this large subset of S + by finding a large MIS in the graph induced by S + , which exists (and can be found in linear time) because the graph has bounded arboricity. Suppose that instead of iteratively building S + , we tried to iteratively add vertices directly to M in a greedy fashion. This could result in only very few vertices successfully being added to M. For example, if we begin by adding the center of a star graph to M and subsequently try to add the leaves of the star, we will not succeed in adding any of the leaves to M. On the other hand, if we first add the vertices of the star to S + then we can find a large MIS in the star (the leaves) to add it to M.

Stage 1: Constructing S + and S −
The crux of the algorithm is the construction of S + and S − . A key property of the construction is that S + is considerably larger than S − : After constructing S + and S − we will add at least |S + | 2α vertices to M and remove at most |S − | vertices from M. Thus, Lemma 4.1 implies that M increases by Ω( |S + | α ). To construct S + and S − , we define a recursive procedure Process(w) which adds at least one full bucket of A w to S + . A key idea in the analysis is to guarantee that for every call to Process(w), A w indeed has at least one full bucket.

Algorithm description
We say that a vertex w ∈ S − has been processed if Process(w) has been called and otherwise we say that w is unprocessed. We maintain a partition of S − into the processed set and the unprocessed set and we maintain a partition of the set of unprocessed vertices w into two sets based on whether A w is full or not. We also maintain a queue Q of vertices to process, which is initially empty. Recall that (u, v) is the inserted edge and both u and v are in M. The algorithm is as follows.
First, we add v to S − . Then, if A v is not full, we terminate the construction of S + and S − . Otherwise, we call Process(v).

Process(w):
1. If A w is full, then add all vertices in A w (b) ∪ R w to S + . If A w is not full, then let i be the largest full bucket of A w and add all vertices in A w (i) and A w (i + 1) to S + . We will claim that such an i exists (Lemma 4.2).
2. For all vertices x added to S + in this call to Process, we add N + (x) ∩ M to S − .
3. If S − contains an unprocessed vertex x with full A x , we call Process(x).
When a call to Process terminates, including the recursive calls, we check whether Lemma 4.1 is satisfied (that is, whether |S + | ≥ 4α|S − |), and if so, we terminate. Other-wise, if Q is not empty, we let w be the next vertex in Q and call Process(w). If Q is empty we enqueue a new batch of vertices to Q. This batch consists of the set of all unprocessed vertices in S − . We will claim that such vertices exist (Lemma 4.2).
Remark. The reason we terminate without calling Process(v) if A v is not full (i.e. R v is empty) is because R v is the only set for which we cannot afford to determine whether or not each vertex has another neighbor in M (besides v): We know that each vertex w ∈ Z v ∪ P v has another neighbor in M, and the set A v is small enough to scan. For the same reason, step 3 of Process is necessary because it ensures that for every vertex w in S − , all vertices in R w are in S + . If this weren't the case and we removed a vertex w in S − from M, we might be left in the "hard case" of needing to deal with R w . Lemma 4.1 follows from the algorithm specification: either the algorithm terminates immediately with S − = {v} or the algorithm terminates according to the termination condition, which is that Lemma 4.1 is satisfied.
Several steps in the algorithm (Step 2 of Process(w) and the last sentence of the algorithm specification) rely on Lemma 4.2: 1. If we call Process(w), then A w has at least one full bucket.
2. Every batch of vertices that we enqueue to Q is nonempty.  Proof. We proceed by induction on j. Base case. If j = 1 then the algorithm only calls Process(w) on vertices w with full A w and thus full A w (b).
Inductive hypothesis. Suppose that during epoch j, all of the processed vertices have full A w (b − j + 1).
Inductive step. We will show that during epoch j + 1, all of the processed vertices have full A w (b − j). We first note that during Process(w), the algorithm only adds the vertices in the topmost full bucket of A w to S + . Thus, the inductive hypothesis implies that for all vertices Then, by the Main Invariant, for all x ∈ S + j and all y ∈ N + (x) ∩ M, A y (b − j) is full. By construction, the only vertices in S − j other than v are those in N + (x) ∩ M for some x ∈ S + j . Thus, for all vertices y ∈ S − j , A y (b − j) is full. During epoch j + 1, the set of vertices that we process consists only of vertices w that are either in S − j or have full A w . We have shown that all of these vertices w have full A w (b − j).  Lemma 4.6. For all 1 < j ≤ b, p j > 2p j−1 . That is, the number of processed vertices more than doubles during each epoch.
Proof. At the end of epoch j − 1, we add all unprocessed vertices to Q. As a result of calling Process on each vertex in Q, the number of processed vertices increases by u j−1 by the end of epoch j. That is, p j ≥ p j−1 + u j−1 . By Lemma 4.5, p j−1 < u j−1 , so p j > 2p j−1 .
We apply these lemmas to complete the proof of Lemma 4.2: 1. In epoch 1 we process at least one vertex, so p 1 ≥ 1. By Lemma 4.6, p j > 2p j−1 . Thus, p j ≥ 2 j−1 . If j = b = log 2 n + 1, then p j > n, a contradiction. Thus, the algorithm never reaches the end of epoch b. Then, by Lemma 4.3, every time we call Process(w), A w has at least one full bucket.
2. Suppose by way of contradiction that we enqueue no vertices to Q at the end of some epoch Then, u j = 0. By Lemma 4.5, p j < u j , so p j < 0, a contradiction.

Stage 2:
Updating M given S + and S −

Algorithm description
A brief outline for updating M given S + and S − is as follows: We begin by finding a large MIS M ′ in the graph induced by S + and adding the vertices in M ′ to M. This may cause M to no longer be an independent set, so we remove from M the vertices adjacent to those in M ′ . By design, all of these removed vertices are in S − . Now, M may no longer be maximal, so we add to M the appropriate neighbors of the removed set. The details follow. Lemma 4.8. If G ′ is a graph on n ′ nodes of arboricity α, then there is an O(n ′ α) time algorithm to find an MIS M ′ in G ′ of size at least n ′ 2α . Proof. Since G ′ has arboricity α, every subset of G ′ must have a vertex of degree at most 2α. The algorithm is simple. Until G ′ is empty, we repeatedly find a vertex w of degree at most 2α, add w to M ′ , and then remove w and N (w) from G ′ . For every vertex we add to M, we remove at most 2α other vertices from the graph so |M ′ | ≥ n ′ 2α . To implement this algorithm, we simply use a data structure that keeps track of the degree of each vertex and maintains a partition of the vertices into two sets: one containing the vertices of degree at most 2α and the other containing the rest. Then the removal of each edge takes O(1) time. G ′ has at most n ′ α edges so the runtime of the algorithm is O(n ′ α).
The algorithm consists of four steps.
1. We find an MIS M ′ in the graph induced by S + using the algorithm of Lemma 4.8.
Then we add to M all vertices in M ′ .
2. For all vertices w ∈ M ′ , we remove from M all vertices in N + (w) ∩ M. We note that N − (w) ∩ M = ∅ because otherwise w would be resolved, and S + contains no resolved vertices.
3. If u and v are both in M (recall that we are considering an edge insertion (u, v)), we remove v from M. We note that this step is necessary because v needs to be removed from M and this may not have happened in step 2.  By Lemma 4.8, in step 1 we add at least |S + | 2α vertices to M. Observation 4.9 implies that we delete at most |S − | vertices from M.

The set of vertices added to M is disjoint from the set of vertices removed from M.
We will show that the set of vertices added to M were not in M when the edge update arrived and the set of vertices removed from M were in M when the edge update arrived.
By Observation 4.9, every vertex that we remove from M is in S − . By construction, a vertex is only added to S − if it is in M.
Every vertex that is added to M is added in either step 1 or step 4. We claim that every vertex that is added to M is the neighbor of a vertex in S − , and thus was not in M when the edge update arrived. With Observation 4.9, this claim is clear for vertices added to M during step 4. If a vertex w is added to M in step 1 then w ∈ S + . By construction, a vertex is only added to S + if it is a neighbor of a vertex in S − .

M is an MIS.
M is an MIS because our algorithm is designed so that when we add a vertex w to M we remove all of w's neighbors from M, and when we remove a vertex w from M we add to M all of w's neighbors that have no neighbors in M. A formal proof follows.
Suppose by way of contradiction that M is not an independent set. Let (w, x) be an edge such that w and x are both in M. Due to step 3, (w, x) cannot be (u, v) or (v, u). Since M was an independent set before being updated, at least one of w or x was added to M during the update. Without loss of generality, suppose w was added to M during the update and that the last time w was added to M was after the last time x was added to M. This means that when w was added to M, x was already in M.
Case 1: w was last added to M during step 4. In step 4, only vertices with no neighbors in M are added to M so this is impossible.
Case 2: w was last added to M during step 1 and x was last added to M before the current update to M. After w is added to M in step 1, we remove N + (v) ∩ M from M. Thus, x ∈ N + (v) so x must be in N − (v). But x was in M right before the current update so w is resolved. Since w was added to M during step 1, w ∈ S + and by construction the only vertices added to S + are those in the active set or residual set of some vertex. By the Consistency Invariant, because w is resolved, it is not in the active set or residual set of any vertex, a contradiction.
Case 3: w was last added to M during step 1 and x was last added to M during the current update during step 1. Both x and w are in S + . An MIS in the graph induced by S + is added to M so x and w could not both have been added to M, a contradiction. Now, suppose by way of contradiction that M is not maximal. Let w be a vertex not in M such that no vertex in N (w) is in M. Since M was maximal before the current update, during this update, either w or one of its neighbors was removed from M. Let x be the last vertex in N (w) ∪ {w} to be removed from M. Every vertex that is removed from M (either in step 2 or step 3) has a neighbor in M at the time its removal. Thus, x cannot be w because if x were w then w would be removed from M with no neighbors in M. Thus, x must be in N (w). Since x is removed from M during the current update, in step 4 we add to M all vertices in Case 1: w ∈ Z x . By the definition of resolved, right before the current update, either w was in M or there was a vertex y ∈ N − (w) in M. If w was in M then w was removed from M during the current update. Every vertex that is removed from M (either in step 2 or step 3) has a neighbor that was added to M during the current update. By part 2 of the Lemma, the set of vertices that is added to M is disjoint from the set of vertices that is removed from M. Thus, after processing the current update, w has a neighbor in M, a contradiction.
On the other hand, if y ∈ N − (w) was in M right before the current update, then during the current update, y was removed from M. Then in step 4, all vertices in N + (y) with no neighbors in M are added to M. This includes w, a contradiction.
Case 2: w ∈ P x . Right before the current update, w was in A y for some y. During the current update, y was removed from M. In step 4, all vertices in A y with no neighbors in M are added to M. This includes w, a contradiction.
Case 3: w ∈ R x . By Observation 4.9, every vertex removed from M during step 2 is in S − . By construction for all vertices y ∈ S − , if R y is nonempty then we add every vertex R y to S + . Thus, if x was removed from M in step 2, then w was added to S + in step 1. Also, if x was removed from M in step 3, then x = v and Process(x) was called, which adds w to S + . So, in either case w is in S + . We add an MIS in the graph induced by S + to M, so either w or a neighbor of w must be in M, a contradiction.

Runtime analysis of updating M
Let T be the amortized update time of the black box dynamic edge orientation algorithm and let D is the out-degree of the orientation. Ultimately, we will apply the algorithm of Brodal and Fagerberg [5] which achieves D = O(α) and T = O(α + log n). In this section we show that updating M takes amortized time O(αD).
Let U be the total number of updates and let ∆ + and ∆ − be the total number of additions of vertices to M and removals of vertices from M, respectively, over the whole computation.
Let S + i and S − i be the sets S + and S − , respectively, constructed while processing the i th update (note that this is a different definition of S + i than the definition in earlier sections).
Otherwise, |S − | ≤ 1 so the net decrease in |M| is at most 1. Thus, the increase in |M| over the whole computation, which is equivalent to We now show that ∆ − = O(U ) and ∆ + = O(U ). Because the graph is initially empty, M initially contains every vertex. Thus, over the whole computation, the number of additions to M cannot exceed the number of removals from M. That is, ∆ + ≤ ∆ − .
Proof. By Lemma 4.7, Proof. By construction, it takes constant time to decide to add a single vertex to S + , however, the same vertex could be added to S + multiple times. A vertex w can be added to S + only when Process(x) is called for some x ∈ N + (w). Process is called at most once per vertex (per update), so each vertex is added to S + a maximum |N + (w)| ≤ D times. Therefore, over the whole computation it takes a total of O(D U i=1 |S + i |) time to build S + . To build S − , we simply scan the out-neighborhood of every vertex in S + . Thus, over the whole Proof. In step 1 we begin by constructing the graph induced by S + . To do this, it suffices to scan the out-neighborhood of each vertex in S + since every edge in the graph induced by S + must be outgoing of some vertex in S + . This takes time O(|S + |D). Next, we find M ′ , which takes time O(|S + |) by Lemma 4.8.
In step 2, for each vertex w in M ′ , we scan N + (v), which takes time O(|S + |D). By Lemma 5.2, steps 1 and 2 together take amortized time O(αD).
Step 3 takes constant time.
In step 4, we scan the 2-hop out-neighborhood of each vertex w that has been removed from M, as well as the out-neighborhood of some vertices in A w . Over the whole computation, this takes time O(∆ − (D 2 + αD log n)), which is amortized time O(D 2 + αD log n) by Lemma 5.1.
In total the amortized time is O(D 2 + αD log n) = O(D 2 log n).
6 Updating the data structure

Satisfying the Main Invariant
The most interesting part of the runtime analysis involves correcting violations to the Main Invariant. This is also the bottleneck of the runtime. The Main Invariant is violated when a vertex v is added to M. In this case, A v is empty and needs to be populated. We begin by analyzing the runtime of two basic processes that happen while updating the data structure: adding a vertex to some active set (Lemma 6.1) and removing a vertex from some active set (Lemma 6.2).
Recall that T is the amortized update time of the black box dynamic edge orientation algorithm and D is the out-degree of the orientation. Proof. When we add a vertex v to some A u (i), for all w ∈ N + (v) this could causes a violation to the Consistency Invariant. To remedy this, it suffices to remove v from whichever set it was previously in with respect to w (which is not A w ) and add it to P w (i).
Lemma 6.2. Removing a vertex v from some active set A u and updating the data structure accordingly takes time O(D log n).
Proof. When we remove a vertex v from some A u (i), this leaves bucket A u (i) not full so the Full Invariant might be violated. To remedy this, we move a vertex, the replacement vertex, from a higher bucket or the residual set to A u (i). That is, the replacement vertex w is chosen to be any arbitrary vertex from R u ∪ A u (i + 1) ∪ · · · ∪ A u (b) ∪ P u (i + 1) ∪ · · · ∪ P u (b). We can choose a vertex from this set in constant time by maintaining a list of all non-empty P x (i) and A x (i) for each vertex x. If w is chosen from P u , we remove w from A a(w) before adding w to A u (i).
The removal of w from its previous bucket in its previous active set may leave this bucket not full, so again the Full Invariant might be violated and again we remedy this as described above, which sets off a chain reaction. The chain reaction terminates when either there does not exist a viable replacement vertex or until the replacement vertex comes from the residual set. Since the index of the bucket that we choose the replacement vertex from increases at every step of this process, the length of this chain reaction is at most b. 1 For each vertex v that we add to an active set, we have already removed v from its previous active set, so Lemma 6.1 applies. Overall, we move at most b vertices to a new bucket and by  Proof. To satisfy the Main Invariant, we need to populate A v . We fill A v in order from bucket 1 to bucket b. First, we add the vertices in R v until either A v is full or R v becomes empty. If R v becomes empty, then we start adding the vertices of P v (i) in order from i = b to i = 1; however, we only add vertex u to A v if this causes B(u) to decrease. Once we reach a vertex u in P v where moving u to the lowest numbered non-full bucket of A v does not cause B(u) to decrease, then we stop populating A v . Each time we add a vertex u to A v from P v , we first remove u from A a(u) and apply Lemma 6.2. Also, each time we add a vertex to A v , we apply Lemma 6.1. We note that this method of populating A v is consistent with the Main Invariant.
We add at most sb = O(α log n) vertices to A v and for each one we could apply Lemmas 6.2 and 6.1 in succession. Thus, the total time is O(αD log 2 n).

Satisfying the rest of the invariants
Recall the 4 phases of the algorithm from Section 3.4. We update the data structure in phases 2 and 4.

Phase 2 of the algorithm
In phase 2 we need to update the data structure to reflect the changes to M that occur in phase 1. We note that updating M could cause immediate violations to only the Resolved Invariant, the Empty Active Set Invariant, and the Main Invariant. That is, in the process of satisfying these invariants, we will violate other invariants but the above three invariants are the only ones directly violated by changes to M. We prove one lemma for each of these three invariants (the lemma for the Main Invariant was already proven as Lemma 6.3).
As a technicality, in phase 2 of the algorithm we update the data structure ignoring the newly added edge and instead wait until the data structure update in phase 4 of the algorithm to insert and orient this edge. This means that during the data structure update in phase 2 of the algorithm, M may not be maximal with respect to the graph that we consider.
The time bounds in the following Lemmas (and Lemma 6.3) are stated with respect to a single change to M. By Corollary 10, the amortized number of changes to M is O(1) per update, so the time spent per change to M is the same as the amortized time per update. Proof. Suppose v is removed from M. Previously every vertex in N + (v) ∪ {v} was resolved and now some of these vertices might be unresolved. To address the Resolved Invariant, for each newly unresolved vertex u ∈ N + (v) ∪ {v}, for all w ∈ N + (u), we need to remove u from Z w . To accomplish this, we do the following. For all u ∈ N + (v), if |M − (u)| = 0, then we know that u has become unresolved. In this case, we scan N + (u) and for each w ∈ N + (u), we remove u from Z w . Now, for each such w, we need to add u to either A w , P w , or R w . To do this, we find the vertex x ∈ N + (u) ∩ M with the smallest |A x |. If A x is not full, then we add u to the lowest bucket of A x that's not full and apply Lemma 6.1. If A x is full then for all w ∈ N + (u) we add u to R w .
There are at most D + 1 vertices in N + (v) ∪ {v} and for each u ∈ N + (v) we spend O(D) time scanning N + (u). Then, for each u, we may apply Lemma 6.1. Thus, the runtime is O(D 2 ).
Suppose v is added to M. Some vertices in N + (v) ∪ {v} may have previously been unresolved, but now they are all resolved. We scan N + (v) ∪ {v} and for all u ∈ N + (v) and all w ∈ N + (u), we remove u from whichever set it is in with respect to w and add u to Z w . If we removed u from A w , then we update the data structure according to Lemma 6.2.
There are D + 1 vertices in N + (v) ∪ {v} and each u ∈ N + (v) can only be removed from a single A w because the Consistency Invariant says that each vertex is in at most one active set. Thus, the runtime is O(D 2 log n).
Lemma 6.5. The time to update the data structure in response to a violation of the Empty Active Set Invariant triggered by a single change to M is O(Dα log n).
Proof. The Empty Active Set Invariant can be violated only upon removal of a vertex v from M. To satisfy the invariant, we need to empty A v . For each vertex u in A v , if |M − (u)| > 0, then u is resolved and otherwise u is unresolved. First, we address the case where u is resolved. For each vertex w ∈ N + (u) we remove u from whichever set it is in with respect to w (which is not A w since u is in A v ) and add u to Z w .
There are sb = O(α log n) vertices u in A v and for each u we spend O(D) time scanning N + (u). Thus, the runtime for dealing with the resolved vertices in A v is O (Dα log n). Now, we address the case where u in A v is unresolved. For each u in A v that is unresolved, and for each w ∈ N + (u), we need to add u to either A w , P w , or R w . To do this, we perform the same procedure as in Lemma 6.4: We find the vertex x in N + (u) ∩ M with the smallest |A x |. If A x is not full, then we add u to the lowest bucket of A x that's not full and apply Lemma 6.1. If A x is full then for all w ∈ N + (u) we add u to R w .
There are sb = O(α log n) vertices u in A v and for each such u we spend O(D) time scanning N + (u). Then, for each u, we may apply Lemma 6.1. Thus, the runtime for dealing with unresolved vertices in A v is O(Dα log n).

Phase 4 of the algorithm
In phase 4 of the algorithm, we need to update the data structure to reflect the edge reorientations that occur in phase 3. If the update was an insertion, we also need to update the data structure to reflect this new edge. We note that reorienting edges could cause immediate violations only to the Resolved Invariant and the Orientation Invariant. That is, in the process of satisfying these invariants, we will violate other invariants but the above two invariants are the only ones directly violated by edge reorientations and insertions. Recall that T is the amortized update time of the black box dynamic edge orientation algorithm.
Lemma 6.6. The total time to update the data structure in response to edge reorientations and insertions is O(T D log n).
Proof. Edge reorientations and insertions can cause violations only to the Resolved Invariant and the Orientation Invariant. Consider an edge (u, v) that is flipped or inserted so that it is now oriented towards v. If the edge was flipped, then previously v was in either Z u , A u , P u , or R u , and now we remove v from this set. If v was in A u , then we process the removal of v from A u according to Lemma 6.2 and add v to the active set of another vertex if possible. To do this, we perform the same procedure as in Lemma 6.4: we find the vertex x ∈ N + (u) ∩ M with the smallest |A x |. If A x is not full, then we add u to the lowest bucket of A x that's not full and apply Lemma 6.1. If A x is full then for all w ∈ N + (u) we add u to R w . In the above procedure we apply Lemma 6.2, spend O(D) time scanning N + (v), and apply Lemma 6.1. This takes time O(D log n).
Before the edge (u, v) was flipped or inserted, u was not in Z v , A v , P v , or R v and now we need to add u to one of these sets.
• If u is resolved, we add u to Z v .
• If u is in an active set and the number of the lowest non-full bucket of A v is less than B(u), then we remove u from A a(u) , applying Lemma 6.2, and add u to the lowest non-full bucket of A v , applying Lemma 6.1.
• If A v is not full and u is not in any active set then we add u to the lowest non-full bucket of A v , applying Lemma 6.1.
• Otherwise, if u is in the active set of some vertex, we add u to P v in the appropriate bucket.
• Otherwise, u is not in any active set and we add u to R v .
The slowest of the above options is to apply Lemmas 6.2 and 6.1 in succession which takes time O(D log n).
We have shown that updating the data structure takes time O(D log n) per edge flip, which is amortized time O(DT log n) per update.
Combining the runtime analyses of updating M, running the edge orientation algorithm, and updating the data structure, the total runtime of the algorithm is O(αD log 2 n + D 2 log n + T D log n). The edge orientation algorithm of Brodal and Fagerberg [5] achieves D = O(α) and T = O(α + log n). Thus, the runtime of our algorithm is O(α 2 log 2 n).