Further, as uk is the vertices with minimum degree in the subgraph induced by Sk, ∣E(uk,Sk)∣ should be upper bounded by the average degree in Sk:
dG(S∗)≤∣E(uk,Sk)∣≤2⋅∣Sk∣∣E(Sk)∣=2⋅dG(Sk).
□
Running Time
Theorem. The algorithm can be implemented in O(m+n) time.
Proof.
We can maintain the degrees of the vertices in Si,i∈[n] dynamically.
At the beginning of the algorithm, set d(u)=∣E(u,V)∣=∣E(u,Si)∣ for each u∈V.
We maintain the invariant that d(u)=∣E(u,Si)∣ at the beginning of each iteration i∈[n].
At the i(th) iteration, when ui is removed from Si to construct Si+1, we decrease d(v) by 1, if (ui,v)∈E(Si).
It is easy to see that the invariant is maintained, and the total update time is O(m).
Next, we design a data structure that supports the extraction of ui, the vertex with minimum degree in Si, in O(1) time.
We keep an array with size n.
Each vertex u is kept in the d(u)-th bucket of the array.
When d(u) is updated, we update the bucket of u correspondingly.
The total update cost is O(m).
At the beginning of the algorithm, we search bucket 0,1,… , until we find the first non-empty bucket j∈[n]. Then we extract a vertex u from the bucket j, and updates the d(v) for which v is neighbor of u in the induced subgraph. The update decreases d(v) by 1. Therefore, the bucket max{0,j−1} can become non-empty at the next iteration, from which we should try to find the next vertex with minimum degree. There are n iteration, and we can move backward at the array by at most n steps. It follows that the total searching cost in the array is O(n).
□
Reference
[1] M. Charikar, “Greedy Approximation Algorithms for Finding Dense Components in a Graph,” 2000.