Parameterized Dynamic Cluster Editing

We introduce a dynamic version of the NP-hard graph problem Cluster Editing. The essential point here is to take into account dynamically evolving input graphs: Having a cluster graph (that is, a disjoint union of cliques) that represents a solution for the first input graph, can we cost-efficiently transform it into a"similar"cluster graph that is a solution for the second ("subsequent") input graph? This model is motivated by several application scenarios, including incremental clustering, the search for compromise clusterings, or also local search in graph-based data clustering. We thoroughly study six problem variants (edge editing, edge deletion, edge insertion; each combined with two distance measures between cluster graphs). We obtain both fixed-parameter tractability as well as (parameterized) hardness results, thus (except for three open questions) providing a fairly complete picture of the parameterized computational complexity landscape under the two perhaps most natural parameterizations: the distance of the new"similar"cluster graph to (i) the second input graph and to (ii) the input cluster graph.

We introduce a dynamic version of the NP-hard graph problem Cluster Editing. The essential point here is to take into account dynamically evolving input graphs: Having a cluster graph (that is, a disjoint union of cliques) regarding a solution for thr first input graph, can we cost-efficiently transform it into a "similar" cluster graph that is a solution for the second ("subsequent") input graph? This model is motivated by several application scenarios, including incremental clustering, the search for compromise clusterings, or also local search in graph-based data clustering. We thoroughly study six problem variants (edge editing, edge deletion, edge insertion; each combined with two distance measures between cluster graphs). We obtain both fixed-parameter tractability as well as (parameterized) hardness results, thus (except for three open questions) providing a fairly complete picture of the parameterized computational complexity landscape under the two perhaps most natural parameterizations: the distances of the new "similar" cluster graph to (i) the second input graph and to (ii) the input cluster graph.

Introduction
The NP-hard Cluster Editing problem [6,41], also known as Correlation Clustering [5], is one of the most popular graph-based data clustering problems in algorithmics. Given an undirected graph, the task is to transform it into a disjoint union of cliques (also known as cluster graph) by performing a minimum number of edge modifications (deletions or insertions). Being NP-hard, Cluster Editing gained high popularity in studies concerning parameterized algorithmics, e.g. [1,4,9,11,14,23,26,29,33]. To the best of our knowledge, to date these parameterized studies mostly focus on a "static scenario". Chen et al. [14] are an exception by also looking at temporal and multilayer graphs. In their work, the input is a set of graphs (multilayer) or an ordered list of graphs (temporal), in both cases defined over the same vertex set. The goal is to transform each input graph into a cluster graph such that, in the multilayer case, the number of vertices in which any two cluster graphs may differ is upper-bounded, and in the temporal case, the number of vertices in which any two consecutive (with respect to their position in the list) cluster graphs may differ is upper-bounded.
In this work, we introduce a dynamic view on Cluster Editing by, roughly speaking, assuming that the input graph changes once. Thus we seek to efficiently and effectively adapt an existing solution, namely a cluster graph. In contrast to the work of Chen et al. [14], we do not assume that all future changes are known. We consider the scenario where given an input graph, we only know changes that lie immediately ahead, that is, we know the "new" graph that the input graph changes to. Motivated by the assumption that the "new" cluster graph should only change moderately but still be a valid representation of the data, we parameterize both on the number of edits necessary to obtain the "new" cluster graph and the difference between the "old" and the "new" cluster graph. We finally remark that there have been previous parameterized studies of dynamic (or incremental) graph problems, dealing with coloring [30], domination [3,19], or vertex deletion [2,34] problems.
Mathematical model. In principle, the input for a dynamic version of a static problem X are two instances I and I ′ of X, a solution S for I, and an integer d. The task is to find a solution S ′ for I ′ such that the distance between S and S ′ is upper-bounded by d. Often, there is an additional constraint on the size of S ′ . Moreover, the symmetric difference between I and I ′ is used as a parameter for the problem many times. We arrive at our following "original dynamic version" of Cluster Editing (phrased as decision version).
Original Dynamic Cluster Editing Input: Two undirected graphs G 1 and G 2 and a cluster graph G c over the same vertex set, and two nonnegative integers: a budget k and a distance upper bound d such that |E(G 1 ) ⊕ E(G c )| ≤ k. Question: Is there a cluster graph G ′ for G 2 such that 1. |E(G 2 ) ⊕ E(G ′ )| ≤ k and 2. dist(G ′ , G c ) ≤ d?
Herein, ⊕ denotes the symmetric difference between two sets and dist(·, ·) is a generic distance function for cluster graphs, which we discuss later. Moreover, G c is supposed to be the "solution" given for the input graph G 1 . However, since the question in this problem formulation is independent from G 1 we can remove this graph from the input and arrive at the following simplified version of the problem. For the remainder of this paper we focus on this simplified formulation of Dynamic Cluster Editing.
Dynamic Cluster Editing Input: An undirected graph G and a cluster graph G c over the same vertex set, and two nonnegative integers: a budget k and a distance upper bound d. Question: Is there a cluster graph G ′ for G such that 1. |E(G) ⊕ E(G ′ )| ≤ k and 2. dist(G ′ , G c ) ≤ d?
There are many different distance measures for cluster graphs [37,38]. Indeed, we will study two standard ways of measuring the distance between two cluster graphs. One is called classification error distance, which measures the number of vertices one needs to move between cliques to make two cluster graphs the same-we subsequently refer to it as matching-based distance. The other is called disagreement distance, which is the symmetric distance between two edge sets-we subsequently refer to it as edge-based distance. Notably, the edge-based distance upper-bounds the matching-based distance. We give formal definitions in Section 2.
There are several natural application scenarios that motivate the study of Dynamic Cluster Editing. Next, we list four of them.
Dynamically updating an existing cluster graph. Dynamic Cluster Editing can be interpreted to model a smooth transition between cluster graphs, reflecting that "customers" working with clustered data in a dynamic setting may only tolerate a moderate change of the clustering from "one day to another" since "revolutionary" transformations would require too dramatic changes in their work. In this spirit, when employing small parameter values, Dynamic Cluster Editing has kind of an evolutionary flavor with respect to the history of the various cluster graphs in a dynamic setting.
Editing a graph into a target cluster graph. For a given graph G, there may be many cluster graphs which are at most k edge modifications away. The goal then is to find one of these which is close to the given target cluster graph G c since in a corresponding application one is already "used to" work with G c . Adapting a different point of view, the editing into the target cluster graph G c might be too expensive (that is, |E(G)⊕E(G c )| is too big), and one has to find a solution cluster graph with small enough modification costs but being still close to the target G c .
Local search for an improved cluster graph. Here the scenario is that one may have found an initial clustering expressed by G c , and one searches for another solution G ′ for G within a certain local region around G c (captured by our parameter d).
Editing into a compromise clustering. When focusing on the edge-based distance, one may generalize the definition of Dynamic Cluster Editing by allowing G c to be any graph (not necessarily a cluster graph). This may be used as a model for "compromise cluster editing" in the sense that the goal cluster graph then is a compromise for a cluster graph suitable for both input graphs since it is close to both of them.
Our results. We investigate the (parameterized) computational complexity of Dynamic Cluster Editing. We study Dynamic Cluster Editing as well as two restricted versions where only edge deletions ("Deletion") or edge insertions ("Completion") are allowed. We show that all problem variants (notably also the completion variants, whose static counterpart is trivially polynomial-time solvable) are NP-complete even if the input graph G is already a cluster graph. Table 1 surveys our main complexity results.
The general versions of Dynamic Cluster Editing all turn out to be parameterized intractable (W[1]-hard) by the single natural parameters "budget k" and "distance d"; however, when both parameters are combined, one achieves a polynomial-size problem kernel, also implying fixed-parameter tractability. We also derive a generic approach, based on a reduction to Multi-Choice Knapsack, to derive fixed-parameter tractability for several deletion and completion variants with respect to the parameters budget k as well as the distance d.
Organization of the paper. Our work, after introducing basic notation (Section 2), consists of two main parts. In Section 3, we provide all our (parameterized) hardness results. In Section 4, we develop several positive algorithmic results, namely polynomialsize problem kernels through polynomial-time data reduction, and fixed-parameter solving algorithms. We conclude with a summary and directions for future work (Section 5).

Preliminaries and Problems Variants
In this section we give a brief overview on concepts and notation of graph theory and parameterized complexity theory that are used in this paper. We also give formal definitions of the distance measures for cluster graphs we use and of our problem variants. We use ⊕ to denote the symmetric difference, that is, for two sets A, B we have Graph-theoretic concepts and notations. Given a graph G = (V, E), we say that a vertex set C ⊆ V is a clique in G if G[C] is a complete graph. We say that a vertex set C ⊆ V is isolated in G if there is no edge {u, v} ∈ E with u ∈ C and v ∈ V \ C. A P 3 is a path with three vertices. We say that vertices u, v, w ∈ V form an induced is not a P 3 , or in other words, P 3 is a forbidden induced subgraph for cluster graphs.
Distance measures for cluster graphs. A cluster graph is simply a disjoint union of cliques. We use two basic distance measures for cluster graphs [37,38]. The first one is called "matching-based distance" and counts how many vertices have to be moved from one cluster to another to make two cluster graphs the same. See Figure 1 for an illustrating example. It is formally defined as follows. Figure 1: An illustration of the matching-based distance measure. On the left side, red dotted boundaries represent cliques in cluster graph G 1 , and blue dashed boundaries represent cliques in cluster graph G 2 . The bipartite graph on the right side is the edge-weighted bipartite graph B(G 1 , G 2 ). The maximumweight matching for B(G 1 , G 2 ) is formed by the two edges represented by the two bold lines.
Definition 1 (Matching-based distance). Let G 1 = (V, E 1 ) and G 2 = (V, E 2 ) be two cluster graphs defined over the same vertex set. Let B(G 1 , G 2 ) = (V 1 ⊎ V 2 , E, w) be a weighted complete bipartite graph, where each vertex u ∈ V 1 corresponds to one cluster of G 1 , denoted by C u ⊆ V , and each vertex v ∈ V 2 corresponds to one cluster of The second distance measure is called "edge-based distance" and simply measures the symmetric distance between the edge sets of two cluster graphs.
Definition 2 (Edge-based distance). Let G 1 = (V, E 1 ) and G 2 = (V, E 2 ) be two cluster graphs defined over the same vertex set. The edge-based distance d E between G 1 and G 2 is See Figure 1 for an example illustration of two cluster graphs G 1 and G 2 defined over the same vertex set V = {u 1 , u 2 , u 3 , u 4 , u 5 , u 6 , v 1 , v 2 , w}. In G 1 there are three cliques (clusters) C 1 = {u 1 , u 2 , u 3 , u 4 , u 5 , u 6 }, C 2 = {v 1 , v 2 } and C 3 = {w}. In G 2 there are two cliques C 1 ′ = {u 1 , u 2 , u 3 , v 1 , v 2 } and C 2 ′ = {u 4 , u 5 , u 6 , w}. Then in B(G 1 , G 2 ) we have three vertices on the left side for the cliques in G 1 and two vertices on the right side for the cliques in G 2 . A maximum-weight matching for B(G 1 , G 2 ) matches C 1 with C ′ 2 and C 2 with C ′ 1 , and has weight W = 5. Thus we have Problem names and definitions. In the following we present the six problem variants we are considering. We use Dynamic Cluster Editing as a basis for our problem variants. In Dynamic Cluster Deletion we add the constraint that E(G ′ ) ⊆ E(G) and in Dynamic Cluster Completion we add the constraint that E(G) ⊆ E(G ′ ).
For each of these three variants we distinguish a matching-based version and an edgebased version, where the generic "dist" in the problem definition of Dynamic Cluster Editing is replaced by d M and d E , respectively. This gives us a total of six problem variants. We use the following abbreviations for our problem names. The letters "DC" stand for "Dynamic Cluster", and "Matching Dist" is short for "Matching-Based Distance". Analogously, "Edge Dist" is short for "Edge-Based Distance". This yields the following list of studied problems: • Parameterized complexity. We use standard notation and terminology from parameterized complexity [15,18,22,39] and give here a brief overview of the most important concepts. A parameterized problem is a language L ⊆ Σ * × N, where Σ is a finite alphabet. We call the second component the parameter of the problem. A parameterized problem is fixed-parameter tractable (in the complexity class FPT) if there is an algorithm that solves each instance (I, r) in f (r) · |I| O(1) time, for some computable function f . A parameterized problem L admits a polynomial kernel if there is a polynomialtime algorithm that transforms each instance (I, r) into an instance (I ′ , r ′ ) such that (I, r) ∈ L if and only if (I ′ , r ′ ) ∈ L and |(I ′ , r ′ )| ≤ f (r), for some computable function f . If a parameterized problem is hard for the parameterized complexity class W [1], then it is (presumably) not in FPT. The complexity class W [1] is closed under parameterized reductions, which may run in FPT-time and additionally set the new parameter to a value that exclusively depends on the old parameter.

Intractability Results
In this section we first establish NP-completeness for all problem variants of Dynamic Cluster Editing, even if the input graph G is already a cluster graph. Theorem 1. All considered problem variants of Dynamic Cluster Editing are NPcomplete, even if the input graph G is a cluster graph.
Intuitively, Theorem 1 means that on top of the NP-hard task of transforming a graph into a cluster graph, it is computationally hard to improve an already found clustering with respect to being closer to the target cluster graph. Notably, while the dynamic versions of Cluster Completion turn out to be NP-complete, it is easy to see that classical Cluster Completion is solvable in polynomial time.
In a second part of this section we show W[1]-hardness results both for budget parameter k and for distance parameter d for several variants of Dynamic Cluster Editing. Formally, we show the following. The proof of Theorem 2 is based on several parameterized reductions which are presented in Section 3.2. The proof of Theorem 1 is based on nonparameterized polynomialtime many-one reductions (see Section 3.1) and some parameterized reductions that also imply NP-hardness (see Section 3.2). More precisely, Theorem 1 follows from Lemmas 1 to 3 and Observation 1 presented in Section 3.1, as well as Lemmas 4 and 5 presented in Section 3.2.

Polynomial-time many-one reductions
We first present two polynomial-time many-one reductions from the strongly NP-hard 3-Partition problem [24] for both DCCompletion (Matching Dist) and DCCompletion (Edge Dist) with input graphs G that are already cluster graphs. We start with the latter. Proof. We present a polynomial-time reduction from 3-Partition, where given a multiset of 3m positive integers {a 1 , a 2 , . . . , a 3m } with 1≤i≤3m a i = mB and for 1 ≤ i ≤ 3m it holds that B/4 < a i < B/2, the task is to determine whether this multi-set can be partitioned into m disjoint subsets A 1 , A 2 , . . . , A m such that for each 1 ≤ i ≤ m, a j ∈A i a j = B. Given an instance {a 1 , a 2 , . . . , a 3m } of 3-Partition, we construct an instance (G, G c , k, d) of DCCompletion (Edge Dist) as follows. The construction is illustrated in Figure 2. For graph G, we first create m disjoint big cliques each with M = 4(mB) 2 vertices. Then for every integer a i , we create a small clique C i with |C i | = a i vertices. We set G c to be a complete graph. Further, we set k = mM B + m 2 B 2 −  (⇒): Assume that {a 1 , a 2 , . . . , a 3m } is a yes-instance of 3-Partition. Then there is a partition A 1 , A 2 , . . . , A m such that for each 1 ≤ i ≤ m it holds that a j ∈A i a j = B. For each A i , we can combine the corresponding three small cliques and one big clique of size M into one clique. This costs M B is a yes-instance of DCCompletion (Edge Dist) and let G ′ be the solution. Since k + d = |E(G) ⊕ E(G c )|, to get G ′ we have to add exactly k edges to G. We make the following two observations. First, we can never combine two big cliques, as otherwise we need at least M 2 > k edge insertions. Second, every small clique must be combined with a big clique, as otherwise we have at most M (mB−1) edge insertions between big cliques and small cliques and at most (mB) 2 edge insertions between small cliques, and in total there are at most M (mB − 1) + (mB) 2 = mM B − 3(mB) 2 < k edge insertions. Hence, to get solution G ′ we must partition all 3m small cliques C 1 , C 2 , . . . , C 3m in G into m groups A 1 , A 2 , . . . , A m and combine all cliques in each group with one big clique.
We can split the edge insertions into two parts k = k 1 + k 2 , where k 1 = mM B is the number of edge insertions between big cliques and small cliques, and k 2 = 1≤i≤m C j ,C k ∈A i |C j ||C k | is the total number of edge insertions between small cliques in each group. We can also write k 2 as We continue with DCCompletion (Matching Dist). The corresponding NPhardness reduction uses the same basic ideas as in Lemma 1. The main difference is that in the proof of Lemma 1 we make use of the property that we need to add exactly k edges which enforces that every small clique should be combined with a big clique, while in the following proof we need to make use of the matching-based distance to enforce this. Proof. We present a polynomial-time reduction from 3-Partition, where given a multiset of 3m positive integers {a 1 , a 2 , . . . , a 3m } with 1≤i≤3m a i = mB and for 1 ≤ i ≤ 3m, B/4 < a i < B/2, the task is to determine whether this multi-set can be partitioned into m disjoint subsets A 1 , A 2 , . . . , A m such that for each 1 ≤ i ≤ m it holds that a j ∈A i a j = B. Given an instance {a 1 , a 2 , . . . , a 3m } of 3-Partition, we construct an instance (G, G c , k, d) of DCCompletion (Edge Dist) as follows.
The construction is illustrated in Figure 3. For graph G, we first create m big cliques C M 1 , C M 2 , . . . , C M m each with M = 4(mB) 2 vertices. Then for every integer a i in {a 1 , a 2 , . . . , a 3m }, we create a small clique C i with |C i | = a i m. Lastly, we create a clique C M 2 with M 2 vertices. For graph G c , we create m + 1 cliques as follows. For every C M i in G, we create a clique C M +3m i with M + 3m vertices which contains all M vertices from C M i and one vertex from each C i for 1 ≤ i ≤ 3m. In other words, each C i in G contains exactly one vertex from each C M +3m i in G c for 1 ≤ i ≤ m. Lastly, we create a clique C M 2 +(B−3)m 2 which contains all remaining vertices, that is, M 2 vertices from C M 2 and vertices from every C i for 1 ≤ i ≤ 3m which are not contained in It is easy to see that the maximum-weight matching Thus the matching-based distance between G and G c is (⇒): Assume that {a 1 , a 2 , . . . , a 3m } is a yes-instance of 3-Partition. Then there is a partition A i , A 2 , . . . , A m such that for 1 ≤ i ≤ m it holds that a j ∈A i a j = B. We add edges into G to get a cluster graph G ′ as follows. For each A i , we combine the corresponding three small cliques for the three integers in A i and the big clique C M i into one clique. This costs Since every small clique C i , combined with some big clique C M j , contains one vertex is a yes-instance of DCCompletion (Matching Dist) and let G ′ be the solution and let M ′ be the maximum-weight matching between G ′ and G c . First note that clique C M 2 has M 2 vertices and M 2 > k, so we cannot combine C M 2 with any other clique. Since i , since otherwise the distance between G ′ and G c is at least M and M > d. This also means that we cannot combine two big cliques has to be combined with some big clique C M j . We can split k into two parts k = k 1 + k 2 , where k 1 = m 2 M B is the number of edge insertions between big cliques and small cliques, and k 2 is the total number of edge insertions between small cliques. Similarly to the analysis in Lemma 1, we have that Observe that when G is a cluster graph, then we can "swap" G with G c and k with d: Observe that from Lemma 1 and Observation 1 we can infer NP-hardness for DCDeletion (Edge Dist) even if G is a cluster graph. For the matching-based distance, we do not have an analogue of Observation 1. Thus, we provide another reduction showing NP-hardness for DCDeletion (Matching Dist) even if G is a cluster graph.
Proof. We present a polynomial-time reduction from the NP-hard Exact Cover by 3-Sets problem [31], where given a set X with |X| = 3q and a collection S of 3-element subsets of X, the task is to determine whether S contains a subcollection S ′ ⊆ S of size q that covers every element in X exactly once. Given an instance (X, S) of Exact Cover by 3- The construction is illustrated in Figure 4. For every set example, if an element x i is contained in some set S j , then in G the corresponding clique C j for S j contains a vertex x j i which is also contained in the clique D x i in G c . Hence, if there is a subcollection S ′ of size q that covers every element in X exactly once, then we can find these q corresponding cliques in G and separate them to get 3q new vertices each contained in one different clique D x i in G c . Finally, we set k = 9q and d = 3m − 3q.
Note that the maximum-weight matching M * for B(G, G c ) has to match every C i in G with D i in G c . Thus d M (G, G c ) = 3m. Now we show that (X, S) is a yes-instance of Exact Cover by 3-Sets if and only if (G, G c , k, d) is a yes-instance of DCDeletion (Matching Dist).
(⇒): Assume that (X, S) is a yes-instance of Exact Cover by 3-Sets. Let S ′ be the solution. For every S i ∈ S ′ , we find the corresponding clique Let G ′ be the resulting cluster graph. For every such clique C i , we delete nine edges to partition it. Thus, overall we need to delete 9q = k edges. Since every element of X is covered by exactly one set from S ′ , we have that in G ′ we get 3q new cliques each with one vertex and each vertex is contained in a different clique from is a yes-instance of DCCompletion (Matching Dist). Let G ′ be the solution and M ′ be the maximum-weight matching between G ′ and G c . Since we can only delete edges to get G ′ and every set S i can only contain each element from X once, we get that in M ′ any edge incident on D x i has weight at most one. Since d M (G, G c ) ≤ d = 3m − 3q, it has to be that in M ′ every D x i is matched with a new clique in G ′ and they share exactly one vertex. Thus we need 3q new cliques in G ′ to be matched with D x 1 , D x 2 , . . . , D x 3q in G c . To get these 3q new cliques, we need to separate at least 3q vertices from C 1 , C 2 , . . . , C m in G. Since we can delete at most k = 9q edges, there have to be q cliques from C 1 , C 2 , . . . , C m such that we can separate each of them into four parts, where the first part contains {v i 1 , v i 2 } and the remaining three parts each have one vertex. Moreover, these 3q new cliques each share one vertex with one different clique from D x 1 , D x 2 , . . . , D x 3q . Thus, in the instance (X, S) of Exact Cover by 3-Sets we can find the corresponding 3q sets and they cover each element of X exactly once.

Parameterized Reductions
We first show that DCEditing (Matching Dist) is W[1]-hard when parameterized by the budget k. Proof. We present a parameterized reduction from Clique, where given a graph G 0 and an integer ℓ, we are asked to decide whether G 0 contains a complete subgraph of order ℓ. Clique is W[1]-hard when parameterized by ℓ [18]. Given an instance (G 0 , ℓ) of Clique, we construct an instance (G, G c , k, d) of DCEditing (Matching Dist) as follows.
The construction is illustrated in Figure 5. Let n = |V (G 0 )|. We first construct G. For every vertex v of G 0 , we create a clique C v of size ℓ 7 + ℓ 4 + ℓ 2 . For every edge e of G 0 , we create a clique C e of size ℓ 4 + 2. Lastly, we create a big clique C B of size ℓ 8 . Note that G is already a cluster graph. Next we construct G c . We first create ℓ cliques D i of size nℓ 3 for each 1 ≤ i ≤ ℓ. Every D i contains ℓ 3 vertices in every C v in G. In other words, every C v in G contains ℓ 3 vertices in every D i in G c . Then we create a big clique D B which contains all vertices in C B and ℓ 7 vertices in every C v . For every vertex v of G 0 , we create clique D v which contains ℓ 2 vertices in C v and one vertex in every C e for v ∈ e. Lastly, for every edge e we create D e which contains ℓ 4 vertices in C e . We set k = ℓ 2 (2ℓ 4 + 1) + ℓ ℓ−1 is the matching-based distance between G and G c , which is computed as follows.
To compute d M (G, G c ), we need to find an optimal matching in B(G, G c ), the weighted bipartite graph between G and G c . First, in an optimal matching D B must be matched Similarly, D e must be matched with C e for every e ∈ E(G 0 ). Then the remaining n cliques C v in G need to be matched to ℓ cliques D i and n cliques For each optimal matching, there are ℓ free cliques D v in G c which are not matched.
(⇒): Assume that there is a clique C * of size ℓ in G 0 . We modify the graph G as follows. First, for every edge e in the clique C * partition the corresponding clique C e in G into three parts; one part contains all vertices in D e and the other two parts each have one vertex. After this we get ℓ(ℓ − 1) single vertices. Since C * is a clique, all these single vertices can be partitioned into ℓ groups such that each group has ℓ − 1 vertices and all these ℓ − 1 vertices are contained in the same D v for some v ∈ C * . Then for each v ∈ C * , we combine the corresponding ℓ − 1 vertices into one clique C ℓ−1 v . Denote the resulting graph as G ′ . For an illustration see Figure 6. Along the way to get G ′ , we delete ℓ 2 (2ℓ 4 + 1) edges and add ℓ ℓ−1 we can only modify edges between vertices in C e . It is easy to see that in any optimal matching in B(G ′ , G c ), we still have that clique C B must be matched with D B and clique C e must be matched with D e for every e ∈ E(G 0 ). We should choose ℓ cliques Hence, to decrease the distance between G and G c , or to increase the matching, we have to create new cliques to be matched with these ℓ free cliques D v . Note that every D v only contains single vertices from C e with v ∈ e and the vertices contained in C v . To create new cliques we need to first separate D e to get single vertices and then combine them. To decrease the distance by ℓ(ℓ − 1), we need to separate at least ℓ(ℓ − 1) single vertices from C e . This will cost at least ℓ(ℓ − 1)(ℓ 4 + 1) − ℓ 2 = ℓ 2 (2ℓ 4 + 1) edge deletions if we always separate one C e into three parts and get two single vertices. Then we need to combine these single vertices into at most ℓ cliques since there are at most ℓ free cliques D v . This will cost at least ℓ ℓ−1 2 edge insertions if all these ℓ(ℓ − 1) single vertices can be partitioned into ℓ groups and each group has ℓ − 1 vertices. Since k = ℓ 2 (2ℓ 4 + 1) + ℓ ℓ−1 2 , we have that in the first step we have to choose ℓ 2 cliques C e and separate them into three parts and all these ℓ(ℓ − 1) single vertices are evenly distributed in ℓ free cliques D v . This means that in G 0 we can select ℓ 2 edges between ℓ vertices and each vertex has ℓ − 1 incident edges. Thus there is a clique of size ℓ in G 0 .
The next lemma shows that DCEditing (Edge Dist) is W[1]-hard with respect to k. The corresponding parameterized reduction is from Clique and shares some similarities with th reduction presented in the proof of Lemma 4 with respect to the edge gadgets.
The result is based on the following property for instances of DCEditing (Edge Proof. On the one hand, for any graph G ′ , we have that which is a contradiction. Thus we conclude that S 1 = ∅ and hence E( Consequently, when k + d = |E(G) ⊕ E(G c )| the only way to get a solution G ′ is to find a subset of E(G) ⊕ E(G c ) with size exactly k such that modifying the edges of this subset in G yields a cluster graph. Proof. We present a parameterized reduction from Clique, where given a graph G 0 and an integer ℓ, we are asked to decide whether G 0 contains a complete subgraph of order ℓ. Clique is W[1]-hard when parameterized by ℓ [18]. Given an instance (G 0 , ℓ) of Clique, we construct an instance (G, G c , k, d) of DCEditing (Edge Dist) as follows. The construction is illustrated in Figure 7. We set L 1 = ℓ 7 + 1 and L 2 = ℓ 2 . We first construct G. For every vertex v of G 0 , we create a clique C v of size L 1 + 1 = ℓ 7 + 2, and for every edge e of G 0 , we create a clique C e of size 2L 2 . Note that G is already a cluster graph. Next, we construct G c . For every vertex v of G 0 , let C 1 e , C 2 e , . . . , C p e be all cliques of size 2L 2 in G which represent all edges incident on v. For each vertex v of G 0 , we create two cliques in G c . One of them contains contains the remaining one vertex of C v , called the single vertex of C v , and L 2 vertices from every C i e for 1 ≤ i ≤ p (see also Figure 7). Set and set d = |E(G) ⊕ E(G c )| − k. This reduction works in polynomial time. Now we show that there is a clique of size ℓ in G 0 if and only if there is a cluster To simplify the proof, we assume ℓ ≥ 3 in the following.
(⇒): Assume that there is a clique C * of size ℓ in G 0 . We modify graph G in the following two steps. We first separate cliques in G according to C * by deleting edges as follows. For every vertex v in C * , find the clique C v and delete edges between the single vertex in C v and the remaining L 1 vertices. For every edge e in C * , find the clique C e in G and delete edges to separate the clique into two parts, each with L 2 vertices. In the first step we delete ℓL 1 + ℓ 2 L 2 2 edges. The next step is to combine some cliques by adding edges. For every vertex v in C * , we combine the single vertex from C v and ℓ − 1 cliques of size L 2 into one clique. In this step we add ℓ(ℓ − 1)L 2 + ℓ ℓ−1 2 L 2 2 edges. Thus in total we modify k edges.
(⇐): Assume that there is a cluster graph Thus, to get the solution G ′ we have to modify exactly k edges from E(G) ⊕ E(G c ). As a result, we only have the following four kinds of operations: 1. separate a clique C v in G into two parts, one with the single vertex and the other with L 1 vertices, which costs L 1 = ℓ 7 + 1 edge deletions; 2. separate a clique C e in G into two parts, each with L 2 vertices contained in one clique in G c , which costs L 2 2 = ℓ 4 edge deletions; 3. combine the single vertex of C v with some cliques of size L 2 which come from separating clique C e into two parts, which costs aL 2 = aℓ 2 edge insertions for some integer a; 4. combine some cliques of size L 2 which come from separating clique C e into two parts, which costs b 2 L 2 2 = b 2 ℓ 4 edge insertions for some integer b. First, we claim that there must be ℓ cliques of size L 1 + 1 in G that have been separated. Note that k = ℓ 8 + 1 2 ℓ 7 − ℓ 6 + 1 2 ℓ 5 + ℓ 4 − ℓ 3 + ℓ, where the last additive term ℓ can only come from separating ℓ cliques of size L 1 + 1 in G. In addition, there cannot be more than ℓ cliques of size L 1 + 1 in G that have been separated, since (ℓ + 1)L 1 > k (assuming ℓ ≥ 3). Thus exactly ℓ cliques of size L 1 + 1 in G have to be separated and we get ℓ single vertices. This costs ℓL 1 edge deletions, which is the first additive item of Equation (1).
Next, we claim that at least ℓ(ℓ − 1) cliques of size L 2 are combined with these ℓ single vertices we got in the last step. This is because the second term of k, ℓ(ℓ−1)L 2 , is strictly less than ℓ 4 , and hence can only come from the third kind of operation, combining the single vertex with cliques of size L 2 . Suppose that ℓ(ℓ − 1) + δ cliques of size L 2 are combined with these single vertices for some δ ≥ 0. Then we need (ℓ(ℓ − 1) + δ)L 2 edge insertions. Note that the second additive term of Equation (1) Then, we need to separate at least ℓ 2 + ⌈δ⌉ 2 cliques of size 2L 2 so that we can combine them with single vertices. Denote by f 1 (ℓ, δ) the number of edge deletions this separation cost. Clearly, f 1 (ℓ, δ) ≥ ( ℓ 2 + ⌈δ⌉ 2 )L 2 2 . Notice that the last additive term of Equation (1) is ℓ 2 L 2 2 . Finally, when we combine a single vertex with more than one clique of size L 2 , then we also need to add edges between these cliques. Denote by f 2 (ℓ, δ) the number of edge insertions between these cliques. Since we have ℓ(ℓ − 1) + δ cliques of size L 2 and ℓ single vertices, and every clique is combined with one single vertex, it follows that f 2 (ℓ, δ) ≥ ℓ ℓ−1 2 L 2 2 . Notice that the third additive term of Equation (1) is ℓ ℓ−1 2 L 2 2 . Overall, we need Here f 2 (ℓ, δ) = ℓ ℓ−1 2 L 2 2 means that we can partition all ℓ(ℓ − 1) cliques of size L into ℓ parts, each with ℓ − 1 cliques, and then combine all ℓ − 1 cliques in each part with one single vertex. Moreover, f 1 (ℓ, δ) = ℓ 2 L 2 2 means that all these ℓ(ℓ − 1) cliques of size L come from separating ℓ 2 cliques of size 2L 2 . Then, in G 0 we have ℓ vertices (corresponding to these ℓ single vertices) and ℓ 2 edges (corresponding to these ℓ 2 cliques of size 2L 2 ) such that each vertex has ℓ − 1 incident edges from these ℓ 2 edges. Hence, these ℓ vertices form a clique in G 0 .
Note that in the reduction of Lemma 5 the constructed graph G is a cluster graph. According to Observation 1, this reduction can also be used to prove W[1]-hardness with respect to the distance d.  The following result also exploits on the property that we need exactly k edge modi- Proof. We present a parameterized reduction from Multicolored Clique. In Multicolored Clique, we are given an integer ℓ and a graph where every vertex is colored with one of ℓ colors. The task is to find a clique of size ℓ containing one vertex of each color. Multicolored Clique is W[1]-hard with respect to ℓ [20]. Let (G 0 = (V, E), ℓ) be an instance of Multicolored Clique. We construct an instance (G, G c , k, d) of DCDeletion (Edge Dist) as follows. For every vertex v in G 0 , create a clique C v with 2ℓ vertices in G c . Add a special clique with one vertex v * in G 0 . For graph G, first copy G c and then add more edges as follows: add edges between v * and all other vertices in G, and for every edge {u, v} in G 0 , add all edges between vertices in C u and vertices in C v . Set d = 2ℓ 2 + 4ℓ 2 ℓ 2 and k = |E(G) ⊕ E(G c )| − d. This reduction works in polynomial time and the construction is illustrated in Figure 8.
Note that k + d = |E(G) ⊕ E(G c )| and according to Observation 2 a solution G ′ for instance (G, G c , k, d) has to delete exactly k edges from E(G) ⊕ E(G c ) from G, which is equivalent to adding exactly d edges from E(G) ⊕ E(G c ) to G c . Next we show that there is a multicolored clique of size ℓ in G 0 if and only if there is a cluster graph (⇒:) Suppose that there is a multicolored clique C 0 of size ℓ in G 0 , then for all vertices in C 0 find the corresponding cliques in G c , and combine these ℓ cliques and vertex v * into one big clique. Denote the resulting graph as G ′ . To get graph G ′ from G, we need to delete |E(G) ⊕ E(G c )| − (2ℓ 2 + 4ℓ 2 ℓ 2 ) = k edges, and all these edges are in E(G)⊕E(G c ). In this way we get a new cluster graph G ′ such that |E(G ′ )⊕E(G)| = k and |E(G ′ ) ⊕ E(G c )| = d.
2 , and except for v * , every clique in G c has 2ℓ vertices, so 2ℓ 2 in d must come from adding edges between v * and ℓ cliques in G c . Since G ′ is a clique, there must be edges between every pair of these ℓ cliques in G, which means that there is a multicolored clique of size ℓ in G 0 .
The remaining two results show W[1]-hardness with respect to the distance d for DCEditing (Matching Dist) and DCDeletion (Matching Dist). Proof. We present a parameterized reduction from Clique on Regular Graphs, where given a regular graph G * = (V, E) with vertex degree r with r < n 2 , and a number k * with k * ≤ r, we are asked to decide whether G * contains a clique of size k * . Clique on Regular Graphs is W[1]-hard with respect to k * [10].
Given an instance (G 0 , k 0 , r) of Clique on Regular Graphs, we construct an instance (G, G c , d, k) of DCEditing (Matching Dist) as follows. Graph G is the same as G 0 and graph G c = (V, V 2 ) is a complete graph. Set d = k 0 and k = n(n−1−r) 2 − k 0 (n + k 0 − 2r − 2). The construction can trivially be done in polynomial time. In the following we show that there is a clique of size k 0 in G 0 if and only if (G, G c , d, k) is a yes-instance of DCEditing (Matching Dist).
(⇒): Assume that there is a clique of size k 0 in G 0 ; we construct a graph G ′ which consists of two cliques, where one of them contains the vertices from the clique of size k 0 in G 0 ; the other, denoted by C max , contains the remaining vertices and has size n − k 0 . Next we compute |E(G) ⊕ E(G ′ )|, which consists of two parts: • D(k 0 ): the set of edges between vertices in C max and the remaining vertices, and • A(k 0 ): the set of edges between vertices in C max . Since the vertices outside C max form a clique, every such vertex has r − k 0 + 1 edges connected to vertices in C max . Thus |D(k 0 )| = k 0 (r − k 0 + 1). To determine |A(k 0 )|, we count the sum of the degrees of vertices in C max . Before adding edges to C max , the sum is (n − k 0 )r. After adding edges the sum should be (n − k 0 )(n − k 0 − 1) + |D(k 0 )|. So the number of edges which need to added to C max is Then we get the size of the modification set for G ′ : (⇐): To simplify the following proof, we define three functions: , and • f (x) := g 1 (x) + g 2 (x) = n(n−1−r) 2 − x(n + x − 2r − 2). Since r < n 2 , we have that f (x) is monotonically decreasing and f (k 0 ) = k. Suppose that there is no clique of size k 0 in G 0 . We need to show that there is no cluster graph G ′ satisfying both |E(G)⊕E(G ′ )| ≤ k and d(G c , G ′ ) ≤ d. Suppose towards a contradiction that there is such a cluster graph G ′ . Denote the largest cluster in G ′ as C max . Since d M (G c , G ′ ) ≤ d, we have that |V (C max )| ≥ n − k 0 . Define • D: the set of edges between vertices in C max and the remaining vertices, and • A: the set of edges between vertices in C max . To get the clique C max from G, we have to delete all edges in D and add all edges in A, thus |E(G) ⊕ E(G ′ )| ≥ |D| + |A|. We distinguish the following two cases: Case 1: |C max | = n−k 0 . Every vertex outside C max has at least r−k 0 +1 edges connected to vertices in C max , and since there is no clique of size k 0 in G 0 , among all vertices outside C max , there is at least one vertex which has more than r − k 0 + 1 edges connected to vertices in C max . This means that |D| > g 1 (k 0 ) and |A| > g 2 (k 0 ). Thus, we have: is the number of all vertices outside C max . Now we have |D| ≥ g 1 (k ′ ) and |A| ≥ g 2 (k ′ ), and The last inequality holds since f (k) is monotonically decreasing. In both cases we have that there is no solution for instance (G, G c , d, k).  Proof. We present a parameterized reduction from Clique on Regular Graphs, where given a regular graph G * = (V, E) with vertex degree r with r < n 2 , and number k * with k * ≤ r, we are asked to decide whether G * contains a clique of size k * . Clique on Regular Graphs is known to be W[1]-hard with respect to k * [10]. Given an instance (G 0 , ℓ, r) of Clique on Regular Graphs, where G 0 is a regular graph with vertex degree r, we construct an instance (G, G c , d, k) of DCDeletion (Matching Dist) as follows. The construction is illustrated in Figure 9.
Let {v 1 , v 2 , . . . , v n } be the vertex set of G 0 . For graph G, we first copy the whole graph G 0 . Then we add a universal vertex and a private neighbor for each original vertex: we add a universal vertex v 0 and add an edge between v 0 and every vertex v i in G 0 , and for every vertex v i in G 0 , we add vertex v ′ i and add an edge between v i . . . and v ′ i . The graph G c has the same vertex set as G. Moreover, graph G c contains edges between v i and v ′ i for all 1 ≤ i ≤ n. That is, G c consists of n + 1 cliques: . Second, delete all edges between vertices in {v 1 , v 2 , . . . , v n } except for edges between vertices in C * . We delete n edges in the first step and rn 2 − ℓ 2 edges in the second step, since G 0 is a regular graph and C * is a clique. By deleting these n + rn 2 − ℓ 2 = k edges, we get a cluster graph G ′ which contains n + 1 cliques: . This means that for every v i ∈ {v 1 , v 2 , . . . , v n } vertex v i is either in the same clique with v ′ i or with v 0 . Suppose that in G ′ there are p ≤ ℓ vertices from {v 1 , v 2 , . . . , v n } which are in the same clique with v 0 . Then these p vertices must form a clique C ′ in G 0 . To get G ′ , we have to delete edges {v i , v ′ i } for all v i ∈ V (C ′ ) and edge {v i , v 0 } for every vertex v i ∈ {v 1 , v 2 , . . . , v n } \ V (C ′ ). This costs n edge deletions. Moreover, we have to delete all edges between vertices in {v 1 , v 2 , . . . , v n } except for edges between vertices in C ′ . This costs rn 2 − p 2 edge deletions. Overall we have Since G ′ is a solution, we have that |E(G) ⊕ E(G ′ )| ≤ k = n + rn 2 − ℓ 2 . Hence, p ≥ ℓ and G 0 contains a clique of size ℓ.
We now have shown all intractability results stated in Theorem 2.

Fixed-Parameter Tractability Results
In this section we complement the hardness results of Section 3 by identifying tractable cases for the considered variants of Dynamic Cluster Editing. We first show that all problem variants admit a polynomial kernel for the combination of the budget k and the distance d. Then we present further FPT-results with respect to single parameters.

Polynomial Kernels for the Combined Parameter (k + d)
In this section we present polynomial kernels with respect to the parameter combination (k + d) for all considered variants of Dynamic Cluster Editing: Formally, we prove the following theorem. We describe polynomial-time data reduction rules that each take an instance (G = (V, E), G c = (V, E c ), k, d) as input and output a reduced instance. We say that the data reduction rule is correct if the reduced instance is a yes-instance if and only if the original instance is a yes-instance (of the corresponding problem variant). A data reduction rule works for all problem variants that fit a given restriction. For example, the restriction Editing/Deletion (given for Reduction Rule 2a) indicates the problems: DCEditing (Edge Dist), DCEditing (Matching Dist), DCDeletion (Edge Dist), and DCDeletion (Matching Dist). If no restriction is given, then the data reduction rules work for all problem variants. In the correctness proof of each reduction rule, we assume that all previous rules are not applicable.
The first rule formalizes an obvious constraint on the solvability of the instance (for all problem variants). The correctness of this rule is obvious.
Reduction Rule 1. If k < 0 or d < 0, then output NO. 2 We next use some well-known reduction rules for classical Cluster Editing [26] to get a graph which consists of isolated cliques plus one vertex set of size k 2 + 2k that does not contain any isolated cliques. These rules remove edges that are part of k + 1 induced P 3 s and add edges between non-adjacent vertex pairs that are part of k + 1 induced P 3 s. The correctness proofs are straightforward adaptations of the correctness proofs of these rules for classical Cluster Editing. The reason we use these data reduction rules instead of rules used for linear-vertex kernels for classical Cluster Editing [11,13,27] is that the rules we use do not eliminate any possible solutions. Thus, the presented rules perform edge edits that are provably part of every optimal edge modification set.
Reduction Rule 2a (Editing/Deletion). If there are k+1 induced P 3 s in G that contain a common edge {u, v} ∈ E, then remove that edge from E and decrease k by one.
Reduction Rule 2b (Completion). If there are k + 1 induced P 3 s in G that contain a common edge {u, v} ∈ E, then output NO.
Reduction Rule 3a (Editing/Completion). If there are k + 1 induced P 3 s in G that contain a common non-edge {u, v} / ∈ E, then add that edge to E and decrease k by one.
Reduction Rule 3b (Deletion). If there are k + 1 induced P 3 s in G that contain a common non-edge {u, v} / ∈ E, then output NO.
be an instance of a problem variant of Dynamic Cluster Editing and let I * be the instance after applying any of the four reduction rules. It is obvious that if I is a no-instance, then I * is also a no-instance. In the following we show that if I is a yes-instance, then so is I * for Reduction Rules 2a and 2b. The correctness of Reduction Rules 3a and 3b follows by symmetric arguments. We now show for Reduction Rule 2a that the removed edge has to be in any solution for instance I. This implies that if I is a yes-instance of a completion variant of the problem, then Reduction Rule 2b is not applicable. Assume for the sake of contradiction that I is a yes-instance and that I * is a no-instance. Then there is a cluster graph G ′ with |E(G ′ ) ⊕ E| ≤ k that is a solution for I and contains edge {u, v}. However, we know that there are k + 1 vertices w 1 , w 2 , . . . , w k+1 such that G[{u, v, w i }] is a P 3 for all 1 ≤ i ≤ k + 1 (otherwise the rule would not be applicable). To destroy these P 3 s without removing edge {u, v} we need at least k + 1 edge additions or deletions. This is a contradiction to the assumption that |E(G ′ ) ⊕ E| ≤ k.
As for classical Cluster Editing we can upper-bound the the number of vertices that are part of P 3 s, leading to the following reduction rule.
Reduction Rule 4. If there are more than k 2 +2k vertices in V that are each contained in an induced P 3 in G, then output NO. Let R ⊆ V denote the set of vertices in V that are each contained in an induced P 3 in G. Assume for the sake of contradiction that I is a yes-instance and that Reduction Rule 4 is applicable, that is, |R| > k 2 +2k. Then there is a cluster graph G ′ with |E(G ′ )⊕E| ≤ k that is a solution for I. For each {u, v} ⊆ R, let R uv denote the set of vertices w such that G[{u, v, w}] is a P 3 . Since the aforementioned rules are not applicable, we know that |R uv | ≤ k. We further know that R ⊆ {u,v}∈E(G ′ )⊕E ({u, v} ∪ R uv ). It follows that |R| ≤ k(k+2) = k 2 +2k. This is a contradiction to the assumption that Reduction Rule 4 is applicable.
In classical Cluster Editing we can just remove all isolated cliques from the graph. This is not always possible in our setting because of the distance constraints to G c . However, if there is a vertex set that forms an isolated clique both in G and G c , then we can remove it since it has no influence on k or d in any problem variant. This is formalized in the next rule. We omit a formal correctness proof.

Reduction Rule 5.
If there is a vertex set C ⊆ V that is an isolated clique in G and G c , then remove all vertices in C from G and G c . Now we introduce four new problem-specific reduction rules that will allow us to upper-bound the sizes of all remaining isolated cliques and their number in a function depending on k + d. The next rules deal with large isolated cliques and allow us to either remove them or conclude that we face a no-instance. We first state the reduction rule for the matching-based distance problem variants and then turn to the edge-based distance variants.
Reduction Rule 6a (Matching-based distance). If there is a vertex set C ⊆ V with |C| > k + 2d + 2 that is an isolated clique in G, then • if for each vertex set C ′ ⊆ V that is an isolated clique in G c we have that |C ∩C ′ | ≤ d, then answer NO, • otherwise, if there is a vertex set C ′ ⊆ V that is an isolated clique in G c and |C ∩ C ′ | > d, then remove vertices in C from G and G c and decrease d by |C \ C ′ |. Furthermore, if d ≥ 0, then add a set C d of k + d + 1 fresh vertices to V . Add all edges between vertices in C d to G and add all edges between vertices in C d ∪(C ′ \C) to G c (if not already present).

Lemma 11. Reduction Rule 6a is correct.
Proof. Let I = (G = (V, E), G c = (V, E c ), k, d) be an instance of a problem variant of Dynamic Cluster Editing that uses the matching-based distance and let I * be the instance after applying the reduction rule. Note that if there is a vertex set C ⊆ V with |C| > k + 2d + 2 > k + 1 that is an isolated clique in G, then this clique can neither be divided into smaller cliques nor can any vertex be added to this clique, since then more than k edge modifications would be necessary (or is not allowed in the case of deletion or completion). This means that if I is a yes-instance and G ′ is the solution for I, then for all {u, v} ∈ E(G ′ ) ⊕ E we have that {u, v} ∩ C = ∅ or, in other words, C is also an isolated clique in G ′ .
We first argue that if for each isolated clique C ′ in G c we have that |C ∩ C ′ | ≤ d, then we face a no-instance. Assume for contradiction that I is a yes-instance and G ′ is the solution for I. Then we know that C is also an isolated clique in G ′ and no matter to which clique C ′ in G c the clique C in G ′ is matched, we always have that |C \ C ′ | > d and hence the matching-based distance between G ′ and G c is too large. This is a contradiction to the assumption that I is a yes-instance. Now assume that there is an isolated clique C ′ in G c with |C ∩ C ′ | > d. We show that if I is a yes-instance, then I * is a yes-instance. Let I be a yes-instance and let G ′ be a solution for I. Then we know that C is also an isolated clique in G ′ . If C in G ′ is not matched to C ′ in G c then the matching-based distance between G ′ and G c is larger than d. Hence, we can assume that C in G ′ is matched to C ′ in G c .
For the next argument we introduce the following terminology. If in an optimal solution an isolated clique C in G ′ is matched to an isolated clique C ′ in G c , then we say that this match contributed |C \C ′ |+ |C ′ \C| to the matching-based distance between G ′ and G c . Now we look at the instance where the vertices in C are removed from G and G c . The reduction rule further reduces d by |C \ C ′ | and introduces a new isolated clique C d of size k + d + 1 to G. In G c we have that C d ∪ (C ′ \ C) is an isolated clique. We claim that G ⋆ = (V * , E * ⊕ (E(G ′ ) ⊕ E)) is a valid solution for I * . First, note that G ⋆ is a cluster graph. Since the removed clique and the added clique are both larger than k we can conclude that G ⋆ is the graph that results from removing the clique C from G ′ and then adding the clique C d . Concerning the matching-based distance, we can replace the match between C and C ′ in G ′ and G c , respectively, by the match between C d and C d ∪ (C ′ \ C) in G ⋆ and G * c , respectively. Note that the contribution of the match between C and C ′ in G ′ and G c , respectively, minus |C \ C ′ | (the value by which d is decreased by the reduction rule) is the same as the contribution of the match between C d and C d ∪ (C ′ \ C) in G ⋆ and G * c , respectively. Hence, we can conclude that the matching-based distance between G ′ and G c is the same as the matching-based distance between G ⋆ and G * c . It follows that I * is a yes-instance. By a symmetric argument it follows that if I * is a yes-instance, then I is a yesinstance.
Reduction Rule 6b (Edge-based distance). If there is a vertex set C ⊆ V with |C| > k + 1 that is an isolated clique in G, then decrease d by )| and remove vertices in C from G and G c .

Lemma 12. Reduction Rule 6b is correct.
Proof. Let I = (G = (V, E), G c = (V, E c ), k, d) be an instance of a problem variant of Dynamic Cluster Editing that uses the edge-based distance and let I * be the instance after applying the reduction rule. Note that if there is a vertex set C ⊆ V with |C| > k + 1 that is an isolated clique in G, then this clique can neither be divided into smaller cliques nor can any vertex be added to this clique since then more than k edge modifications would be necessary (or is not allowed in the case of deletion or completion). This means that if I is a yes-instance and G ′ is the solution for I, then for all {u, v} ∈ E(G ′ ) ⊕ E we have that {u, v} ∩ C = ∅ or, in other words, C is also an isolated clique in G ′ . This implies that removing C from G ′ and G c decreases d by the number of edges between vertices in C that are present in G ′ but not present in G c plus the number of edges in G c that have one endpoint in C and one endpoint in V \ G (note that no such edges are present in G ′ ). The number of edges between vertices in C that are present in G ′ clearly is |C| 2 and the number of edges between vertices in C that are present in G c is |E(G c [C])|. The number of edges in G c that have one endpoint in C and one endpoint in V \ G is the total number of edges in G c minus the edges in G c between vertices in C and the edges in G c between vertices in V \ C. Hence, , which yields the decrease conducted by the reduction rule. Note that this number is independent of G ′ . It follows that G ′ [V \ C] is a solution for I * . Thus, I * is a yes-instance.
By an analogous argument we get that if I * is a yes-instance, then I is also a yesinstance.
If none of the previous rules are applicable, then we know that there are no large cliques left in the graph. The next rules allow us to conclude that we face a no-instance if there are too many small cliques left.
Reduction Rule 7a (Matching-based distance). If there are more than 2k + d isolated cliques in G, then output NO.

Lemma 13. Reduction Rule 7a is correct.
Proof. Let I = (G = (V, E), G c = (V, E c ), k, d) be an instance of a problem variant of Dynamic Cluster Editing that uses the matching-based distance. We show that if Reduction Rule 5 is not applicable and there are 2k + d + 1 isolated cliques C 1 , C 2 , . . . , C 2k+d+1 ⊆ V in G, then I is a no-instance.
Assume for the sake of contradiction that I is a yes-instance. Then there is a cluster graph G ′ with |E(G ′ ) ⊕ E| ≤ k that is a solution for I. Since Reduction Rule 5 is not applicable we have that for isolated cliques C i in G with 1 ≤ i ≤ 2k + d + 1 the vertex set C i is not an isolated clique in G c . Each edge modification in E(G ′ ) ⊕ E when applied to G can reduce the number of isolated cliques in G that are not isolated cliques in G c by at most 2. This happens when two isolated cliques are joined in G and the union of their vertices is an isolated clique in G c . It is easy to check that this is the best case. It follows that after k edge modifications, G still has at least d + 1 isolated cliques that are not isolated cliques in G c . Thus the matching-based distance cannot be decreased to d which is a contradiction to the assumption that we face a yes-instance.
Reduction Rule 7b (Edge-based distance). If there are more than 2(k + d) isolated cliques in G, then output NO.

Lemma 14. Reduction Rule 7b is correct.
Proof. Let I = (G = (V, E), G c = (V, E c ), k, d) be an instance of a problem variant of Dynamic Cluster Editing that uses the edge-based distance. We show that if Reduction Rule 5 is not applicable and there are 2(k + d) + 1 isolated cliques C 1 , C 2 , . . . , C 2k+d+1 ⊆ V in G, then I is a no-instance.
Let M = E ⊕ E c . Since Reduction Rule 5 is not applicable we have that for isolated cliques C i in G with 1 ≤ i ≤ 2(k + d) + 1 the vertex set C i is not an isolated clique in G c . It follows that for all C i there is a vertex u ∈ C i and a vertex v ∈ V such that {u, v} ∈ M . This implies that |M | > k + d and, hence, we face a no-instance.
In the following we show that the rules we presented decrease the number of vertices of the instance to a number polynomial in k + d. Proof. Let I = (G = (V, E), G c = (V, E c ), k, d) be an instance of a problem variant of Dynamic Cluster Editing that uses the matching-based distance.
Since Reduction Rule 4 is not applicable we know that there are at most k 2 + 2k vertices in G that are not part of an isolated clique. It is also known that there are O(k 3 ) edges between those vertices [26]. Further, since Reduction Rule 7a is not applicable, we know that there are at most 2k + d isolated cliques in G. Since Reduction Rule 6a is not applicable, we know that each isolated clique has size at most k + 2d + 2. This yields a maximum number of 3k 2 + 2d 2 + 5dk + 2d + 6k ∈ O(k 2 + d 2 ) vertices and O(k 3 + d 3 ) edges.
be an instance of any one of the considered problem variants of Dynamic Cluster Editing that uses the edge-based distance. If none of the appropriate data reduction rules applies, then |V | ∈ O(k 2 + k · d) and |E| = O(k 3 + k 2 · d).
Proof. Let I = (G = (V, E), G c = (V, E c ), k, d) be an instance of a problem variant of Dynamic Cluster Editing that uses the edge-based distance.
Since Reduction Rule 4 is not applicable we know that there are at most k 2 + 2k vertices in G that are not part of an isolated clique. It is also known that there are O(k 3 ) edges between those vertices [26]. Further, since Reduction Rule 7b is not applicable, we know that there are at most 2(k + d) isolated cliques in G. Since Reduction Rule 6b is not applicable, we know that each isolated clique has size at most k + 1. This yields a maximum number of 2dk + 2d + 3k 2 + 4k ∈ O(k 2 + k · d) vertices and O(k 3 + k 2 · d) edges.
Finally, we can apply all data reduction rules exhaustively in O(|V | 3 ) time. Proof. We first exhaustively apply Reduction Rule 1, Reduction Rule 2a, Reduction Rule 2b, Reduction Rule 3a, Reduction Rule 3b, and Reduction Rule 4. These rules are wellknown data reduction rules for classic Cluster Editing and it is known that these rules can exhaustively be applied in O(|V | 3 ) time [26] if the graph is represented by an adjacency matrix.
It is easy to check that none of the remaining rules introduce new induced P 3 s to G, hence we know that once these rules (except Reduction Rule 1) are exhaustively applied, then they will not be applicable after any of the other rules is applied.
From now on we assume that the graph G is represented in the following way. Adjacencies between vertices that are part of an induced P 3 are represented in an adjacency matrix. We know that all other vertices are contained in isolated cliques. We store a list of cliques and also a map from vertices to the isolated clique they are contained in. We assume that G c is represented in the same way. It is easy to check that this new representation can be computed in O(|V | 3 ) time from the adjacency matrix. Using

Fixed-Parameter Tractable Cases for Single Parameters
In this section we show that several variants of Dynamic Cluster Editing are fixedparameter tractable with respect to either the budget k or the distance d. All our FPT results in Section 4.2 are using the same approach: We reduce (in FPT time) the input to an instance of Multi-Choice Knapsack (MCK), formally defined as follows.

Multi-Choice Knapsack (MCK)
Input: A family of ℓ mutually disjoint sets S 1 , . . . , S ℓ of items, a weight w i,j and a profit p i,j for each item j ∈ S i , and two integers W and P . Question: Is it possible to select one item from each set S i such that the total profit is at least P and the total weight is at most W ?
MCK is solvable in pseudo-polynomial time by dynamic programming:

Lemma 18 ([32, Section 11.5]). MCK can be solved in
As our approach is easier to explain with the edge-based distance, we start with this case and afterwards show how to extend it to the matching-based distance. As already exploited in our reductions showing NP-hardness (see Theorem 1), all variants of Dynamic Cluster Editing carry some number-problem flavor. Our generic approach will underline this flavor: We will focus on cases where we can partition the vertex set of the input graph into parts such that we will neither add nor delete an edge between two parts. Moreover, we require that the parts are "easy" enough to list all Paretooptimal (with respect to k and d) solutions in FPT-time (this is usually achieved by some kernelization arguments). However, even with these strict requirements we cannot solve the parts independently from each other: The challenge is that we have to select for each part an appropriate Pareto-optimal solution. Finding a feasible combination of these part-individual solutions leads to a knapsack-type problem (in this case MCK). Indeed, this is common to all studied variants of Dynamic Cluster Editing.
The details for our generic four-step-approach (for edge-based distance) are given subsequently. In order to apply this approach on a concrete problem variant, we have to show (using problem specific arguments) how the requirements in the first two steps can be met.
1. When necessary, apply polynomial-time data reduction rules from Section 4.1. Partition the input graph G = (V, E) into different parts G 1 , G 2 , . . . , G ℓ+1 for some ℓ ≤ |V | such that • in G there is no edge between the parts and • if there is a solution, then there exists a solution where no edge between two parts will be inserted or deleted.
2. Compute for each part G i = (V i , E i ), 1 ≤ i ≤ ℓ, a set S i ⊆ N 2 encoding "cost" and "gain" of all "representative" solutions for G i . The size of the set S i has to be upper-bounded in a function of the parameter p. (Here, p will be either k or d.) More precisely, select a family E i of f (p) edge sets such that for each edge set

is a cluster graph achievable with the allowed number of modification operations (G
. For each such edge set E ′ i , add to S i a tuple containing the cost (= |E ′ i |) and "decrease" of the distance from G i to the target cluster graph G c . More formally, for edge insertions add ( The set S i has to fulfill the following property: If there is a solution, then there is a solution G ′ such that restricting G ′ to V i yields a tuple in S i . More precisely, we require that ( 3. Create an MCK instance I with W = k, P = |E⊕E c |−d, and the sets S 1 , S 2 , . . . , S ℓ where the tuples in the sets correspond to the items with the first number in the tuple being its weight and the second number being its profit.

Return true if and only if I is a yes-instance.
Note that the requirement in Step 1 implies that a part is a collection of connected components in G. Furthermore, note that the part G ℓ+1 will be ignored in the subsequent steps. Thus G ℓ+1 contains all vertices which are not contained in an edge of the edge modification set. Observe that ℓ ≤ n. Hence, we have ℓ i=1 |S i | ∈ O(f (p) · n). (The parameter p will be either k or d.) Moreover, as k and d are smaller than n 2 , it follows that W < n 2 and thus, by Lemma 18, the MCK instance I created in Step 3 can be solved in f (p) · n 3 time in Step 4. This yields the following.

Observation 3. If the partition in
Step 1 and the sets S i in Step 2 can be computed in g(p) · n c time for some function g and constant c and the then the above four-stepapproach runs in g(p) · n c + f (p) · n 3 time.
Note that Step 1 Step 2 are different for every problem variant we consider. There are, however, some similarities between the variants where only edge insertions are allowed.
Edge-based distance. Next we use the above mentioned approach to show that DCDeletion (Edge Dist) and DCCompletion (Edge Dist) are both fixed-parameter tractable with respect to k and that DCCompletion (Edge Dist) is also fixedparameter tractable with respect to d. Since Steps 1 and 2 are easiest to explain for the edge-deletion variant, we start with DCDeletion (Edge Dist). Note that the requirements of Steps 1 and 2 seem impossible to achieve in FPT-time when allowing edge insertions and deletions. Indeed, as shown in Theorem 2, the corresponding edgeedit variants are W[1]-hard with respect to the studied (single) parameters k and d, respectively. Proof. We first apply the known data reduction rules for Cluster Editing (see discussion after Theorem 3). As a result, we end up with a graph where at most k 2 + 2k vertices are contained in an induced P 3 ; all other vertices form a cluster graph with cliques containing at most k vertices each. Denote with G the resulting graph. Now we apply our generic four-step approach. Thus we need to provide the details how to implement Steps 1 and 2. We define the parts G 1 , G 2 , . . . , G ℓ , G ℓ+1 of Step 1 as follows: The first part G 1 = (V 1 , E 1 ) contains the graph induced by all vertices contained in a P 3 . Each of the cliques in the cluster graph G[V \ V 1 ] forms another part G i , 2 ≤ i ≤ ℓ. Finally, set G ℓ+1 = (∅, ∅), that is, we include all vertices in the subsequent steps of our generic approach. Clearly, each part contains less than 2k 2 vertices. Moreover, observe that there are no edges between the parts.
As to Step 2, we add, for every edge set As this enumerates all possible solutions for G i , the requirement in Step 2 is fulfilled. Together with Observation 3 we get the statement of the lemma.
Next we show that DCCompletion (Edge Dist) is in FPT with respect to d. Before applying our generic approach, we make some observations. Since we can only insert edges in DCCompletion (Edge Dist), we can make all vertices in a connected component pairwise adjacent.
Observation 4. Let (G, G c , k, d) be an instance of DCCompletion (Edge Dist) or of DCCompletion (Matching Dist). If G is not a cluster graph, then there is an equivalent instance (G * , G c , k * , d) with G * being a cluster graph and k * < k.
Proof. Since we are only allowed to insert edges and the solution graph is required to be a cluster graph, it follows that every connected component of G has to be made into clique. Call the resulting cluster graph G * and denote by k ′ the number of inserted edges. Clearly, (G, G c , k, d) is a yes-instance if and only if (G * , G c , k−k ′ , d) is a yes-instance.
Observation 4 allows us in the following to assume that all connected components in G are cliques. The main difference between DCDeletion (Edge Dist) and DC-Completion (Edge Dist) is that in the former we can partition cliques independently and thus the partition for Step 1 is straightforward. In the latter problem, Step 1 requires some preliminary observations. We subsequently show that for DCCompletion (Edge Dist) we can partition the graph G according to cliques in G c such that no edges between the parts are added.
We assign every clique C in G a number that indicates the "best match" in G c , that is, the clique D in G c -if existing-that contains more than half of the vertices of C. More formally, let C be the set all cliques in G and D = {D 1 , D 2 , . . . , D q } be the cliques in G c . We define a function T : C → {0, 1, . . . , q} mapping a clique C ∈ C to a number between 0 and q as follows: We say that we merge two cliques C i and C j when we add all edges between C i and C j . We show next that we can assume that we only merge cliques C i and C j with T (C i ) = T (C j ) (see Figure 10 for an illustration).
is called a standard solution if for each clique C ′ in G ′ the following holds: If C 1 = C 2 are two cliques in G and C 1 , C 2 ⊆ C ′ , then T (C 1 ) = T (C 2 ) > 0.
We start with a technical lemma that essentially states that merging two cliques C i and C j with T (C i ) = T (C j ) or T (C i ) = 0 will not decrease the edge-based distance.
Proof. We first show the statement for r = 1.
It remains to consider the case that T (C 0 ) = j 0 = j 1 = T (C 1 ) for some j 0 , j 1 ∈ {1, 2, . . . , q}. From the above argument for the case T (C 0 ) = 0 we have i∈{1,...,q}\{j 0 ,j 1 } It remains to show that To this end, observe that Furthermore, From the above, we can deduce that This completes the proof for the case T (C 0 ) = T (C 1 ).
The proof for the case r > 1 is now straightforward. We have Using the above argument for r = 1 for every C j , 1 ≤ j ≤ r, we have that Proof. Let G ′ be a solution for (G, G c , k, d). Assume that G ′ is not a standard solution. Let C ′ be a clique in G ′ which is not standard. (A clique C ′ is called a standard clique if either it only contains one clique from C or there is a number i with 1 ≤ i ≤ q such that all cliques from C contained in C ′ have the value i under the function T .) Next we show that we can modify G ′ to get a standard solution by showing that each non-standard clique can be divided into some standard cliques and the resulting cluster graph is still a solution. We consider two cases distinguishing whether or not C ′ contains a clique C from G with T (C) = 0. If C ′ contains a clique C from G with T (C) = 0, then splitting C from C ′ gives a cheaper solution that, by Lemma 20, also has distance at most d from G c . Now consider the case that there is no clique C from G with T (C) = 0 contained in C ′ . Let S = {C 1 , C 2 , . . . , C r ′ , C r ′ +1 , . . . , C r } be the set of cliques from G contained in C ′ with C = C 1 . Let S 1 = {C 1 , C 2 , . . . , C r ′ } be the set that contains all cliques C i ∈ S with T (C i ) = T (C 1 ) and S 2 = S \ S 1 . We divide C into two cliques C S 1 and C S 2 and get a new cluster graph G * , where C S 1 contains all vertices in C 1 , C 2 , . . . , C r ′ and C S 2 contains all vertices in C r ′ +1 , C r ′ +2 , . . . , C r . We show that G * is also a solution.
Let E i ∆ be the set of edges between vertices in C S 1 and vertices in C i for each r ′ + 1 ≤ i ≤ r. Let E ∆ = r ′ +1≤i≤r E i ∆ . Then to get G * from G ′ , we need to delete all edges in E ∆ . Now we split edges in E i ∆ into two parts.
Then for the distance upper bound, we have that For the modification budget, we have that Hence, G * is also a solution. We can continue to divide clique C S 2 in G * in the same way such that every sub-clique is standard. Thus, for every non-standard clique in G ′ , we can divide it into several standard cliques and the new cluster graph is still a solution.
Note that for a clique C i in G which has exactly half of its vertices from one clique in G c and the remaining half of its vertices from another clique in G c , no clique in G has the same type as it. Lemma 21 allows us to focus on standard solutions. This allows us to show our next fixed-parameter tractability result. Proof. We apply our generic four-step approach and thus need to provide the details how to implement Steps 1 and 2.
By Observation 4, we can assume that our input graph is a cluster graph. Furthermore, exhaustively apply Reduction Rule 6b to delete too big cliques and denote with G the resulting cluster graph. Let C be the set of all cliques in G and D = {D 1 , D 2 , . . . , D q } be the set of all cliques in G c . We partition G into q + 1 groups G 1 , G 2 , . . . , G q , G q+1 with G i = G[V i ], where V i = {C ∈ C | T (C) = i} for 1 ≤ i ≤ q and V q+1 = {C ∈ C | T (C) = 0}. So G q+1 contains all cliques with value 0 under the function T . According to Lemma 21, if there is a solution, then there is a solution only combining cliques within every group G i for 1 ≤ i ≤ q. This shows that with ℓ = q the requirements of Step 1 of our generic approach are met.
Next we describe Step 2, that is, for every part G i , we show how to compute a set S i corresponding to all "representative" solutions. To this end, we distinguish two cases: G i contains at most d + 1 cliques or at least d + 2 cliques. If G i contains at most d + 1 cliques, then we can brute-force all possibilities to partition the cliques and merge the cliques in each partition. There are less than (d + 1) d+1 possibilities to do so and for each possibility we add to S i a tuple representing the cost and gain of making all cliques in S into a clique.
If G i contains at least d + 2 cliques, then we show that we need to merge all cliques in G i : If not all cliques are merged into one clique, then we have a solution with two parts without any edge between the two parts (each part can be a single clique or a cluster graph). Let p and q be the number of vertices in the two parts that are also in D i . Since there are at least d + 2 cliques, each containing at least one vertex from D i , it follows that p + q ≥ d + 2, p ≥ 1, and q ≥ 1. Thus, at least p · q ≥ d + 1 edges in D i (and thus in G c ) are not in our solution, a contradiction to the fact that the solution needs to have a distance of at most d to G c . Hence, we only need to add one tuple to S i encoding the cost and gain of making G i into one clique. Together with Observation 3 we get the statement of the lemma.
Matching-based distance. We next discuss how to adjust our generic four-step approach for DCCompletion (Matching Dist). The main difference to the edge-based distance variants is an additional search tree of size O(d d+2 ) in the beginning. Each leaf of the search tree then corresponds to a simplified instance where we have additional knowledge on the matching defining the distance of a solution to G c . With this additional knowledge, we can apply our generic four-step approach in each leaf, yielding the following. Proof. We apply our generic four-step approach and thus need to provide the details how to implement Steps 1 and 2.
We can assume that our input graph is a cluster graph. Let C be the set of all cliques in G and D = {D 1 , D 2 , . . . , D q } the set of all cliques in G c . Then we classify all cliques in C into two classes C 1 and C 2 , where every clique in C 1 has the property that all its vertices are contained in one clique in D and every clique in C 2 contains vertices from at least two different cliques in D. Observe that |C 2 | ≤ d as otherwise the input is a no-instance. Similarly, every clique in C 2 contains vertices from at most d + 1 different cliques in D as otherwise the input is a no-instance.
This allows us to do the following branching step. For each clique in C 2 we try out all "meaningful" possibilities to match it to a clique in D, where "meaningful" means that the cliques in C 2 and D should share some vertices or we decide to not match the clique of C 2 to any clique in D. For each clique this gives us d + 2 possibilities and hence we have at most d d+2 different cases each of which defines a mapping M : C 2 → D ∪ {∅} that maps a clique in C 2 to the clique in D it is matched to.
Given the mapping M from cliques in C 2 to cliques D or ∅, we partition G into q + 1 groups G 1 , G 2 , . . . , G q , G q+1 with If there is a solution with a matching that uses the matches given by M , then there is a solution only combining cliques within every group G i , 1 ≤ i ≤ q, since all cliques in G i that are not matched by M are completely contained in D i and hence would not be merged with cliques in G j for some i = j. This shows that with ℓ = q the requirements of Step 1 of our generic approach are met.
Next we describe Step 2, that is, for every part G i , we show how to compute a set S i corresponding to all "representative" solutions. Note that all except for at most d cliques from G i need to be merged into one clique that is then matched with D i , otherwise the matching distance would be too large. For each clique in G i that is not completely contained in D i we already know that it is matched to D i , hence we need to merge all cliques of this kind to one clique C ⋆ i . Each clique in G i that is completely contained in D i and has size at least d + 1 also needs to be merged to C ⋆ i , otherwise the matching distance would be too large. For all cliques of G i that are completely contained in D i with size x for some 1 ≤ x ≤ d we merge all but d cliques to C ⋆ i . This leaves us with one big clique C ⋆ i and d 2 cliques of size at most d each. Now we can brute-force all possibilities to merge some of the remaining cliques to C ⋆ i . There are less than d d possibilities to do so and for each possibility we add to S i a tuple representing the cost and gain of merging the cliques according to the partition. Together with Observation 3 we get the statement of the lemma.

Conclusion
Our work provides a first thorough (parameterized) analysis of Dynamic Cluster Editing, addressing a natural dynamic setting for graph-based data clustering. We deliver both (parameterized) tractability and intractability results. Our positive algorithmic results (fixed-parameter tractability and kernelization) are mainly of classification nature. Hence, to get practically useful algorithms, one needs to further improve our running times, a challenge for future research.
A key difference between Dynamic Cluster Editing and static Cluster Editing is that all six variants of Dynamic Cluster Editing remain NP-hard when the input graph is a cluster graph (see Theorem 1). Moreover, Dynamic Cluster Editing (both matching-and edge-based distance) is W[1]-hard with respect to the budget k (see Theorem 2) whereas Cluster Editing is fixed-parameter tractable with respect to k. An obvious approach to solve Dynamic Cluster Editing is to compute (almost) all cluster graphs achievable with at most k edge modifications, then pick from this set of cluster graphs one at distance at most d to the target cluster graph. However, listing these cluster graphs is computationally expensive. Indeed, our W[1]-hardness results indicate that we might not do much better than using this simple approach.
We mention in passing that our results partly transfer to the "compromise clustering" problem, where, given two input graphs, one wants to find a "compromise" cluster graph that is close enough (in terms of edge-based distance) to both input graphs. It is easy to see that our fixed-parameter tractability results carry over if one of these two input graphs is already a cluster graph. A direction for future research is to exam-ine whether our results can also be adapted to the case where both input graphs are arbitrary. Furthermore, we left open the parameterized complexity of Dynamic Cluster Editing (deletion variant and completion variant) with matching-based distance as well as Dynamic Cluster Editing (completion variant) with edge-based distance when parameterized by the budget k, see Table 1 in Section 1. Moreover, the existence of polynomial-size problem kernels for our fixed-parameter tractable cases for single parameters (budget k or distance d) is open.