 # Dynamic Maximal Independent Set

Given a stream S of insertions and deletions of edges of an underlying graph G (with fixed vertex set V where n=|V| is the number of vertices of G), we propose a dynamic algorithm that maintains a maximal independent set (MIS) of G (at any time t of the stream S) with amortized update time O(^3 n).

## Authors

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

Very recently at STOC 2018, Assadi, Onak, Schieber, and Solomon  proposed a deterministic dynamic algorithm for maintaining a maximal independent set (MIS) with amortized update time , where is a fixed bound on the maximum degree in the graph and is the (dynamically changing) number of edges. Later, Gupta and Khan  and independently, Du and Zhang  presented deterministic algorithms for dynamic MIS with update times of and , respectively. Du and Zhang also gave a randomized algorithm with update time . Later at SODA 2019, Assadi, Onak, Schieber, and Solomon  developed the first fully dynamic (randomized) algorithm for maintaining a MIS with expected amortized update time.

Here we develop the first randomized dynamic algorithm for MIS with amortized update time . Our main result is stated in the following theorem.

###### Theorem 1

Let be a stream of insertions and deletions of edges of an underlying unweighted graph with a fixed vertex set of size . Then, there exists a randomized dynamic algorithm that maintains a maximal independent set of using amortized update time.

#### Overview of Algorithm.

To prove this theorem we first devise an offline MIS algorithm in Section 2 and then in Section 3 we show how to implement steps of this offline algorithm in a streaming fashion while maintaining a maximal independent set using fast update time. In Section 4 we give our dynamic algorithm that handles insertions and deletions. First we explain the offline algorithm.

Let be an undirected unweighted graph with vertices and edges. We consider epochs during which we build levels of independent vertices for . At the beginning of epoch we assume we have a graph . For the first epoch, we let .

At epoch , we repeat the following sampling process for times: Repeat sampling (with replacement) a vertex uniformly at random as long as is not an independent set in . Once we sample a vertex for which is an independent set, we then let and . If the graph is sparse (i.e., ), we sample all vertices and the ordered set will be a random shuffle of vertices of .

We let be the set of neighbors of in the graph and we remove and from . The level consists of the vertex set , the multiplicative inverse or reciprocal for the average degree of which is , and the independent set and its neighbor set . We remove and from the graph and recursively start the next epoch .

Next we explain the idea behind our edge insertion and deletion subroutines. Suppose we have a level set of levels of an underlying graph where each level is a quadruple and is a MIS of .

Suppose we want to add an arbitrary edge to . Let . The amount of recomputation that the insertion of an edge imposes while reconstructing a MIS of given the current MIS of depends on where this edge is being inserted. We consider two types of insertions, heavy insertions and light insertions. Roughly speaking, an insertion is a heavy insertion if it changes the current maximal independent set; otherwise it is a light insertion. We show that heavy insertions are rare and the majority of insertions are in fact light insertions for which we do not need to do significant (re)-computation. So, we can use the budget that light insertions provides to us for heavy insertions.

Intuitively, we have the following observation. At an epoch , the independent set has vertices, the cut consists of edges and contains edges. So, for any change in the independent set , the adversary needs to update edges of the graph . As an example, if has vertices and edges, then has vertices, the adversary needs to update edges in order to change . The same happens for edge deletions.

### 1.1 Preliminaries

Let be an undirected unweighted graph with vertices and edges. We assume that there is a unique numbering for the vertices in so that we can treat as a unique number for . We denote an edge in with two endpoints by . The graph can have at most edges. Thus, each edge can also be thought of as referring to a unique number between 1 and . Here when .

Given a vertex we let be the neighborhood of . We let be the degree of the vertex . When it is clear from the context we often drop from and and simply write them as and . The average degree of the graph is .

Next we define a maximal independent set.

###### Definition 2 (Maximal Independent Set (MIS))

Given an undirected Graph , an independent set is a subset of nodes , such that no two nodes in are adjacent. An independent set is maximal if no node can be added without violating independence.

There is a simple greedy algorithm that reports a MIS of . In particular, we scan the nodes of in arbitrary order. If a node does not violate independence, we add to the MIS. If violates independence, we discard .

#### Dynamic Model.

Let be a stream of insertions and deletions of edges. We define time to be the -th operation (i.e., insertion or deletion) of stream . Let be a maximal independent set of an underlying graph whose edge set is the set of edges that are inserted up to time but not deleted. The update time of a dynamic algorithm is the time that needs to compute a MIS of graph given a MIS of graph . The update time can be worst-case or amortized.

#### Query Model.

We assume the input graph is represented as an adjacency list. We could also assume that is represented as an adjacency matrix, but adjacency matrices are often suitable for dense graphs where . In dynamic scenarios we may end up with many edge deletions so that the graph become very sparse for which the adjacency matrix representation may not be appropriate. The complexity of dynamic algorithms for graph problems is often measured based on number of neighbor queries where for every vertex , we query its -th neighbor. We assume that a neighbor querie takes constant time. Therefore, querying the full neighborhood of a vertex takes time. We let be the number of neighbor queries that an algorithm makes to compute a function.

In this paper, we use the following concentration bound.

###### Lemma 3 (Additive Chernoff Bound)

 Let denote

identically distributed and independent random variables such that

for for a fixed . Let . For it holds that

 Pr[Y≥t⋅m]≤[(pt)t⋅(1−p1−t)(1−t)]m.

## 2 Maximal Independent Set (MIS)

The pseudocode of our offline MIS algorithm is given in Algorithm (1) Maximal-Independent-Set.

The MIS algorithm Algorithm (1) Maximal-Independent-Set is the same as the following MIS algorithm. Let be an undirected unweighted graph with vertices and edges. We consider epochs during which we build levels of independent vertices for . At the beginning of epoch we assume we have a graph . For the first epoch, we let .

At epoch , we sample an ordered set

of vertices with probability

and we let be a MIS that we find greedily for the induced sub-graph . If the graph is sparse (i.e., ), we sample all vertices and the ordered set will be a random shuffle of vertices of .

We let be the set of neighbors of in the graph and we remove and from . The level consists of the vertex set , the multiplicative inverse or reciprocal for the average degree of which is , and the independent set and its neighbor set . We remove and from the graph and recursively start the next epoch .

The pseudocode of this algorithm is given Algorithm (2) Maximal-Independent-Set (Subset-Sampling).

### 2.1 Analysis

First we prove that the induced subgraph is sparse, that is, for a constant .

###### Lemma 4

Let be an undirected unweighted graph at the beginning of epoch of Algorithm 1. Assume that . With probability at least , the number of vertices in is .

Proof :   Let be the number of vertices in and be the number of edges in . Suppose the vertices in are . Corresponding to the vertex

we define an indicator random variable

for the event that is sampled. We define a random variable . Since , we have . Using Markov Inequality, .

Next suppose the edges in are . Corresponding to the edge we define an indicator random variable for the event that is in . We define a random variable . Since . We then have . Using Markov Inequality, .

Thus, using the union bound, with probability at least , .

Now we prove that the independent set reported at Epoch of Algorithm 1 is relatively big with respect to the sampled set size and also a constant fraction of vertices in are neighbors of that can be removed once we recurse the sampling process for the graph .

###### Lemma 5

Let be the induced subgraph reported at Epoch of Algorithm 1. Then, the random greedy algorithm for the maximal independent set problem returns an independent set of size .

Proof :   First we find the lower bound on the size of the independent set . Using Lemma 4 we have . Therefore, the average degree of is upper bounded by which means that the independent set is of size .

###### Lemma 6

Let be the independent set in the graph that is reported by Algorithm 1. Let be the set of vertices in that are neighbors of . Then, we have .

Proof :   Let us consider the independent set in the graph where . Suppose when we sample the vertex , the set is the set of vertices of that are neighbor to one of the vertices . That is, . Assume that ; otherwise, removing the pair set from the graph drops the number of vertices by half and we can recurse with the induced subgraph of the remaining vertex set.

Now suppose we sample the vertex . We define a random variable for the number of vertices in that are neighbors of . In expectation we have where is the degree of in . Let us define a random variable . We then have

 E[X]=t∑j=1E[Xj]=t∑j=1dGi(uj)⋅|Vi∖N(Ij−1i)||Vi|≥12⋅t∑j=1dGi(uj).

Now corresponding to the vertex we define a random variable for the degree of . We also define a random variable . Observe that . Therefore, we have

 E[Y]=t⋅mini≥n2i34⋅mi⋅mini=ni34.

We then apply Markov Inequality to obtain

 Pr[Y≤ni136]=Pr[∑uj∈IidGi(uj)≤ni136]≤1/4.

Therefore, with probability at least , .

This essentially yields and we apply the Markov inequality to prove that .

We can increase the success probability of Algorithm (1) Maximal-Independent-Set to by creating runs of this algorithm in parallel and report the MIS of the run whose neighborhood size is at least .

Next we prove that at the end of a level , for each vertex , either is deleted from the remaining graph or the degree of in is upper-bounded by .

###### Lemma 7

Let be a level in the level set . With probability at least , each vertex is either added to and will not appear in or the degree of in the subgraph is .

Proof :   Let us consider a graph at a level where and . In the beginning of the random sampling process at level , both and are empty sets. Our sampling subroutine repeats the following process for times: Repeat sampling (with replacement) a vertex uniformly at random as long as is not an independent set in . Once we sample a vertex for which is an independent set, we then let and .

Let us consider the process of building the independent set incrementally. That is, at each step , let be an independent set that we found for . Let be the set of neighbors of till step . Let be a vertex with the neighbor set and degree . Suppose as otherwise nothing left to prove.

Let be the set of neighbors of (including ) that are not in the independent set or adjacent to a vertex in . Observe that if at step we sample a vertex , then will be an independent set and we can let . If that happens, and the vertex is eliminated from . So, suppose this does not happen. We then define a random event for but at step .

Observe that . Then,

Using the union bound argument with probability at least , each vertex is either added to and will not appear in or the degree of in the subgraph is .

## 3 Edge Insertion and Deletion

Here in this section we describe our edge insertion and deletion subroutines.

### 3.1 Insertion and Deletion Subroutines

Let us first consider the insertion of an edge . The insertion of can trigger one of the following cases:

Let be a level set of a graph . Let be two level indices. An edge insertion triggers -Light Insertion if and either or . -Light Promotion if and . -Heavy Promotion if and .

First suppose the insertion of an edge triggers a light insertion. That is, there exists for which and either or . We then only need to add to the neighborhood of and , i.e., and , and add to the neighbor set . We also need to update the density for . The density update of each level is done automatically and we move it to the pseudocode of Algorithm (4) Dynamic-MIS for the sake of simplicity of insertion and deletion subroutines.

Second suppose the insertion of an edge triggers a light promotion. That is, there exists for which and . We promote from the neighbor set up to the neighbor set . We then eliminate from each vertex set for . Since , the light promotion subroutine takes time.

Finally, we consider the case when the insertion of an edge triggers a heavy promotion. That is, there exists for which and . The vertex is moved from to . By this operation, all neighbors of in that are not incident to any other vertex in (that is, ) become free. For every such a vertex we demote . That is, if there exists a vertex in one of independent sets for we demote to the level and add it to . Otherwise, we check to see if we can add to an independent set for . In particular, for each level for with probability and only if is an independent set in we add to and promote vertices in to the level and add them to . Since is not adjacent to any vertex in an independent set , the promotion of vertices takes at most time.

As for the deletion of an arbitrary edge , if and , we demote the vertex . That is, if is adjacent to any independent set , we demote to , otherwise we downsample with probability for and check if we can add it to the same as edge insertion.

Finally at any time if there exists a level whose density is increased or decreased by a factor of at least two, we recompute the maximal independent sets of all levels . The density update of each level is done automatically and is moved to the pseudocode of Algorithm (4) Dynamic-MIS.

### 3.2 Analysis

Let be a level set of an underlying graph . Recall that given , the reported maximal independent set is . Let be an arbitrary edge added to the graph .

We first find an upper-bound for the probability that adding an arbitrary edge triggers a heavy promotion.

###### Lemma 8

Let be two level indices. Let . The probability that adding an arbitrary edge triggers an -heavy promotion is at most . That is,

 Pr[u∈Ii and v∈Ij]≤2c2⋅nimi⋅njmj=2c2⋅d−1(Gi)⋅d−1(Gj),

where and are the multiplicative inverses or reciprocals for the average degree of and , respectively.

Proof :   We define a random event for and . We sample vertices in the graphs and with probabilities and , respectively. Therefore, and . Since , we then have

 Pr[Hi←j]=n2icmi⋅n2jcmj(ni2)=2⋅n2icmi⋅n2jcmjni(ni−1)≤2ninjc2mimj