Journal of Graph Algorithms and Applications Dynamic Graph Clustering Using Minimum-cut Trees 412 Görke Et Al. Dynamic Graph Clustering Using Minimum-cut Trees

Algorithms or target functions for graph clustering rarely admit quality guarantees or optimal results in general. Based on properties of minimum-cut trees, a clustering algorithm by Flake et al. does however yield such a provable guarantee, which ensures the quality of bottlenecks within the clustering. We show that the structure of minimum s-t-cuts in a graph allows for an efficient dynamic update of those clusterings, and present a dynamic graph clustering algorithm that maintains a clustering fulfilling this quality guarantee, and that effectively avoids changing the clustering. Experiments on real-world dynamic graphs complement our theoretical results.


Introduction
Graph clustering has become a central tool for the analysis of networks in general, with applications ranging from the field of social sciences to biology and to the growing field of complex systems.The general aim of graph clustering is to identify dense subgraphs, called clusters, that are only loosely connected to each other in a given network.This is, the connections between the dense subgraphs constitute bottlenecks in the network while within the dense regions no significant bottlenecks can be found.The denser the subgraphs and the smaller the bottlenecks inbetween the clearer is the bottleneck-property, and thus, the better is the clustering.Countless formalizations of this paradigm of intra-cluster density and inter-cluster sparsity exist, however, the overwhelming majority of algorithms for graph clustering relies on heuristics, e.g., for some NP-hard optimization problem, and do not allow for any structural guarantee on their output.
Probably the most widespread approach nowadays is a method called greedy modularity maximization proposed in [5].Modularity is a quality measure for clusterings and was first introduced in [23].Finding a clustering with maximum modularity is NP-hard [2], so the greedy method improves the modularity of a clustering by merging given subgraphs, thus building new subgraphs representing a clustering of higher modularity.Although modularity is close to human intuition of clustering quality and therefore widely used, it has some specific drawbacks as for example the resolution limit explored in [9].This is, modularity-based methods tend to detect subgraphs of specific size categories depending on the size of the network.Further heuristic algorithms to optimize modularity base on greedy agglomeration [21,5], greedy movement [1], spectral division [22,29], simulated annealing [16,24] or extremal optimization [6].Deducing a clustering from the structural information given by the spectrum of a graph is another technique of graph clustering which avoids optimizing a quality measure.Good introductions on spectral clustering are given in [28,10] and advanced topics can be found in [4].The top-down approach introduced by Kannan et al. [19] relies on a bottleneck-based quality measure called conductance, which is also NP-hard.It uses a polylogarithmic approximation of minimumconductance cuts to recursively split the graph.For further clustering methods and recent results on graph clustering see, e.g., the following overviews [3,27,8] and references therein.
Inspired by the work of Kannan et al. [19], Flake et al. [7] recently presented a clustering algorithm which does guarantee a very reasonable bottleneckproperty.Their elegant approach employs minimum-cut trees, pioneered by Gomory and Hu [13], and is capable of finding a hierarchy of clusterings by virtue of an input parameter.There has been an attempt to dynamize this algorithm, by Saha and Mitra [26,25], however, we found it to be erroneous.We are not aware of any other dynamic graph-clustering algorithms in the literature, except for a recent advance [15], which designs and evaluates several heuristics for dynamically maintaining a clustering with high quality.There, clustering quality is measured again by the index modularity, which is NP-hard to optimize.
Our Contribution.In this work we develop the first correct algorithm that efficiently and dynamically maintains a clustering for a changing graph as found by the method of Flake et al. [7], allowing arbitrary atomic changes in the graph, and keeping consecutive clusterings similar (a notion we call temporal smoothness).Our algorithm builds upon partially updating a half-finished minimumcut tree of a graph in the spirit of Gusfield's [17] simplification of the Gomory-Hu algorithm [13].While it poses an interesting problem on its own right, updating a complete minimum-cut tree is unnecessary for clusterings and thus undesirable, as it entails additional costs.We corroborate our theoretical results on clustering by experimentally evaluating the performance of our procedures compared to the static algorithm on a real-world dynamic graph.
This paper is organized as follows.We briefly give our notational conventions and one fundamental lemma in Section 1.Then, in Section 2, we revisit some results from [13,17,7], convey them to a dynamic scenario in Section 3, and derive our central results.In Section 4 we give a formal description of our update algorithm, which decomposes into several subalgorithms, followed by an analysis in Section 5. We conclude in Section 6.
A preliminary version of this work has been presented at WADS'09 [14]; the main additions are an in-depth treatment of edge insertions alongside corresponding algorithms, a discussion of vertex modifications, an expanded experimental verification and a higher level of detail.
Preliminaries and Notation.Throughout this work we consider an undirected, weighted graph G = (V, E, c) with vertices V , edges E and a nonnegative edge weight function c, writing c(u, v) as a shorthand for c({u, v}) with u ∼ v, i.e., {u, v} ∈ E. We reserve the term node (or super-node) for compound vertices of abstracted graphs, which may contain several basic vertices; however, we identify singleton nodes with the contained vertex without further notice.Dynamic modifications of G will concern vertices and edges.The notation for vertex insertions and deletions is postponed to Section 4.2; the reason for this is that vertices require a special treatment, although at first glance, the insertion or deletion of a disconnected vertex in G looks trivial.An edge modification of G always involves edge {b, d}, with c(b, d) = ∆, yielding G ⊕ if {b, d} is newly inserted into G, and G if it is deleted from G. For simplicity we will not handle changes to the weight of an edge, since this can be done exactly as deletions and insertions.We further assume G to be connected; if that is not the case, one can work on each connected component independently and the results still apply.
A minimum-cut tree T (G) = (V, E T , c T ) of G is a tree on V and represents for any vertex pair {u, v} ∈ V 2 a minimum u-v-cut in G by the cheapest edge on the unique path between u and v in T (G).An edge e T of T (G) induces a cut in G by decomposing T (G) into two connected components.We sometimes identify e T with the cut it induces in G.A vertex pair {u, v} is called a cut pair of an edge e T if e T represents a minimum u-v-cut, i.e., if e T is a cheapest edge on the path between u and v. Neither must the cheapest edge on a path in T (G) be unique, nor T (G).We denote the connectivity between u and v, which is given by the weight of the cheapest edge, by λ(u, v).Unspecified cuts are often denoted by θ.For details on minimum-cut trees, see the pioneering work by Gomory and Hu [13] or the simplifications by Gusfield [17].
A contraction of G by N ⊆ V means replacing set N by a single supernode η, and leaving η adjacent to all former adjacencies u of vertices of N , with edge weight equal to the sum of all former edges between N and u.Analogously we can contract by a set M ⊆ E. In the context of graphs, our understanding of a clustering C(G) of G is a partition of V into subsets C i , which define vertexinduced subgraphs, called clusters, conforming to the paradigm of intra-cluster density and inter-cluster sparsity.Regarding a dynamic graph G and edge modifications of {b, d} we particularly designate C b and C d containing b and d, respectively.We start by giving some fundamental insights about minimum cuts in modified graphs, which we will rely on in the following, leaving their rather basic proofs to the reader.
Consider G : If θ separates b and d then θ has weight c(θ) − ∆ after the modification and remains a minimum u-v-cut for all its previous cut pairs {u, v}.If θ does not separate b and d then it retains weight c(θ); furthermore, if it was a minimum u-v-cut in G, it stays a minimum u-v-cut iff ∀u-v-cuts θ in G that separate b, d: c(θ ) ≥ c(θ) + ∆.
Remark 1 In a cut tree T (G), an edge e T separates b and d iff e T is on the path between b and d.Thus, according to Lemma 1, in the case of edge deletion, all edges on the path still represent valid minimum u-v-cuts after the modification.In the case of edge insertion, all edges besides those on the path remain valid.

Fundamentals
Finding communities in the world wide web or in citation networks are but example applications of graph clustering techniques.In [7] Flake et al. propose and evaluate an algorithm which clusters such instances in a way that yields a certain guarantee on the quality of the clusters.The authors base their quality measure on the expansion of a cut (S, S) due to Kannan et al. [19]: The expansion of a graph is the minimum expansion over all cuts in the graph.For a clustering C, expansion measures both the quality of a single cluster C, quantifying the clearest bottleneck within C, and the goodness of bottlenecks defined by cuts (C, V \C).Inspired by a bicriterial approach for good clusterings by Kannan et al. [19], which bases on the related measure conductance, Flake et al. [7] design a graph clustering algorithm (Algorithm 1) that, given parameter α, asserts the following (where the disjoint union

The Static Algorithm
Algorithm 1: Cut-Clustering The above quality guarantees-simply called quality in the following-are due to special properties of minimumcut trees, which are used by the clustering algorithm, as given in Algorithm 1 (compare to [7]).It performs the following steps: Add an artificial vertex t to G, and connect t to all other vertices by weight α.Then, compute a minimum-cut tree T (G α ) of this augmented graph.Finally, remove t and let the resulting connected components of T (G α ) define the clustering.In the following, we will call the fact that a clustering can be computed by this procedure the invariant.For the proof that Cut-Clustering yields a clustering that obeys Equation (2), i.e., that the invariant yields quality, we refer the reader to [7].Flake at al. further show how nesting properties of communities can be used to avoid computing the whole minimum-cut tree T (G α ) and try to only identify those edges of T (G α ) incident to t.In this context the community of a vertex u is a special minimum u-v-cut, namely the unique cut that minimizes the size of the cut side containing u.Thus, in line 5 of Algorithm 1, such a partial minimum-cut tree, which is in fact a star, would suffice.Their recommendation for finding these edges quickly is to start with separating high degree vertices from t. Flake et al. also show that further community properties given in [11] yield a whole clustering hierarchy, if α is scaled.In the following we will use the definition of G α = (V α , E α , c α ), denoting by G α and G ⊕ α the corresponding augmented and modified graphs.

A Dynamic Attempt
Saha and Mitra [25,26] published an algorithm that aims at the same goal as our work.The authors describe four procedures for updating a clustering and a data structure for the deletion and the insertion of intra-cluster and intercluster edges.Unfortunately, we discovered a methodical error in their work.

Algorithm 2: Old Inter-Edge Insertion
Input: Roughly speaking, it seems as if the authors implicitly (and erroneously) assume an equivalence between quality and the invariant.A full description of issues is beyond the scope of this work, but we briefly point out errors in the authors' procedure that deals with the insertion of intra-cluster edges and give counterexamples in the following.These issues, alongside correct parts, are further scrutinized in-depth by Hartmann [18].Algorithm 2 sketches the approach given in [26] for handling edge insertions between clusters.Summarizing, we found that Case 1 does maintain quality but not the invariant.Case 2 maintains both quality and the invariant if and only if the input fulfills the invariant, however it can be shown that this case is of purely theoretical interest and extremely improbable.Finally, Case 3 neither maintains quality nor the invariant.The following subsections illustrate these shortcomings with examples.
A Counter-Example for Case 1 and Case 2. We now give an example instance which the algorithm given in [26] fails to cluster correctly.The two upper figures (Figure 1(a), 1(b)) show the input instance, as computed by algorithm Cut-Clustering.In Figure 1(c), a first edge insertion then triggers Case 1, and thus the clustering is kept unchanged.Note that here, quality is still maintained.Then in Figure 1(d) a second edge is added and handled by Case 2, since inter-cluster quality is violated |}), and the condition for Case 2 in line 3 of the algorithm is fulfilled (2 • 4α/6 > α).Thus the two clusters are merged.In this result the dashed cut in Figure 1(d) shows an intra-cluster cut with value c(dashed) = 2.75 • α < 3 • α, which violates intra-cluster quality, as claimed in Equation (2).
A Counter-Example for Case 3. Finally we give an example instance which the algorithm given in [26] fails to cluster correctly due to shortcomings in Case 3. Figures 2(a) and 2(b) describe the graph and the minimum-cut tree before edge {2, 12} is inserted.Then the edge is added and Figure 2(c) describes the resulting construction given in [26], on which a procedure called "adapted Cut-Clustering" (line 7) is then applied, yielding Figure 2(d).The result does neither conform to Equation (2) (quality) nor to what is attempted to be proven in [26]: A "newly formed cluster from C b ∪ C d " as returned in line 8 5 6 3 1 2 (a) Graph G 0 with clustering C(G 0 ) by the Cut-Clustering method.After two modifications to G 0 the algorithm returns one cluster which can be cut (dashed) with a cut value that violates quality.

Minimum-Cut Trees and the Gomory-Hu Algorithm
We briefly describe the construction of a minimum-cut tree as proposed by Gomory and Hu [13] and simplified by Gusfield [17].Although we will adopt ideas of the latter work, we first give Gomory and Hu's algorithm (Algorithm 3) as the foundation.
The algorithm builds the minimum-cut tree of a graph by iteratively finding minimum u-v-cuts for vertices that have not yet been separated by a previous minimum cut.Each iteration allows the construction of exactly one edge of the final minimum-cut tree.Thus, the algorithm needs exactly n − 1 iterations, and the runtime of each iteration is the time of one maximum-flow calculation, which yields a minimum u-v-cut, plus some overhead for vertex contraction and re-organization of intermediate structures.For a rough idea of the total runtime take the well known maximum-flow algorithm by Goldberg and Tarjan [12] which uses the push-relabel method to compute a maximum flow in O(nm log(n 2 /m)) time and neglect the overhead.Then the worst case runtime for Gomory-Hu is O(n 4 ).At the beginning, the intermediate minimum-cut tree T * (G) = (V * , E * , c * ) (or simply T * if the context is clear) is initialized as an isolated, edgeless super-node containing all original vertices (line 1).Then,     forall the In the situation of Cut-Clustering where G gets augmented by an artificial vertex t the minimum-cut tree T (G α ) attributes an edge e i to each cluster C i .Let {u i , v i } denote the step pair of e i during Gomory-Hu with u i ∈ C i .We call u i the representative r(C i ) (or r i for short) of C i .The edges e i represent a set of non-crossing, non-nested minimum u i -v i -cuts in G α that together separate t from G.Here non-nested means that the cut sides containing the u i s are mutually disjoint.Remember that Flake et al. deduced from the nesting properties of communities that it is not necessary to compute the whole minimum-cut tree T (G α ).In the following we will apply some results of Gusfield [17] to show that even with arbitrary minimum cuts a partial minimum-cut tree suffices.

Using Arbitrary Minimum Cuts in G
Gusfield [17] presented an algorithm for finding minimum-cut trees which avoids complicated contraction operations.In essence he provided rules for adjusting iteratively found minimum u-v-cuts in G (instead of in G S ) that potentially cross, such that they are rendered consistent with the Gomory-Hu procedure and thus made non-crossing, but still minimal.We review some of these ideas that justify our later arguments.The following lemma tells us, that at any time in Gomory-Hu, for any edge e of T * (G) there exists a cut pair of e in the two nodes incident to e.It was first formulated and proven within a longer proof in [13] and later rephrased by Gusfield [17].
Lemma 2 (Gus.[17], Lemma 4) Let {S, S j } be an edge in T * (G) inducing a cut with cut pair {x, y}, wlog.x ∈ S. Let now step pair {u, v} ⊆ S split S into S u and S v , wlog.S j ending up on the same cut side with S u , i.e. {S u , S j } becomes a new edge in T * (G).If x ∈ S u , {x, y} remains a cut pair of edge {S u , S j }.If x ∈ S v , then {u, y} is an additional cut pair of {S u , S j }.
In the latter case of Lemma 2, pair {x, y} gets hidden, and, in the view of vertex y, we say that its former counterpart x gets shadowed by the split cut  This illustration shows the situation described in Lemma 2: There always exists a cut pair of edge {S u , S j } in its incident nodes, independent of the shape of the split cut (red dashed).associated with step pair {u, v}.It is not hard to see that during Gomory-Hu, step pairs remain cut pairs, but cut pairs need not stem from step pairs.However, by Lemma 2, each edge in T * (G) has at least one cut pair in the incident nodes.We define the nearest cut pair of an edge in T * (G) as follows: As long as a step pair {x, y} is in adjacent nodes S, S j , it is the nearest cut pair of edge {S, S j }; if a nearest cut pair gets hidden in T * (G) by a step of Gomory-Hu, as described in Lemma 2 (if x ∈ S v ), the nearest cut pair of the reconnected edge {S u , S j } becomes {u, y} (which are in the adjacent nodes S u , S j ).The following theorem basically states that we can iteratively find minimum cuts as Gomory-Hu does, without the necessity to operate on a contracted graph.

e., with equal behavior on S).
Being an ingredient to the original proof of Theorem 1, the following Lemma 3 gives a constructive assertion, that tells us how to arrive at a cut described in the theorem by inductively adjusting a given minimum u-v-cut in G. Thus, it is the key to avoiding contraction and using cuts in G by rendering minimum u-v-cuts non-crossing with other given cuts.
Lemma 3 gives an instrument to protect parts of graph G from being cut although the split cut we initially intended to use wriggles through these parts: Let (Y, V \Y ) be a given minimum x-y-cut in G (y ∈ Y ) with vertices u, v ∈ V \Y and consider the minimum u-v-cut (H, V \ H) as a preliminary version of the current split cut.Then, according to Lemma 3, we may handle side Y of the JGAA, 16(2) 411-446 (2012) 421 former cut as if it were contracted and thus retain it, even though the preliminary split cut tries to cut through: The lemma allows to bend the split cut such that Y is not touched.The final shape of the bent cut depends on the side of the split cut containing y-roughly speaking, the cut is "deflected" by y.This technique will be used in many proofs in the following, so we call it pseudo-contraction whenever we refer to it.While Lemma 3 tells us how to find non-crossing cuts, it does not yet tell us how to proceed with the minimum-cut tree we are building up: Given a cut as by Theorem 1, Gomory and Hu state a simple mechanism which reconnects a former neighboring subtree N j of a node S to either of its two split parts (lines 10-12 in Algorithm 3), by the cut side on which the contraction η j of N j ends up.In contrast, to establish reconnection when avoiding contraction, this criterion is not available, as N j is not handled en-block.For this purpose, Gusfield iteratively defines representatives r(S i ) ∈ V of nodes S i of T * (G).Starting with an arbitrary vertex as r({V }), step pairs in S i must then always include r(S i ), with the second vertex becoming the representative of the newly split off node S j ⊂ S i .For a suchlike run of Gomory-Hu, Gusfield shows-iteratively using Lemma 2 as the keythat for two adjacent nodes S u , S v in any T * (G), {r(S u ), r(S v )} is a cut pair of edge {S u , S v }, and, most importantly his Theorem 3: be this cut adjusted via Lemma 3 and Theorem 1; then a neighboring subtree N j of S, formerly connected by edge {S, S j }, lies in U S iff r(S j ) ∈ U .
In Cut-Clustering we are free to use Gusfield's simplification applying arbitrary minimum cuts to compute T (G α ).In doing so, we preferably choose step pairs involving t.As soon as t becomes a singleton in T * (G α ) we have reached an intermediate minimum-cut tree that defines a valid clustering, i.e., a clustering that fulfills the invariant.This can be easily perceived since, in the view of any further step pair, t and the clusters not containing the step pair are pseudo-contracted by Lemma 3.This is, the star with center t in T * (G α ) would not change if we continued the tree construction, and the final tree would still induce the same clustering as the intermediate tree.We denote the clusteringdefining intermediate tree by T c (G α ) and identify the edges in T c (G α ) with their nearest cut pairs.Figure 5 depicts an example of a clustering-defining intermediate tree, together with the set of non-crossing cuts represented by its edges.
Note that the nearest cut pairs that induce the representatives r(S i ) of the nodes adjacent to t equal the step pairs of the edges incident to t, i.e., those step pairs are not hidden.Thus, the representatives r(S i ) correspond to the representatives r(C i ) attributed to the clusters by the final tree.Conversely, according to the following theorem, any set of non-crossing, non-nested minimum u i -tcuts in G α defines an intermediate minimum-cut tree that can be turned into a clustering-defining intermediate tree T c (G α ). Figure 6 exemplarily extracts an intermediate tree from a cut set.
Theorem 3 For some vertices u i in G let Θ be a set of non-crossing, nonnested minimum u i -t-cuts in G α .Let K be any sequence of the cuts in Θ and F the sequence of the associated vertex pairs {u i , t}.There exists a sequence F of step pairs that include t and a sequence K of split cuts such that GH = (G, F • F , K • K ) is a feasible GH resulting in an intermediate tree where t is a singleton (here • denotes the concatenation operator).The intermediate minimum-cut tree after F is denoted by T • (G α ).
Proof.We index the vertices u i by the order in F .As the associated split cuts in K are non-crossing and non-nested, it holds that after the i-th iteration of Gomory-Hu (or Gusfield's simlification) u i+1 still shares a super-node with t.Therefore, {u i+1 , t} is a valid step pair in the next iteration step.After the application of F we get a valid intermediate minimum-cut tree T • (G α ), which can be used to continue until t becomes a singleton.Note that the shape of T • (G α ) is independent from the actual order in K.

Finding and Shaping Minimum Cuts in Dynamic Scenarios
In this section we let graph G change, i.e., we consider the insertion of an edge {b, d} or its deletion, yielding G ⊕ or G (for the augmented graph G α we get   G α and G ⊕ α , respectively).Furthermore, we implicitly use arbitrary split cuts according to Gusfield instead of contracted subtrees whenever we consider the process of constructing a clustering-defining tree T c . ) that can be turned into a new clustering-defining tree T c for G ⊕( ) α according to Theorem 3. Remark 1 implies that some previous cuts are still valid after a graph modification, making their recomputation unnecessary.The following four remarks and Lemma 4 concretize this assertion.Thus, the idea of our dynamic approach is to construct T

Cuts That Can Stay
) from the cuts detected by the remarks below and continuing on T • by checking the edges incident to t in the old tree T c (G α ) for further remaining cuts.
Remark 2 Intra-cluster insertion (resulting in G ⊕ α ; vertices b, d are in the same the cluster in G α ): None of the edges {r(C i ), t} separates b and d (see Figure 14).Thus by Remark 1 all edges {r(C i ), t} are still minimum r(C i )-t-cuts after the modification.This implies a set of non-crossing, non-nested minimum u i -t-cuts in G ⊕ α that together separate t from G ⊕ and therefore the previous clustering is still valid.None of the edges incident to t separate b and d.The thus implied intermediate tree T • consists of only one node covering all vertices of G α (see Figure 12).However, the following lemma yields a condition that allows to preserve the previous clustering.Its proof mostly relies on properties of Gomory-Hu and on Lemma 1. , and in particular the pair {b.d}, is sheltered by pseudo-contraction.This is, in G α there exists a minimum r(C i )-t-cut that does not separate b and d, and thus, the connectivity λ(r(C i ), t) is the same as in G α and the previous minimum r(C i )-t-cut is still valid.

The Shape of New Cuts
Most cases in the above remarks of Section 3.1 leave at least parts of the clustering of the updated graph G ⊕( ) unfinished.When continuing on T • by checking the edges incident to t in the old tree T c (G α ) we might then find an edge {r(C i ), t}, i.e., a minimum r(C i )-t-cut, that is not reconfirmed by a computation in G ⊕( ) α , but a new, cheaper minimum r(C i )-t-cut is found.As we shall see in this section, for such a new cut we can still make some guarantees on its shape as to resemble its "predecessor", thereby both enforcing smoothness and saving runtime.
New Cuts After Edge Deletions.We first discuss the case of edge deletions.Let us assume that the minimum r(C i )-t-cut represented in the old tree T c (G α ) has not been reconfirmed, but instead, by a computation in If the cluster C i neither contains b nor d the following lemma tells us that for any such minimum r(C i )-t-cut θ there is a minimum r( ΓB ΓA Figure 7: Situation of Lemma 5: minimum ḡ-g-cut (dotted) splits V α (gray area) into Γ and Γ.Any cut θ (black dashed) that separates ḡ and g can be reshaped according to θ (red dashed).We further define V α \ Γ := Γ and {r(C i ), t} \ {g} := {ḡ}.Let (A, B) be a cut separating r(C i ) and t such that (A, B) induces a cut ( ΓA , ΓB ) of Γ with ḡ ∈ ΓA and a cut Proof.Using the fact that, in the previous graph G α , (C i , V α \C i ) is a minimum r(C i )-t-cut, we prove Lemma 5 by contradiction.We show that cut ( ΓA , V α \ ΓA ) would have been cheaper than the given minimum ḡ-g-cut ( Γ, We express the costs of ( ΓA , V α \ ΓA ) and ( Γ, V α \ Γ) with the aid of (Γ A ∪ ΓA , Γ B ∪ ΓB ) and (Γ A ∪ Γ, Γ B ) considered in Lemma 5. Note that ( ΓA , V α \ ΓA ) and ( Γ, V α \ Γ) do not separate b and d.Thus, their costs are unaffected by the deletion, by Lemma 1.We get ; together with the assumption that the lemma does not hold, i.e., that ) holds, we can see the following, by subtracting (i) and (ii): This contradicts the fact that the previous cut ( Γ,  While this lemma can be applied in order to retain a cluster C i , even if new a new minimum r(C i )-t-cut is found (case b, d / ∈ C i ), in the following, we take a look at how such a new, cheap cut can affect other clusters C j , with j = i.In fact a similar cluster-conserving result can be stated.Consider a clustering defined by a tree T c (G α ).By Lemma 5 the following conservation-property holds for each cluster C j with C j ∩ {b, d} = ∅: In G α let θ j denote any r(C j )-t-cut ( Ūj , U j ) (with Ūj := (V α \ U j ), t ∈ U j and θ j not necessarily minimum with respect to r(C j ) and t).The cut θ j := ( Ūj ∪ C j , U j \ C j ) has at most the same weight as θ j .
Suppose we have improved a new minimum r(C i )-t-cut in G α according to the conservation-property described above such that it does not split C i ; for the sake of notational simplicity we again call this cut θ i = ( Ūi , U i ), and then, processing it further, work it into a cut called θ i .In the view of C i any other cluster C j with j = i and C j ∩ {b, d} = ∅ appears in exactly one of the following three scenarios: (a) θ i separates t and r(C j ) and we do not know a minimum r(C j )-t-cut in G α yet.
(b) θ i separates t and r(C j ) and we already know a minimum r(C j )-t-cut θ j in G α that does not separate t and r(C i ).In this case suppose θ j has also been improved according to the conservation-property, retaining C j .
(c) θ i does not separate t and r(C j ) and we already know a minimum r(C j )t-cut θ j in G α that does not separate t and r(C i ).Again suppose θ j retains C j .
Figure 8 shows θ i (black dashed), θ j (gray dashed) and the adjustment of θ i denoted by θ i (red dotted) in the three scenarios given above.Note that if we already know a minimum r(C j )-t-cut θ j in G α that separates t and r(C i ), this cut behaves like θ i in Scenario (a) and using this cut as a split cut in the construction of a new clustering-defining tree T c (G α ) prevents r(C i ) and t from ever becoming a step pair in a later step, since they are already separated.Thus, there is no such scenario.Scenario (a): As cut θ i separates r(C j ) and t, and as C j satisfies the conservation-property, the cut θ i := ( Ūi ∪ C j , U i \ C j ) (red dotted) has weight c α (θ i ) ≤ c α (θ i ) and still separates r(C i ) and t and is thus a minimum r(C i )-tcut, which does not split C i ∪ C j .
While Lemma 5 covers this case only for C j ∩ {b, d} = ∅, we can even drop this limitation: Using r(C b ) (r(C d ) is analogous) as r(C j ) in the case of inter-cluster edge deletion, the same assertion immediately holds, but now by pseudo-contraction.To see this, note that while {r(C b ), t} is on γ b,d , the cut defining C b remains a minimum r(C b )-t-cut in G α (by Lemma 1) and thus pseudo-contracts C b in the view of θ i .In the case of intra-cluster edge deletion, we can not apply Lemma 1 as {r(C b/d ), t} is not on γ b,d , i.e., we can not adjust other r(C i )s' cuts to C b/d with the arguments in this scenario.
Scenario (b): Here we assume that θ j is already known before θ i is considered.This is, r(C j )'s side of θ j is already pseudo-contracted by θ j .As θ j does not separate r(C i ) from t, indeed, but may separate some other cluster representatives from t and thus may already have been adjusted accordingly, the cut θ i is reshaped regarding the whole cut side Ūj (instead of only to cluster C j ⊆ Ūj as by Scenario (a)).By pseudo-contraction the cut θ i := (U i ∩ U j , Ūi ∪ Ūj ) (red dotted) is a minimum r(C i )-t-cut, which does not split C i ∪ C j .The comments from Scenario (a) carry over.
Scenario (c): In this scenario, neither newly found minimum cut separates the other representative from t.By pseudo-contraction, the cut ( Ūi ∩U j , Ūj ∪U i ) (blue dash-dotted) is a minimum r(C i )-t-cut.This cut can be adjusted to dotted), which neither splits C i nor C j , by means of the conservation-property of C i .Analogously, θ j := (( Ūj ∩ U i ) ∪ C j , ( Ūi ∪ U j ) \ C j ) (not shown) is a minimum r(C j )-t-cut, and θ i and θ j do not cross.
If in the case of inter-cluster edge deletion we consider r(C b ) (r(C d ) is analogous) instead of r(C j ) where C j ∩ {b, d} = ∅ was assumed, the cut defining C b is a known minimum r(C b )-t-cut in G α (by Lemma 1), i.e., θ b := (C b , V α \C b ) does not split C i .This is, θ i bent along θ b by pseudo-contraction neither splits C i nor C b and both cuts do not cross.In the case of intra-cluster edge deletion, if r(C b/d ) is used as r(C j ), any newly found minimum r(C b/d )-t-cut θ b/d can be reshaped by Lemma 5 such that it does not cross the union of all other old clusters and t (Note that it can not be adjusted such that it definitely spares C b/d as C b/d has no conservation-property).Thus, θ b/d does not cut through C i .However, θ i still may cut through C b/d .To summarize the cases discussed above, we make the following observation.
Observation 1 During the construction of a clustering-defining tree T c (G α ) starting from T • and checking the remaining edges incident to t in old T c (G α ), whenever we discover a new, cheaper minimum r(C i )-t-cut θ (C i ∩ {b, d} = ∅) we can iteratively reshape θ into a minimum r(C i )-t-cut θ which neither cuts C i nor any other cluster C j with C j ∩{b, d} = ∅, by means of Scenarios (a,b,c).For r(C b ) and r(C d ) in the case of inter-cluster deletion the clusters C b and C d are preserved anyway.In contrast, in the case of intra-cluster deletion, the cluster C b/d can not be protected but at least any new minimum r(C b/d )-t-cut spares all other old clusters.
New Cuts After Edge Insertions.The bigger picture of the last subsection's findings can be summarized as follows: After an edge deletion, it never pays off to cut through that side of a former minimum cut, which can not offer new, cheaper cuts, as it was unaffected by the update.In the following we will confer this idea to edge insertions.
In contrast to edge deletion, after an edge insertion between two different clusters C b and C d only two edges need to be checked during the construction of a new clustering-defining tree T c (G ⊕ α ) from T • ; namely {r(C b ), t} and {r(C d ), t}, i.e., those edges that are incident to t and separating b and d.The checked edges are reconfirmed by a computation in G ⊕ α if there exists a minimum r(C b )-t-cut and a minimum r(C d )-t-cut which is as expensive as the previous minimum cut, respectively, plus ∆ (the weight of the inserted edge), as pointed out in Lemma 1.However, if {r(C b ), t} or {r(C d ), t} is not reconfirmed, depending on the shape of the new cut, we may still be able to retain the associated cluster.In the following we only consider the edge {r(C b ), t}.Analog assertions hold for {r(C d ), t}.

For any new minimum r(C
α that does not split C∈C(G)\{C b } C, but splits C b exactly as θ b does.(The attribute of a cut to have r(C b ), b, d on the same side, will later be introduced as car, as by "cut attribute regarding representative".)Analogously, cat will stand for the attribute of a cut to have t, b, d on the same side, as by "cut attribute regarding t".) (A, B) be a cut separating r(C i ) and t but not b and d, with {b, d} ⊆ A. Let g denote the vertex in {r(C i ), t} ∩ B and define {r(C i ), t} \ {g} := {ḡ}.Denote the cut side of (C i , V α \ C i ) containing g by Γ and V α \Γ := Γ.Then (A, B) induces a cut ( ΓA , ΓB ) of Γ with ḡ ∈ ΓA and a cut Proof.The Proof of Lemma 6 bases on the same idea as the proof of Lemma 5. We prove it by contradiction.We show that cut ( ΓA , V α \ ΓA ) would be cheaper than the edge-induced minimum ḡ-g-cut ( Γ, We express the costs of ( ΓA , V α \ ΓA ) and ( Γ, V α \ Γ) with the aid of (Γ A ∪ ΓA , Γ B ∪ ΓB ) and ( Thus, for our contradiction, it will do to show that c ⊕ α ( ΓA , V α \ ΓA ) would be cheaper than c ⊕ α ( Γ, V α \ Γ).We get Again we observe two inequalities: , by subtracting (i) and (ii), we get: This contradicts the fact that the edge-induced cut ( Γ, While this lemma can be applied in order to retain the current cluster (wlog.Observation 2 During the construction of a clustering-defining tree T c (G ⊕ α ) starting from T • and checking the two remaining edges incident to t in old T c (G α ), whenever we discover a new minimum cut that is cheaper than the previous cut plus ∆ and possesses car, we can reshape this cut such that it does not cut through its associated cluster.If it further separates the other vertex from t, even C b ∪C d can be preserved, by means of Scenario (a).In Scenario (b) we can preserve at least one of the two clusters C b and C d , while the other cluster gets split.However, all vertices split off from the latter cluster are shadowed by the new cut associated to the preserved cluster.A new minimum cut that possesses cat can be adjusted such that it does not shadow any old, remaining cluster in C(G α ) \ {C b , C d } and does not cut the opposite cluster (compare to Scenario (c)).In case of Scenario (c(ii)) at least one of the two clusters C b and C d remains.However, in contrast to Scenario (b), it might be necessary to resolve crossings between both newly computed cuts.By pseudo-contraction we can further assume all new cuts not to cut through any of the remaining clusters in Coverage of Cases and Scenarios.At this point it is reasonable to briefly review the cases treated above.It is important to note that the above elaborations are exhaustive in that all possible cases for edge-based updates have been discussed.Before we turn to formal descriptions of update algorithms based on our observations, let us summarize.
For edge deletions we have found comprehensive rules allowing for the preservation or at least for the en-bloc treatment of former clusters.Deleting an edge between clusters in fact never forces us to split any former cluster, while inside a single cluster, an edge deletion can at most require us to demolish that particular cluster.For edge insertions our rules are slightly less comprehensive.On the one hand, nothing needs to be done for intra-cluster insertions (compare to Remark 2).On the other hand, for inter-cluster insertions we have established rules which enable cluster preservation for a number of cases.However, the  remaining cases can again only require us to demolish both affected clusters, not others.

Update Algorithms for Dynamic Clusterings
In this section we put the results of the previous sections to good use and give algorithms for updating a minimum-cut tree clustering, such that the invariant is maintained and thus also the quality.

Edge Modifications
By concept, for updating a clustering after an edge modification, we merely need to know all vertices of T c (G α ) adjacent to t, i.e., all representatives of the clusters.We call this set W (G), with r b := r(C b ), r d := r(C d ), r b/d := r(C b/d ) being the particular representatives.We call the corresponding set of noncrossing, non-nested minimum r(C i )-t-cuts that isolate t, Θ(G).We will thus focus on dynamically maintaining only this information.From Remarks 2-5, for a given edge insertion or deletion, we know T • , and we know in which node of T • to find t, this is the node we need to examine.We now give algorithms for the deletion and the insertion of an edge running inside or between clusters.
Edge Deletion.Our first algorithm handles inter-cluster deletion (see Algorithm 4).Just like its three counterparts, it takes as an input the sets W (G) and Θ(G) of the old graph G, furthermore it takes the changed graph, augmented by t, G α and the deleted edge {b, d}.Recall that an inter-cluster deletion yields an intermediate tree T • (G α ) that consists of three nodes and contains edges {r(C b ), t} and {r(C d ), t} representing cuts θ b , θ d defining the clusters C b and C d , as shown in Figure 11.All other edges incident to t in T c (G α ) need to be changed or reconfirmed.To this end Algorithm 4 lists all previous representatives r i ∈ W (G), into the tentative list W ten , and initializes their shadows D(r i ) = {r i } by means of Lemma 5.The known cuts θ b , θ d are already added to Θ ten (line 1).Then the core algorithm, Check Representatives is called, which-roughly speaking-performs those Gomory-Hu steps that are necessary to isolate t, of course, using the lemmas derived above.
First of all, note that if |C| = 2 (C = {C b , C d } and {t} singleton in T • (G α )) then W ten = {r b , r d } and Algorithm 4 lets Check Representatives (Algorithm 5) simply return the input cuts and terminates.Otherwise, it iterates the set of former representatives W ten , thereby possibly shortening it, due to shadowing.We start by computing a new minimum r i -t-cut for r i .If the new Algorithm 4: Inter-Cluster Edge Deletion ∈ {r b , r d } do // W ten may change 2 θ i ← minimum r i -t-cut given by FlowAlgo(r i , t)  cut is not cheaper, we use the old one instead, and add it to the tentative list of cuts Θ ten (lines 3-4).Otherwise we store the new, cheaper cut θ i , and examine it for later adjustment: For any candidate r j still in W ten that is separated from t by θ i , Scenario (a) or (b) applies (line 8).Note that the while loop in line 7 iterates W ten from scratch.Thus, r j will be in the shadow of r i , and not a representative in the new clustering (line 9).In case r j has already been processed (Scenario (b)), its cut is removed from Θ ten .Once all candidates for new representatives are processed, for each of them exactly one of the following options holds: It induces the same cut as before, it is new and shadows other former representatives or it is itself shadowed by another candidate.Now that we have collected these relations, we actually apply Lemma 5 and Scenarios (a,b,c) in lines 11-17.Note that for retained, old cuts, no adjustment is actually done here, however, for brevity, the pseudocode superficially iterates throughout W ten .In fact, it is not hard to see that at most two vertices in W ten are assigned to new cuts which require treatment.Finally, all non-shadowed candidates alongside their adjusted, non-crossing, non-nested cuts are returned.
Next we look at intra-cluster edge deletion.Looking at our starting point T • , the modified edge {b, d} lies within some cluster C b/d , which does not help much, since none of the edges incident to t in T c (G α ) separates b and d.However, in this case, Lemma 5 tells us that any new minimum r b/d -t-cut spares the part of G α containing all other former clusters and t, see the dashed cut in Figure 12.Algorithm 6 has the same in-and output as Algorithm 4, and starts by finding a new minimum r b/d -t-cut.If this yields that no new, cheaper r b/d -t-cut exists, then, by Lemma 4, we are done (line 2).Otherwise, we first adjust θ b/d such that it at least does not interfere with any former cluster C i by Lemma 5 (lines 5-6); note that C b/d can not necessarily be preserved.Then we prepare the sets W ten , Θ ten in lines 7-10.Check Representatives now performs the same tasks as for Inter-Cluster Edge Deletion: It separates all candidates for new representatives from t in a non-intrusive manner; note that this excludes r b/d (line 8), as C b/d is not retained, and thus defies the adjustments.
After line 11 we have one minimum r b/d -t-cut that leaves the former clusters untouched, but might split C b/d , and we have a new set Θ ten of minimum r i -tcuts (with some former r j ∈ W (G) possibly having become shadowed) which do not cut through former clusters C i but might, however, also cut through C b/d .These cuts may further cross each other and θ b/d in the area of C b/d .So we put all these cuts and representatives into Θ(G ) and W (G ) and apply the technique of pseudo-contraction to make all cuts non-crossing.Note that this may result in shadowing r b/d .In this case we delete the nested cut.Finally, some vertices from the former cluster C b/d might still remain unclustered, i.e., not separated from t by any θ ∈ Θ(G ).For clustering these vertices v we can not do better than proceeding as conservatively: Compute their set of minimum vt-cuts and render them non-crossing by pseudo-contraction, possibly shadowing one another or some previous cut θ.We refrain from detailing the latter steps.α for an intra-cluster insertion.All relevant minimum r(C i )t-cuts persist.
Edge Insertion.The good news for handling G ⊕ is that an algorithm Intra-Cluster Edge Addition does not need to do anything, but return the old clustering (compare to Remark 2 and Figure 14).By contrast, inserting an edge between clusters is more demanding (Algorithm 7).Again, the algorithm takes as an input the sets W (G) and Θ(G) of the old graph G, the changed graph G ⊕ α , the inserted edge {b, d} and its weight ∆.An inter -cluster insertion yields an intermediate tree T • (G ⊕ α ) with |C(G)| − 1 nodes, thus in T • the only unknown cuts are those for r(C b ) and r(C d ) in T c (G α ), see Figure 13.A sketch of what needs to be done, as given in Algorithm 7, is as follows: We compute new minimum r b -t-and minimum r d -t-cuts (line 5) and keep the former r i -t-cuts for the remaining clusters in Θ(G ⊕ ) and W (G ⊕ ) (line 3).To also conserve the clusters C b and C d we try to apply Scenario (a).To this end the attribute car is checked for the new cuts θ b , θ d (line 10).If θ b or θ d is cheaper than the old cut weight plus ∆, i.e., is not reconfirmed, and satisfies car (line 9) we reshape it such that its associated cluster is conserved by Lemma 6, followed by potential shadowings of former r i (line 12).Otherwise (if it satisfies cat, line 14) it does not shadow or cut any other cluster by pseudo-contraction and Lemma 6, so we non-crossing, non-nested split cuts induced by C. Then Θ contains cut θ d := ({d}, V \ {d}) with {d, t} as cut pair.This is, C d := {d} ∈ C.
Proof.It is easy to see that θ d has weight α with respect to G α , and thus is a minimum which makes it cheaper than θ i .This contradicts the assumption that C i containing d is a valid cluster in C.
With Lemma 7 a disconnected vertex in G always forms a singleton cluster.This fact makes updating a clustering C after a vertex modification very simple: A vertex deletion removes the corresponding cluster in C, a vertex insertion creates a new singleton in C and stores the new vertex together with t as associated cut pair, i.e., the vertex becomes the representative of the new cluster.

Performance of the Algorithm
Temporal Smoothness.Our secondary criterion, which we left unformalized, to preserve as much of the previous clustering as possible, in parts synergizes with effort-saving, an observation foremost reflected in the usage of T • .Lemma 4 and Observations 1 and 2 nicely enforce temporal smoothness.However, in some cases we must cut back on this issue, e.g., when we examine which other candidates for new representatives are shadowed by another one, as for example in line 8 of Algorithm 5.Here it entails many more cut-computations and a combinatorially non-trivial problem to find best-shaped cuts and an ordering of W ten to optimally preserve old clusters.For our experiments we ordered the vertices in W ten by decreasing degrees according to the recommendation of Flake et al. for the static Cut-Clustering.Independent of the ordering of W ten we can give the following stability guarantee: Lemma 8 Let Algorithm 6 use for each considered vertex v in line 14 that cut among all minimum v-t-cuts which has the fewest number of vertices on the side containing v, i.e., the community of v with respect to t. Assume further Algorithm 6 applies cut With these slight changes each of our update algorithms guarantees stability, i.e., returns the previous clustering C(G) if C(G) still fulfills the invariant for the modified graph G ⊕( ) .
As our experiments serve as a first proof of concept, focusing on the number of necessary maximum-flow calculations, we did not explicitly implement the prerequisites of this lemma for the cases of intra-cluster deletion and intercluster insertion.However, since most minimum u-v-cuts were unique in our instance, these are more often than not satisfied implicitly.The proof for the deletion algorithms relies on the fact that any output clustering differing in cluster C i requires at least one minimum r(C i )-t-cut (r(C i ) ∈ C i ) to separate b, d, invalidating C(G).Intra-cluster insertion obviously retains a valid previous clustering; for inter-cluster insertion an argument akin to that used for the deletion algorithms can be used.
Proof.Consider inter-cluster deletion (Algorithm 4) first.To return a new clustering C(G ) different from C(G) the algorithm needs to find a new cheaper minimum r(C i )-t-cut for at least one representative r i ∈ W (G) \ {r b , r d }.As the previous clustering is also valid for G , there must exist another vertex u ∈ C i that serves as a witness that the cut θ i (defining C i ) still constitutes a minimum u-t-cut in the modified graph G α .However, each cheaper minimum r i -t-cut found by the algorithm also separates u and t.This contradicts the existence of a vertex u ∈ C i such that {u, t} is a cut pair for θ i in G α .
Considering intra-cluster deletion (Algorithm 6), a new minimum r b,d -t-cut calculated by Algorithm 6 always spares the part of G α containing all other clusters and t according to Lemma 5 and thus does not shadow any cluster in C(G) \ {C b/d }.If the previous representative r b/d still serves as a witness that the cut defining C b/d still constitutes a minimum r b/d -t-cut in the modified graph G α the lemma holds.Otherwise, the new cut θ b,d is the community of r b/d with respect to t.Furthermore, all the above arguments for the intercluster deletion case also apply here to the clusters in C(G) \ {C b/d }.Thus, these clusters are again found.We show now that (a) while isolating t from the remaining unclustered vertices, any new minimum v-t-cut To see (a) recall that (C v , V α \ C v ) is supposed to be the community of v with respect to t.For the sake of notational simplicity we also associate the cut side C v with the community of v. Aspect (b) holds due to Lemma 3.9 given in [7] that states that communities are either disjoint or nested: Suppose u b/d to be a witness for Running Times.We universally express running times of our algorithms in terms of the number of necessary maximum-flow computations, leaving open how these are done.A summary of tight bounds is given in Table 1.The columns lower bound /upper bound denote bounds for the-possibly rather commoncase that the old clustering is still valid after some graph update.As discussed in the last subsection, the last column (smooth) states whether our algorithms always return the previous clustering, in case its valid; the numbers in brackets denotes a tight lower bound on the running time, in case our algorithms do find that previous clustering.best case worst case old clustering still valid lower b.
upper bound Table 1: Bounds on the number of maximum-flow calculations.
For Inter-Cluster Edge Deletion (Algorithm 4) in the best case we only calculate as many cuts as new clusters arise while separating t from all neighbors, except r(C b ) and r(C d ) (compare to Figure 11).We require at most |C(G)| − 2 cuts, as neighbors of t might get shadowed after their processing.In this case we calculate more cuts than finally needed to define the new clustering.Note that a computation from scratch (static algorithm) entails a tight upper bound of |V |−1 maximum-flow computations for all four cases, in the worst case; although, in practice, the heuristic recommended by Flake et al. usually finds a new clustering in time proportional to the total number of new clusters.In the best case it needs as many cut computations as new clusters arise.Comparing this to the bound for updating an inter-cluster deletion in the best case, lets us expect only little effort saving for this case; while the case of intra-cluster insertion promises the biggest effect of effort saving.
Experiments.In this brief section, we very roughly describe some experiments we made with an implementation of the update algorithms described above, just for a first proof of concept.The instance we use is a network of e-mail communications within the Fakultät für Informatik at KIT (formerly Universität Karlsruhe) [20].Vertices represent members and edges correspond to e-mail contacts, weighted by the number of e-mails sent between two individuals during the last 72 hours.This means, each e-mail has a fixed time to live.After that time the contribution of the e-mail to the weight of the edge expires and the weight of the edge decreases.We process a queue of 69 739 elementary modifications, 61 870 of which are actual edge modifications, on an initial graph with |V | = 247 and |E| = 307.This queue represents about three months, starting on Sunday (2006-10-22).The number of vertices varies between 172 and 557, the number of edges varies between 165 and 1190.We delete zeroweight edges and isolated nodes.Following the recommendations of Flake et al. [7], we choose α = 0.15 for the initial graph, yielding 73 clusters.We compare their static algorithm (see Section 2.1) and our dynamic algorithm in terms of the number of maximum-flow computations necessary to maintain a clustering.Forty times out of the 61 870 total operations, the static computation needed less maximum flows than the dynamic update.In all remaining cases (99.93%) the update algorithm was at an advantage (see Table 2).
The first two rows of Table 3 show the numbers of clusters found by the static and dynamic approach over the whole experiment.As both algorithms range at similar levels we can be sure the observed savings are not induced by trivial clusterings.Thus, comparing dynamic and static flow computations is justified: For the 61 870 proper steps, static computation needed 3 300 413 maximum flows, and our dynamic update needed 736 826, saving more than 77% maximum flows, such that one dynamic cluster on average costs 0.23 flow computations.The amortized costs of 1.03 flows for a static cluster affirm the running time to be proportional to the total number of new clusters, as stated by Flake et al.This running time is also visible in Figure 15, which shows the consecutive development of the graph structure over one day (Monday, 2006-10-23).Obviously, the static and dynamic clusterings (upper red and lower green line) behave similarly.Note that the scale for static clusterings and flows is offset by about 20 clusters/flows for readability.However, the dynamic flows (blue dots) cavort around the clusters or, even better, near the ground, which means there are only few flow computations needed.In contrast, most of the static flow amounts (orange dots) are still proportional but clearly higher than the number of clusters in the associated static clustering.
Regarding the total number of edge modifications the savings finally average out at 41.4 flows (Table 3), while inter-cluster insertions save the most effort per modification.This is, the case of inter-cluster insertion surprisingly outperforms the trivial intra-cluster insertions.

Conclusion
We have proven a number of results on the nature of minimum u-v-cuts in changing graphs, allowing for feasible algorithms which efficiently update specific parts of a minimum-cut tree and thus fully dynamically maintain a graph clustering based on such trees, as defined by Flake et al. [7] for the static case, under arbitrary atomic changes.The striking feature of graph clusterings computed by this method is that they are guaranteed to yield a certain expansion-a bottleneck measure-within and between clusters, tunable by an input parameter α.As a secondary criterion for our updates we encourage temporal smoothness, i.e.,  changes to the clusterings are kept at a minimum, whenever possible.Furthermore, we disprove an earlier attempt to dynamize such clusterings [26,25].Our experiments on real-world dynamic graphs confirm our theoretical results and show a significant practical speedup over the static algorithm of Flake et al. [7].Future work on dynamic minimum-cut tree clusterings will include analyzing the potential of choosing "better" cuts (if a minimum cut is not unique) and specific orderings of W ten in the algorithms in order to further improve temporal smoothness.The dynamic update of a single maximum s-t-flow is a means to gain further speedup beyond the number of cut calculations.Since our algorithm is able to deal with arbitrary cuts, on the one hand any existing max-flow-mincut-implementation and any existing update technique can be used, and on the other hand, there is no need for prospectively designed update algorithms to respect any restrictions.
Moreover, we intend to systematically compare our work to other dynamic clustering techniques and to investigate a method for dynamically adapting the parameter α.Related to the latter, we will try to expand our update algorithms to the Hierarchical Cut-Clustering method also given by Flake et al. [7] which considers a sequence of values for α.How to deal with offline changes is another interesting question for both methods, Cut-Clustering and Hierarchical Cut-Clustering.
We thank the anonymous reviewers for their thoughtful comments and their helpful suggestions on how to achieve an even better readability and understanding.

Lemma 1
Let θ be a cut in G, and let edge e = {b, d} be modified in G. Consider G ⊕ : If θ does not separate b and d then θ has still the same weight and is still a minimum u-v-cut for all its previous cut pairs {u, v}.If θ separates b and d then its weight in G ⊕ increases by ∆; furthermore, if it was a Minimum-cut tree T (G 0 α ) inducing the clustering C(G 0 ) shown in Figure (a).

Figure 1 :
Figure1: A dynamic instance violating the clustering quality.Weights are parameterized by the same α as used in Cut-Clustering.After two modifications to G 0 the algorithm returns one cluster which can be cut (dashed) with a cut value that violates quality.
Graph G with clustering C(G) resulting from the Cut-Clustering method.
Minimum-cut tree T (Gα) inducing the clustering C(G) shown in Figure (a).
If x ∈ Su vertex pair {x, y} remains a cut pair of edge {Su, S j } in T * .Although x / ∈ Su, with {u, y} there is still a cut pair in the adjacent nodes Su and S j in T * .

Figure 3 :
Figure3: This illustration shows the situation described in Lemma 2: There always exists a cut pair of edge {S u , S j } in its incident nodes, independent of the shape of the split cut (red dashed).

Figure 4 :
Figure 4: Depending on y there are two different directions to which Lemma 3 bends the cut (H, V \ H): upwards or downwards.

6 (
b) Set of cuts represented by the edges in Tc(Gα); five resulting clusters.

Figure 5 :
Figure 5: This example shows an intermediate minimum-cut tree resulting from a sequence {u i , t}, i = 1, . . ., 6 of step pairs (a), where step pair {u 1 , t} is hidden.The bold cuts in (b) induce a clustering with representatives r(C i ) = u i , i = 2, . . ., 6.
Set Θ of five non-crossing, non-nested split cuts.
Intermediate tree T• with respect to Θ.

Figure 6 :
Figure 6: This example shows an intermediate minimum-cut tree T • regarding vertices u 1 , . . ., u 5 (b); in order to have T • define a clustering, the vertices inside t's super-node need to be separated from t by further cuts.

A
clustering C found by Cut-Clustering results from |C| non-crossing, nonnested minimum u i -t-cuts represented in T c (G α ).If any of such cuts are still valid after a graph modification, they define an intermediate tree T • (G ⊕( ) α

Remark 3
Inter-cluster insertion (resulting in G ⊕ α ; vertices b, d are in different clusters in G α ): Apart from {r(C b ), t} and {r(C d ), t} none of the edges incident to t separates b and d.Again by Remark 1 all these edges not separating b and d still induce minimum cuts after the modification, the two other cuts do not necessarily remain minimum.The thus implied set of non-crossing, non-nested minimum u i -t-cuts in G ⊕ α yields an intermediate minimum-cut tree T • with |C(G)| − 1 nodes (see Figure 13) that can be completed as to define a clustering.Remark 4 Inter-cluster deletion (resulting in G α ; vertices b, d are in different clusters in G α ): Only the two edges {r(C b ), t} and {r(C d ), t} separate b andd.By Remark 1 both cuts represented by these edges are still minimum after the modification, all other edges incident to t do not necessarily remain minimum.This implies an intermediate minimum-cut tree T • with three nodes (see Figure11) that can be completed as to define a clustering.Remark 5 Intra-cluster deletion (resulting in G α ; vertices b, d are in the same cluster in G α ):

Lemma 4
In the case of an intra-cluster deletion, let C b/d denote the cluster containing b and d.In T c (G α ) consider the edge e b/d representing the minimum r(C b/d )-t-cut.If e b/d still represents a minimum r(C b/d )-t-cut in G α the previous clustering is still valid.Proof.Consider the minimum r(C b/d )-t-cut (C b/d , V α \ C b/d ) in G α .In the view of any further step pair {r(C i ), t} in V α \ C b/d the cut side C b/d does not separate b and d denote the cut side containing b and d by Γ and let g denote the vertex in {r(C i ), t} ∩ Γ.

Figure 8 :
Figure 8: Three different scenarios concerning the positions of θ i and θ j (black and gray dashed, respectively), and their adjustments (red dotted).
C b exactly as θ b does.Note that a new minimum r(C b )-t-cut never separates b and d as otherwise it would not be cheaper than the previous one plus ∆.For a new minimum r(C b )-t-cut θ b C b ), given that a new minimum r(C b )-t-cut, with r(C b ), b, d on the same side, is found, in the following, we take a look at how this new cut can affect the other cluster C d .In a clustering-defining tree T c (G α ) consider the two edges {r(C b ), t} and {r(C d ), t}.Returning to the notation used before in the case of edge deletion, by Lemma 6, the following conservation-property holds for C b : In G ⊕ α let θ b denote any r(C b )-t-cut ( Ūb , U b ) that has r(C b ), b, d on the same side(with Ūb := (V α \ U b ), t ∈ U b and θ b not necessarily minimum with respect to r(C b ) and t).The cut θ b := ( Ūb ∪ C b , U b \ C b ) is of at most the same weight as θ b .For C d an analogous property holds.In order to see which cuts are eligible for adjustment by this conservationproperty, as already announced, we introduce the following attributes for cuts: We say that a r(C b )-t-cut possesses the cut attribute car(b) if it has r(C b ), b, d on the same side; and it has the cut attribute cat(b) if it has t, b, d on the same side (note that car(b) and cat(b) are mutually exclusive).Analogously, car(d) and cat(d) denote the cut attributes for r(C d )-t-cuts.In G ⊕ α consider a new minimum r(C b )-t-cut θ b which is cheaper than the previous cut plus ∆.Such a cut either satisfies car(b) or cat(b) as it does not cross the inserted edge {b, d}, by Lemma 1.If it possesses car(b), suppose we have already improved this cut in G ⊕ α according to the conservation-property described above such that it does not split C b ; for the sake of notational simplicity θ b possesses car(b) and separates r(C d ) and t. r(C b ) θ b with car(b) does not separate r(C d ), t; neither does θ d with car(d) separate r(C b ), t. r(C b ) r(C d ) θ b possesses cat(b).θ d has three possibilities (not shown).

Figure 10 :
Figure 10: Three different scenarios concerning the positions of θ b and θ d (black and gray dashed, respectively), and their adjustments (red dotted).we again call it θ b = ( Ūb , U b ), and then, processing it further, work it into a cut called θ b .In the view of C b the cluster C d appears in exactly one of the following three scenarios: (a) θ b possesses car(b) and separates t and r(C d ).A new minimum r(C d )-t-cut θ d in G ⊕ α has different possibilities discussed below.(b) θ b possesses car(b) and does not separate t and r(C d ) and we know a new minimum r(C d )-t-cut θ d in G α that behaves analogously.Suppose θ d has also been improved according to the conservation-property, retaining C d .(c) θ b possesses cat(b) and thus can be reshaped by Lemma 6 such that it does not cut through C∈C(G)\{C b } C. Then a new minimum r(C d )-t-cut θ d in G ⊕ α has three possibilities, as described below.Figure 10 shows θ b (black dashed), θ d (gray dashed) and the adjustment of θ b denoted by θ b (red dotted) in the three scenarios given above.Scenario (a): The attribute car(b) together with the conservation-property for C d allows to conserve both clusters C b and C d as follows.As cut θ b separates r(C d ), t and satisfies car(b) it also possesses car(d), and as C d satisfies the conservation-property, the cut θ b := ( Ūb ∪ C d , U b \ C d ) (red dotted) has weight c ⊕ α (θ b ) ≤ c ⊕ α (θ b ) and is thus a minimum r(C b )-t-cut that does not split C b ∪ C d .If there is a new minimum r(C d )-t-cut θ d that behaves analogously, we can choose between the two improved cuts θ b and θ d .In this case, in order to keep consecutive clusterings similar, we prefer that cut that shadows less of the remaining clusters in C(G α ) \ {C b , C d }.Minimum r(C d )-t-cuts of any other shape are ignored.Scenario (b): Here, by pseudo-contraction, θ b can be reshaped to the blue dash-dotted cut which possesses cat(b).Applying Lemma 6 to this minimum r(C b )-t-cut yields θ b := (U d ∩ C b , V α \ (U d ∩ C b )) (red dotted) as a minimum r(C b )-t-cut, which does not shadow any of the old clusters.Furthermore, θ d at least pseudo-contracts cluster C d .Since in this scenario θ d and θ b are swappable, we choose that cut for reshaping that shadows more of the remaining clusters in C(G α ) \ {C b , C d }.A similar situation also appears in Scenario (c(ii)).Scenario (c): Applying Lemma 6 to θ b which satisfies cat(b) yields a cut θ b := ( Ūb ∩ C b , V α \ ( Ūb ∩ C b )) shaped as shown in the figure (red dotted), in

Figure 11 :
Figure 11: T • (G α ) for an inter-cluster deletion, edges not separating b, d need inspection.The cuts of r(C b ) and r(C d ) are correct, but they might get shadowed.

retain old cuts of same weight 4 Add θ old i to Θ ten // pointed at by r i 5 else // new cheaper cuts 6 9
Add θ i to Θ ten // pointed at by r i 7 while W ten has next element r j = r i do // cp. to other cuts 8 if θ i separates r j and t then // Scen.(a), (b) shadow r j Remove r j from W ten , D(r i ) ← D(r i ) ∪ D(r j ) 10 if Θ ten θ j , pointed at by r j then Delete θ j from Θ ten 11 forall the r i ∈ W ten , r i / ∈ {r b , r d } do // let cuts preserve clusters 12 set ( Ū , U ) := θ i with t ∈ U for θ i ∈ Θ ten pointed at by r i 13 forall the r j ∈ D(r i ) do // handle C i and shadowed cuts ...

Algorithm 6 : 7 W 9 Add r i to W ten 10 D 11 W 12 W 14 Isolate the sink t from all remaining unclustered vertices 15 returnFigure 13 :Figure 14 :
Figure 13: T • (G ⊕ α for an inter-cluster insertion.At least r(C b ) and r(C d ) need inspection.
of the same weight is found.Let Algorithm 7 use the communities of r b and r d in line 5, and in line 30 the communities for each considered vertex v. Assume further Algorithm 6 applies the cuts(C b , V α \ C b ) and (C d , V α \ C d ) if a respective minimum v-t-cutof the same weight is found.
nested in C b/d .In this context nested means that C v ⊆ C b/d .And we show that (b) Algorithm 6 finds a witness u b/d that the cut defining C b/d still constitutes a minimum u b/d -t-cut in the modified graph G α .
d in the view of C b/d , there exists a Gomory-Hu execution for G α that yields a minimum-cut tree T (G α ) in which the represented minimum v-t-cut is nested in C b/d , and thus, C v ⊆ C b/d particularly.
d all induce cuts with the same costs in G α .Thus, v is also a witness for C b/d and the algorithm applies (C b/d , V α \ C b/d ) as split cut.Furthermore, according to (b) this split cut is not reshaped.Obviously, if u b/d is not shadowed, the algorithm considers this vertex anyway.Considering inter-cluster insertion (see Algorithm 7), all clusters in C(G) \ {C b , C d } are known to be still valid for G ⊕ .With the same arguments already used above for the case of intra-cluster deletion, for any considered vertex v ∈ C b and v ∈ C d (particularly for r b and r d ) that is not reconfirmed, the community (C v , V α \ C v ) is nested in C b and C d , respectively, and the algorithm finds a witness for each of the cuts induced by C b and C d .
Since |C(G )| = |C(G)| in case the old clustering remains valid, the other bounds are correct and we know we will find the old clustering.Algorithm 6 (Intra-Cluster Edge Deletion) needs to examine all clusters in C(G) \ {C b/d }, and potentially all vertices in C b/d -even if the previous clustering is retained, e.g., with every vertex shadowing the one cut off right before, and pair {r(C b/d ), t} getting hidden.Obviously, we attain the lower bound if we cut away r(C b/d ) from t, directly preserving C b/d and all the other clusters.For Inter-Cluster Edge Insertion (Algorithm 7), we potentially end up separating every single vertex in C b ∪ C d from t, one by one, even if the previous clustering is valid, as, e.g., r(C b ) might become shadowed by some other v ∈ C b , which ultimately yields the upper bound.In case the previous clustering is valid, however, we might get away with simply cutting off r(C b ) and r(C d ), alongside their former clusters.This means, there is no guarantee that we return the previous clustering; still, with two cuts (r(C b )-t and r(C d )-t), we are quite likely to do so.The row for Intra-Cluster Edge Insertion is obvious.

Figure 15 :
Figure 15: Numbers of clusters and flows regarding consecutive clusterings (the two y-axes have a different offset for better readability).
contains more than one vertex, a node S is split.To this end, nodes S i = S are dealt with by contracting in G whole subtrees N j of S in T * , connected to S via edges {S, S j }, to single nodes η j (line 6) before splitting S, which yields G S .The split of S into (S u , S v ) is then defined by a minimum u-v-cut in G S (line 7), which does not cross any of the previously used minimum cuts due to the contraction technique.Afterwards, each N j is reconnected in T * , again by S j , to either S u or S v depending on which side of the cut η j , containing S j , ended up.It is crucial to note, that this cut in G S can be proven to induce a minimum u-v-cut in G.An (partial) execution GH = (G, F, K) of Gomory-Hu is characterized by graph G, sequence F of |F | ≤ n − 1 step pairs of vertices (compare to line 3) and sequence K of split cuts (compare to line 7).A step pair {u, v} is hidden if {u, v} is no edge in the final tree T (G).Hidden pairs occur if either partner moves farther away from the other by unfavorable involvement in later split cuts. * and t, but θ j is known and does not separate r(C i ) and t.

Table 2 :
Total number of modifications decomposed into different scenarios.