Graph Editing to a Fixed Target (cid:63)

. For a ﬁxed graph H , the H - Minor Edit problem takes as input a graph G and an integer k and asks whether G can be modi-ﬁed into H by a total of at most k edge contractions, edge deletions and vertex deletions. Replacing edge contractions by vertex dissolutions yields the H - Topological Minor Edit problem. For each problem we show polynomial-time solvable and NP -complete cases depending on the choice of H . Moreover, when G is AT-free, chordal or planar, we show that H - Minor Edit is polynomial-time solvable for all graphs H .


Introduction
Graph editing problems are well studied both within algorithmic and structural graph theory and beyond (e.g.[1,4,22,23]), as they capture numerous graphtheoretic problems with a variety of applications.A graph editing problem takes as input a graph G and an integer k, and the question is whether G can be modified into a graph that belongs to some prescribed graph class H by using at most k operations of one or more specified types.So far, the most common graph operations that have been considered are vertex deletions, edge deletions and edge additions.Well-known problems obtained in this way are Feedback Vertex Set, Odd Cycle Transversal, Minimum Fill-In, and Cluster Editing.Recently, several papers [9,10,[15][16][17] appeared that consider the setting in which the (only) permitted type of operation is that of an edge contraction.This operation removes the vertices u and v of the edge uv from the graph and replaces them by a new vertex that is made adjacent to precisely those remaining vertices to which u or v was previously adjacent.So far, the situation in which we allow edge contractions together with one or more additional types of graph operations has not been studied.This is the main setting that we consider in our paper.
A natural starting approach is to consider families of graphs H of cardinality 1, that is, we set H = {H} for some graph H, called the target graph from now on, and we assume that H is fixed, that is, H is not part of the input.
For such families, straightforward polynomial-time algorithms exist if the set of permitted operations may only include edge additions, edge deletions and vertex deletions.If vertex deletions are not permitted, then the input graph G must be of the same order as H yielding a constant-time algorithm as H is assumed to be fixed.If vertex deletions are permitted, then we consider possibly every induced subgraph G of G that has the same number of vertices as H (say |V H | = r) and verify whether we can modify G into H by at most k − r edge operations.As H is fixed, such an algorithm takes O(n r ) time (where n denotes the number of vertices of G).However, we show that this approach may no longer be followed in our case, in which we allow both edge contractions and vertex deletions to be applied.
It so happens that setting H = {H} yields graph editing problems that are closely related to problems that ask whether a given graph H appears as a "pattern" within another given graph G so that G can be transformed to H via a sequence of operations without setting a bound k on the number of operations allowed.These 'unbounded' problems are ubiquitous in computer science, and below we shortly survey a number of known results on them; those results that we will use in our proofs are stated as lemmas.
We start with some additional terminology.A vertex dissolution is the removal of a vertex v with exactly two neighbors u and w, which may not be adjacent to each other, followed by the inclusion of the edge uw.If we can obtain a graph H from a graph G by a sequence that on top of vertex deletions and edge deletions may contain operations of one additional type, namely edge contractions or vertex dissolutions, then G contains H as a minor or topological minor, respectively.For a fixed graph H, that is, H is not part of the input, this leads to the decision problems H-Minor and H-Topological Minor, respectively.Grohe, Kawarabayashi, Marx, and Wollan [13] showed that H-Topological Minor can be solved in cubic time for all graphs H, whereas Robertson and Seymour [25] proved the following seminal result.
Lemma 1 ([25]).H-Minor can be solved in cubic time for all graphs H.We say that a containment relation is induced if edge deletions are excluded from the permitted graph operations.In the case of minors and topological minors, this leads to the corresponding notions of being an induced minor and induced topological minor, respectively, with corresponding decision problems H-Induced Minor and H-Induced Topological Minor.In contrast to their non-induced counterparts, the complexity classifications of these two problems have not yet been settled.In fact, the complexity status of H-Induced Minor when H is restricted to be a tree has been open since it was posed at the AMS-IMS-SIAM Joint Summer Research Conference on Graph Minors in 1991.Up until now, only forests on at most seven vertices have been classified [8] (with one forest still outstanding), and no NP-complete cases of forests H are known.The smallest known NP-complete case is the graph H * on 68 vertices displayed in Figure 1; this result is due to Fellows, Kratochvíl, Middendorf and Pfeiffer [7].

Lemma 2 ([7]
). H * -Induced Minor is NP-complete.Lévêque, Lin, Maffray, and Trotignon [20] gave both polynomial-time solvable and NP-complete cases for H-Induced Topological Minor.In particular they showed the following result, where we denote the complete graph on n vertices by K n .
The complexity of H-Induced Topological Minor is still open when H is a complete graph on 4 vertices.Lévêque, Maffray, and Trotignon [21] gave a polynomial-time algorithm for recognizing graphs that neither contain K 4 as an induced topological minor nor a wheel as an induced subgraph.However, they explain that a stronger decomposition theorem (avoiding specific cutsets) is required to resolve the complexity status of K 4 -Induced Topological Minor affirmatively.
Before we present our results, we first introduce some extra terminology.Let G be a graph and H a minor of G. Then a sequence of minor operations that modifies G into H is called an H-minor sequence or just a minor sequence of G if no confusion is possible.The length of an H-minor sequence is the number of its operations.An H-minor sequence is minimum if it has minimum length over all H-minor sequences of G.For a fixed graph H, the H-Minor Edit problem is that of testing whether a given graph G has an H-minor sequence of length at most k for some given integer k.Also, for the other containment relations we define such a sequence and corresponding decision problem.
Because any vertex deletion, vertex dissolution and edge contraction reduces a graph by exactly one vertex, any H-induced minor sequence and any Htopological induced minor sequence of a graph G has the same length for any graph H, namely |V G |−|V H |. Hence, H-Induced Minor Edit and H-Induced Topological Minor Edit are polynomially equivalent to H-Induced Minor and H-Induced Topological Minor, respectively.We therefore do not consider H-Induced Minor Edit and H-Induced Topological Minor Edit, but will focus on the H-Minor Edit and H-Topological Minor Edit problems from now on.For these two problems edge deletions are permitted, and this complicates the situation.For example, let G = K n and H = K 1 .Then a minimum H-minor sequence of G consists of n − 1 vertex deletions, whereas the sequence that consists of n(n − 1)/2 edge deletions followed by n − 1 vertex deletions is an H-minor sequence of G that has length n(n − 1)/2 + n − 1.
Our Results.In Section 2 we pinpoint a close relationship between H-Minor Edit and H-Induced Minor, and also between H-Topological Minor Edit and H-Induced Topological Minor.We use this observation in Section 3.1, where we show both polynomial-time solvable and NP-complete cases for H-Minor Edit and H-Topological Minor Edit; note that the hardness results are in contrast with the aforementioned tractable results for H-Minor [25] and H-Topological Minor [13].There is currently not much hope in settling the complexity of H-Minor Edit and H-Topological Minor Edit for all graphs H, due to their strong connection to H-Induced Minor and H-Induced Topological Minor, the complexity classification of each of which still must be completed.However, in Section 3.2, we are able to show that H-Minor Edit is polynomial-time solvable on AT-free graphs, chordal graphs and planar graphs.In Section 3.3 we discuss parameterized complexity aspects, whereas Section 4 contains our conclusions and directions for further research.

Preliminaries
In this section we state some results from the literature and make some basic observations; we will need these results and observations later on.We only consider undirected finite graphs with no loops and with no multiple edges.We denote the vertex set and edge set of a graph G by V G and E G , respectively.If no confusion is possible, we may omit subscripts.We refer the reader to the textbook of Diestel [5] for any undefined graph terminology.
The disjoint union of two graphs G and H with V G ∩ V H = ∅ is the graph G + H that has vertex set V G ∪ V H and edge set E G ∪ E H .We let P n and C n denote the path and cycle on n vertices, respectively, whereas K 1,n is the star on n + 1 vertices; note that K 1,1 = P 2 and K 1,2 = P 3 .The subgraph of a graph We will frequently make use of the following observation.We write Π 1 ≤ Π 2 , for two decision problems Π 1 and Π 2 , to denote that Π 2 generalizes Π 1 .The following observation shows a close relationship between our two editing problems and the corresponding induced containment problems.Lemma 5. Let H be a graph.Then the following two statements hold: Proof.We start with the proof of (i).Let H be a graph, and let G be an instance of H-Induced Minor.We define k = |V G | − |V H |. We will show that (G, k) is an equivalent instance of H-Minor Edit.If k < 0, then G is a no-instance of H-Induced Minor, and by Lemma 4, (G, k) is a no-instance of H-Minor Edit.Suppose that k ≥ 0. We claim that G contains H as an induced minor if and only if (G, k) has an H-minor sequence of length at most k.
First suppose G contains H as an induced minor.Because one edge contraction or one vertex deletion reduces a graph by exactly one vertex, any H-induced minor sequence of G is an H-minor sequence of G that has length we find that S contains at least k operations that are vertex deletions or edge contractions.Because S has length at most k, this means that S contains no edge deletions.Hence, S is an H-induced minor sequence.We conclude that G contains H as an induced minor.
The proof of (ii) uses the same arguments as the proof of (i); in particular any vertex dissolution in a graph reduces the graph by exactly one vertex.
Two disjoint vertex subsets U and W of a graph G are adjacent if there exists some vertex in U that is adjacent to some vertex in W .The following alternative definition of being a minor is useful.Let G and H be two graphs.An H-witness structure W is a vertex partition of a subgraph G of G into |V H | nonempty sets W (x) called (H-witness) bags, such that (i) each W (x) induces a connected subgraph of G, and (ii) for all x, y ∈ V H with x = y, bags W (x) and W (y) are adjacent in G if x and y are adjacent in H.
An H-witness structure W corresponds to at least one H-minor sequence of G.
In order to see this, we can first delete all vertices of V G \ V G , then modify all bags W (x) into singletons via edge contractions and finally delete all edges uv with u ∈ W (x) and v ∈ W (y) whenever uv / ∈ E H .The remaining graph is isomorphic to H. Similarly, we can obtain an H-witness structure from any H-minor sequence S of G, namely by putting two vertices u and v in the same bag if and only if uv is an edge in G that is contracted by S. We note that G may have more than one H-witness structure.
An edge subdivision is the operation that removes an edge uv of a graph and adds a new vertex w adjacent (only) to u and v.This leads to an alternative definition of being a topological minor, namely that a graph G contains a graph H as a topological minor if and only if G contains a subgraph H that is a subdivision of H; that is, H can be obtained from H by a sequence of edge subdivisions.A subdivided star is a graph obtained from a star after p edge subdivisions for some p ≥ 0.
Let G be a graph that contains a graph H as a minor.An H-minor sequence S of G is called nice if S starts with all its vertex deletions, followed by all its edge contractions and finally by all its edge deletions.It is called semi-nice if S starts with all its vertex deletions, followed by all its edge deletions and finally by all its edge contractions.By replacing edge contractions with vertex dissolutions, we obtain the notions of a nice and a semi-nice topological minor sequence.Lemma 6.Let H be a graph and k an integer.If a graph G has an H-minor sequence of length k, then G has a nice H-minor sequence of length at most k.
Proof.Let H be a graph.Let S be an H-minor sequence of a graph G that has length k.Suppose that S contains the deletion of a vertex u that appears after the contraction or deletion of an edge e.We may assume without loss of generality that the deletion of u appears immediately after the operation on e.First suppose that this operation deletes e.Then deleting u before deleting e results in a new H-minor sequence of G that either has the same length as S, or a smaller length in the case that e was incident with u.Now suppose that this operation contracts e.Let e = vw, and let z be the new vertex that is obtained as a result of contracting e.If u = z, then we delete v and w instead of contracting e and deleting u.If u = z, then we delete u before contracting e.Both cases result in a new H-minor sequence of G that has the same length as S. Hence, repeatedly applying the above procedure yields an H-minor sequence S * of length at most k, in which every vertex deletion appears before any edge contraction and before any edge deletion.
Let U be the set of vertices that are removed from G by vertex deletions in S * .Then we can partition the vertex set of G[V G \ U ] into bags corresponding to the H-witness structure W of G that we obtain from S. Let p be the number of pairs of adjacent bags that correspond to pairs of non-adjacent vertices in H. Let q be the number of edge deletions in S. Due to our choice of W, we have q ≥ p.We now let all edge contractions of S take place before any of its edge deletions.This reduces each bag of W to a singleton.Afterward we must remove exactly p edges to obtain H. Hence, we have changed S * into an H-minor sequence of G that is nice, and moreover, that has length at most k, as q ≥ p and S * has length at most k.
We note that a lemma for topological minors similar to Lemma 6 does not hold.For example, build G as follows: take two disjoint copies of K n , where n ≥ 5; subdivide an edge in each copy, to introduce new vertices u and v; and join the two new vertices u and v. Build H as two disjoint copies of K n .If we delete the edge (u, v) of G and next perform two vertex dissolutions (of u and v) then we obtain an H-topological minor sequence of length 3 for G.It is not difficult to see that there is no nice H-topological minor sequence for G of length at most 3.However, for topological minor sequences the following holds.
Lemma 7. Let H be a graph and k an integer.If a graph G has an H-topological minor sequence of length k, then G has a semi-nice H-topological minor sequence S of length at most k, such that the vertices not deleted by the vertex deletions of S induce a subgraph that contains a subdivision of H as a spanning subgraph.
Proof.Let H be a graph.Let S be an H-topological minor sequence of a graph G that has length k.We may assume without loss of generality that the number of vertex deletions in S is maximum over all H-topological minor sequences of G that have length at most k.Let U be the set of vertices that are removed from G by vertex deletions in S. By using exactly the same arguments as in the proof of Lemma 6, we may assume without loss of generality that S starts with these |U | vertex deletions.
Suppose that an edge e is deleted by an edge deletion in S after a dissolution of a vertex v.Because all vertex deletions in S appear before its edge deletions and vertex dissolutions, we may assume without loss of generality that the deletion of e appears immediately after the dissolution of v. Let u and w be the neighbors of v just before v is dissolved; note that dissolving v leads to an edge uw.Suppose that e = uw.Then instead of dissolving v and deleting e, we remove v contradicting the maximality of the number of vertex deletions of S. This means that e = uw.Then, swapping the dissolution of v with the deletion of e in S leads to another H-topological minor sequence of length at most k.Hence, after repeatedly doing this, we obtain a semi-nice topological minor sequence S of G that has length at most k and that also has maximum number of vertex deletions over all H-topological minor sequences of G that have length at most k.
Because S contains no more vertex deletions after the vertices of U are deleted, G[V \ U ] contains a subgraph H that is a subdivision of H.By maximality of the number of vertex deletions of S, and hence of S , we deduce that We note that a lemma for minors similar to Lemma 7 does not hold.The following example, which we will use later on as well, illustrates this.
Example 1.Let H = C 6 .We take a cycle C r for some integer r ≥ 7. Let u be one of its vertices.Add an edge between u and every (non-adjacent) vertex of the cycle except the two vertices at distance two from u.This yields the graph G. Then (G, r − 5) is a yes-instance of H-Minor Edit (via a sequence of r − 6 edge contractions followed by an edge deletion).It is not difficult to see that every H-minor sequence of length r − 5 of G must start with r − 6 edge contractions followed by one edge deletion.
Let K k, be the complete bipartite graph with partition classes of size k and .Fellows et al. [7] showed that for all graphs H, H-Induced Minor is polynomialtime solvable on planar graphs, that is, graphs that contain neither K 3,3 nor K 5 as a minor.This result has been extended by van 't Hof et al. [18] to any minorclosed graph class that is nontrivial, i.e., that does not contain all graphs.Lemma 8 ( [18]).Let G be any nontrivial minor-closed graph class.Then, for all graphs H, the H-Induced Minor problem can be solved in linear time on G.
An asteroidal triple in a graph is a set of three mutually non-adjacent vertices such that each two of them are joined by a path that avoids the neighborhood of the third, and AT-free graphs are exactly those graphs that contain no such triple.A graph is chordal if it contains no induced cycle on four or more vertices.We will also need the following two results.Lemma 9 ([11]).For all graphs H, the H-Induced Minor problem can be solved in polynomial time on AT-free graphs.

Lemma 10 ([2]
).For all graphs H, the H-Induced Minor problem can be solved in polynomial time on chordal graphs.

Complexity Results
In Section 3.1 we consider general input graphs G, whereas in Section 3.2 we consider special classes of input graphs.In Section 3.3 we discuss parameterized complexity aspects.

General Input Graphs
We first show that the computational complexities of H-Minor Edit and H-Topological Minor Edit may differ from those of H-Minor and H-Topological Minor, respectively.

Theorem 1. The following two statements hold:
(i) There is a graph H for which H-Minor Edit is NP-complete.(ii) There is a graph H for which H-Topological Minor Edit is NP-complete.
Proof.For (i) we take the graph H * displayed in Figure 1.Then the claim follows from Lemma 2 combined with Lemma 5-(i).For (ii) we take H = K 5 .Then the claim follows from Lemma 3 combined with Lemma 5-(ii).
The remainder of Section 3.1 is devoted to results for some special classes of target graphs H.We start by considering the case when H is a complete graph; note that Theorem 2-(ii) generalizes Theorem 1-(ii).
Theorem 2. The following two statements hold: (i) K r -Minor Edit can be solved in cubic time for all r ≥ 1.
(ii) K r -Topological Minor Edit can be solved in polynomial time, if r ≤ 3, and is NP-complete, if r ≥ 5.
Proof.We first prove (i).Let (G, k) be an instance of K r -Minor Edit.
Because we may remove without loss of generality any edge deletions from a K r -minor sequence of a graph, we find that (G, k) is a yes-instance of K r -Minor Edit if and only if G contains K r as a minor.Hence, the result follows after applying Lemma 1.
We now prove (ii).The cases H = K 1 and H = K 2 are trivial.The case H = K 3 = C 3 follows from Theorem 5, which we will prove later.The case H = K 5 follows from the proof of Theorem 1-(ii).
Let r ≥ 6 and assume that K r−1 -Topological Minor Edit is NP-complete.Let (G, k) be an instance of K r−1 -Topological Minor Edit.Let V G = {u 1 , . . ., u n } for some integer n.From G we construct a graph G as follows.First we add a new vertex v that we make adjacent to all vertices of G.We then subdivide each of the new edges incident with v exactly once.We denote the new vertices created in this way by w 1 , . . ., w n and say that they are of w-type.
First suppose that (G, k) is a yes-instance of K r−1 -Topological Minor Edit.Let S be a K r−1 -topological minor sequence of G that has length at most k.We modify S as follows in order to obtain a K r -topological minor sequence of G that has length at most k + n.Let u i be a vertex in G that is removed from G either by a vertex deletion or by a vertex dissolution in S. Before we apply this operation we first delete w i .After we have done this for any vertex of G removed by S, we extend S by dissolutions of the remaining vertices of w-type.This yields the desired K r -topological minor sequence of G .Now suppose that (G , k + n) is a yes-instance of K r -Topological Minor Edit.Then G has a K r -topological minor sequence S of length at most k + n.Because r ≥ 6 and each vertex of w-type has degree 2 in G , we find that S either dissolves it or deletes it.We modify S as follows in order to obtain a K r−1 -topological minor sequence of G that has length at most k.
First suppose that S neither dissolves nor deletes v. Then we remove all n operations from S that remove the vertices of w-type via a dissolution or a deletion and apply this sequence (that has length at most k) on G.This gives us the desired K r−1 -topological minor sequence of G. Now suppose that S deletes v. Then we may assume without loss of generality that the vertices of w-type are deleted by S as well.We remove all n+1 operations from S that delete the vertices of w-type and v and apply this sequence (that has length at most k − 1) on G. Afterward we delete one of the r vertices of G that were neither deleted nor dissolved by S to obtain the desired K r−1 -topological minor sequence of G.
Finally, suppose that S dissolves v. Then we may assume without loss of generality that exactly n − 2 vertices of w-type are deleted by S, whereas two distinct vertices w i and w j are dissolved (if not then we could replace the dissolution of v by the deletion of v in S).Moreover, it can be assumed that the dissolutions of w i , w j and v are the last three operations in S. Let xy be the edge obtained by these operations.We remove all n + 1 operations from S that dissolve v, w i , w j and delete vertices of w-type (not equal to w i or w j ).We apply the resulting sequence (that has length at most k − 1) on G and afterward delete x.In this way we obtain a K r−1 -topological minor sequence of G that has length at most k.
We now consider H-Minor Edit for the case in which H is a path or a star.Theorem 3. P r -Minor Edit and K 1,r -Minor Edit can both be solved in polynomial time for all r ≥ 1.
Proof.First, let H = P r for some r ≥ 1.If r ≤ 2, we use Theorem 2-(i).Hence, we may assume that r ≥ 3. Let (G, k) be an-instance of P r -Minor Edit with |V G | − r = k .We run the algorithm described below.
If k < 0 or k > k, then we return no.Otherwise, that is, if 0 ≤ k ≤ k, we proceed as follows.We consider each induced subgraph G of G that has at most (r − 1)r vertices and solve the problem If we find that the latter instance is a yes-instance, then we return yes.Otherwise, after considering each such subgraph G , we return no.
The running time of the algorithm is polynomial due to the following reasons.Let |V G | = n.Then there are at most n (r−1)r possible choices of induced subgraphs G on at most (r − 1)r vertices.This is a polynomial number, because of our assumption that r is fixed.By the same assumption, every such subgraph G has constant size, and hence can be processed in polynomial time.We conclude that the total running time is polynomial.
We now prove the correctness of our algorithm.If k < 0 or k > k, then (G, k) is a no-instance of P r -Minor Edit due to Lemma 4. Suppose that 0 ≤ k ≤ k.We claim that our algorithm returns yes if and only if G has a P r -minor sequence of length at most k.Now suppose that G has a P r -minor sequence S of length at most k.By Lemma 6, we may assume without loss of generality that S is a nice P r -minor sequence of G that has minimum length over all (not necessarily nice) P r -minor sequences of G.We also assume without loss of generality that the number of vertex deletions in S is maximum over all nice P r -minor sequences of G of minimum length.Let U be the set of vertices that are deleted by the vertex deletions in S. Then the remaining set of vertices V G \ U induces a subgraph G that contains P r as a minor as well.
Let W be a P r -witness structure of G .Let W (x) be a witness bag in W. We claim that W (x) induces a path P x in G. Let u be a vertex in W (x) with a neighbor in another witness bag W (x ).If x has no other neighbor, then G[W (x)] is a path P x consisting of the single vertex u, by maximality of the number of vertex deletions of S. Suppose x has a neighbor x = x .Then W (x) contains a vertex v that has a neighbor in W (x ) (note that u = v is possible).As G[W (x)] is connected, we can take a shortest path P x between u and v in G[W (x)].By maximality of the number of vertex deletions of S, we find that V Px = W x .
Suppose that P x has at least r vertices.Then G contains a path P r as an induced subgraph.This would mean that G has a P r -minor sequence S of minimum length that only consists of vertex deletions.Because S contains no other operations, S is nice.Because W (x) contains at least r ≥ 3 vertices, S contains at least two edge contractions.Hence, S contains at least two more vertex deletions than S.This is a contradiction.We conclude that every W (x) contains at most r − 1 vertices.This means that G has at most (r − 1)r vertices.Hence, our algorithm will consider G at some point and detect that ( is a yes-instance of P r -Minor Edit.Consequently, it will return yes.Now let H = K 1,r with center vertex y.If r ≤ 2, then H is a path and we can use the proof above.Hence, we may assume that r ≥ 3. Let (G, k) be an instance of K 1,r -Minor Edit with |V G | − (r + 1) = k .We run the algorithm below.
If k < 0 or k > k, then we return no.Otherwise, that is, if 0 ≤ k ≤ k, we proceed as follows.We consider each subset W of If so, then we return yes.Otherwise, after considering each such subset W , we return no.
The running time of the algorithm is polynomial by the same arguments as before.Hence, we are left with proving the correctness of our algorithm.If k < 0 or k > k, then (G, k) is a no-instance of H-Minor Edit due to Lemma 4. Suppose that 0 ≤ k ≤ k.We claim that our algorithm returns yes if and only if G has an H-minor sequence of length at most k.
First suppose that our algorithm returns yes.Then G contains H as a minor and our algorithm has obtained H by at most k − k edge deletions, whereas the total number of edge contractions and vertex deletions is k .Hence, G has an H-minor sequence of length at most k − k + k = k.Now suppose that G has an K 1,r -minor sequence S of length at most k.By Lemma 6, we may assume without loss of generality that S is a nice K 1,r -minor sequence of G that has minimum length over all (not necessarily nice) K 1,r -minor sequences of G.We also assume without loss of generality that the number of vertex deletions in S is maximum over all nice K 1,r -minor sequences of G of minimum length.Let U be the set of vertices that are deleted by the vertex deletions in S. Then G[V G \ U ] contains K 1,r as a minor as well.
Let W be a K 1,r -witness structure of G[V G \ U ]. Recall that y denotes the center vertex of H = K 1,r .By maximality of the number of vertex deletions of S, we find that |W (x)| = 1 for all x ∈ V H \ {y}.This means that the union of these bags W (x), which we denote by W , has size |W | = |V H | − 1.Consequently, our algorithm will consider W at some point.Because S is an K 1,r -minor sequence, the number of edge deletions of S is at most k − k .This number include all deletions of edges between vertices in W . Hence, |E W | ≤ k − k , and our algorithm will proceed by considering the connected components of Moreover, every W (x) with x = y is adjacent to W (y).This means that every vertex in W has a neighbor in D. Consequently, our algorithm will return yes.This completes the proof of Theorem 3.
For topological minors we can show a stronger result than Theorem 3. Theorem 4. Let H be a subdivided star.Then H-Topological Minor Edit is polynomial-time solvable.
Proof.Let H be a subdivided star.Let (G, k) be an-instance of H-Topological Minor Edit with |V G | − |V H | = k .We run the algorithm described below.
If k < 0 or k > k, then we return no.Otherwise, that is, if 0 ≤ k ≤ k, we proceed as follows.We consider each subset U of |V H | vertices of G.We check if G[U ] contains an H-topological minor sequence of length at most k − k (note that such a sequence only involves edge deletions).If so, then we return yes.Otherwise, after considering all such subsets U , we return no.
We now analyze the running time.Let |V G | = n.Then there are at most n |V H | possible choices of induced subgraphs G on |V H | vertices.This is a polynomial number, because of our assumption that H is fixed.By the same assumption, every such subgraph G has constant size, and hence can be processed in polynomial time.We conclude that the total running time is polynomial.
We now prove the correctness of our algorithm.If k < 0 or k > k, then (G, k) is a no-instance of H-Topological Minor Edit due to Lemma 4. Suppose that 0 ≤ k ≤ k.We claim that our algorithm returns yes if and only if G has an H-topological minor sequence of length at most k.
First suppose that our algorithm returns yes.Then G contains H as a topological minor and our algorithm has obtained H from a graph G[U ] on |V H | vertices by at most k − k operations (which are all edge deletions), whereas the total number of vertex deletions is Now suppose that G has an H-topological minor sequence S of length at most k.By Lemma 7, we may assume without loss of generality that S is a semi-nice H-topological minor sequence S of length at most k, such that the vertices not deleted by the vertex deletions of S induce a subgraph G that contains a subdivision H of H as a spanning subgraph.We also assume without loss of generality that the number of vertex deletions in S is maximum over all such H-topological minor sequences of G.Then, because H is a subdivided star, H must be isomorphic to H (to see this, note that after all vertex deletions of S, we must have a subdivided star, together with possibly some additional edges, and that any subsequent vertex dissolutions can be replaced with vertex deletions so contradicting the maximality of the number of vertex deletions in S).Because H H is a spanning subgraph of G , our algorithm will consider G at some point.Because the remaining operations in S are at most k − k edge deletions, they form an H-topological minor sequence of G that has length at most k − k .This will be detected by our algorithm, which will then return yes.This completes the proof of Theorem 4.
Note that Theorem 3 can be generalized to be valid for target graphs H that are linear forests (disjoint unions of paths) and Theorem 4 to be valid for target graphs H that are forests, all connected components of which are subdivided stars.
We now consider the case when the target graph H is a cycle and show the following result, which holds for topological minors only.
Theorem 5. C r -Topological Minor Edit can be solved in polynomial time for all r ≥ 3.
Proof.Let r ≥ 3. Let (G, k) be an instance of C r -Topological Minor Edit.We run the following algorithm.Let k = |V G | − r.If k < 0 or k > k, then we return no.Otherwise, we do as follows.We check if G contains C r as an induced topological minor.If so, then we return yes.If not, then we do as follows for each induced subgraph If so, then we return yes.Otherwise, after having considered all induced subgraphs G of G on at most 2r vertices, we return no.
We first analyze the running time of this algorithm.Checking whether G contains C r as an induced topological minor is equivalent to checking whether G contains an induced cycle of length at least r; the latter can be done in polynomial time.Suppose G does not contain C r as an induced topological minor.Then the algorithm considers at most |V G | 2r induced subgraphs of G, which is a polynomial number because r is fixed.For the same reason, our algorithm can process every such subgraph G in constant time.
We are left to prove correctness.If k < 0 or k > k, then (G, k) is a noinstance of C r -Topological Minor Edit due to Lemma 4. Suppose that 0 ≤ k ≤ k.We claim that our algorithm returns yes if and only if G has a C rtopological minor sequence of length at most k.Now suppose that G has a C r -topological minor sequence of length at most k.By Lemma 7, we may assume without loss of generality that S is a semi-nice H-topological minor sequence S of length at most k, such that the vertices not deleted by the vertex deletions of S induce a subgraph G that contains a subdivision H of C r as a spanning subgraph; note that H = C s for some s ≥ r.We also assume without loss of generality that the number of vertex deletions in S is maximum over all such H-topological minor sequences of G, and moreover, that C r is obtained from G by first deleting all chords and then by dissolving s − r vertices.
If G has at most 2r vertices, then the algorithm would consider G at some point.Because S is a C r -topological minor sequence of length at most k, we find that G has a C r -topological minor sequence of length at most k − (|V G | − |V G |). Hence, our algorithm would detect this and return yes.Now suppose that G has at least 2r + 1 vertices.Suppose that C s has at least one chord e.Because s = |V G | ≥ 2r + 1, this means that G contains a smaller cycle C t on t ≥ r vertices that has exactly t − 1 edges in common with C s .We modify S as follows.We first remove all vertices of G not on C t .Then we remove all chords of C t .Finally, we perform t − r vertex dissolutions on C t in order to obtain a graph isomorphic to C r .Hence, the sequence S obtained in this way is a C r -topological minor sequence of G as well.By our construction, S is semi-nice.Moreover, because C s and C t have t − 1 edges in common, any edge deletion in S is an edge deletion in S as well.Hence S has length at most k.However, S contains at least one more vertex deletion than S, because there exists at least one vertex in G that is not on C t .This contradicts the maximality of the number of vertex deletions in S. Hence, C s has no chords.Then C s is an induced cycle on at least s ≥ r vertices in G , and consequently, in G.This means that G contains C r as an induced topological minor.The algorithm checks this and thus returns yes.

Input Graphs Restricted to Some Nontrivial Graph Class
Instead of restricting the target graph H to belong to some special graph class, as is done in Section 3.1, we can also restrict the input graph G to some special graph class.In this section we do this for the H-Minor Edit problem.
For the H-Minor Edit problem, we may use the following lemma that strengthens the relationship between H-Minor Edit and H-Induced Minor.If k * < 0 or k * > k, then we return no.Suppose 0 ≤ k * ≤ k.Then, for every spanning supergraph H of H with at most k −k * additional edges, we check if G contains H as an induced minor.As soon as we find that this is the case for some H we return yes.Otherwise, after having considered all spanning supergraphs of H, we return no.
The running time of the above algorithm is polynomial for the following two reasons.First, because H is fixed, the number of spanning supergraphs H of H is a constant.Second, by our assumption, we can solve H -Induced Minor in polynomial time on G for each spanning supergraph H of H.
We now prove that our algorithm is correct.If k * < 0 or k * > k then (G, k) is a no-instance of H-Minor Edit due to Lemma 4. From now on we assume that 0 ≤ k * ≤ k.We claim that our algorithm returns yes if and only if G has an H-minor sequence of length at most k.
First suppose that our algorithm returns yes.Then there exists a spanning supergraph H of H with at most k − k * additional edges, such that H is an induced minor of G. Let S be an H -induced minor sequence of G. Now suppose that G has an H-minor sequence S of length at most k.By Lemma 6, we may assume without loss of generality that S is nice, thus all edge deletions in S take place after all its edge contractions and vertex deletions.Let S be the prefix of S obtained by omitting the edge deletions of S. Then S is an H -induced minor sequence of G for some spanning supergraph H of H.Because every operation in S is a vertex deletion or edge contraction, S has length Because S has length at most k, this means that H can have at most k − k * more edges than H. Hence, as our algorithm considers all spanning supergraphs of H with at most k−k * additional edges, it will return yes, as desired.This completes the proof of Lemma 11.
Combining Lemmas 8-10 with Lemma 11 yields the following result.Theorem 6.For all graphs H, the H-Minor Edit problem is polynomial-time solvable on (i) the class of AT-free graphs, (ii) the class of chordal graphs, (iii) any nontrivial minor-closed class of graphs.

Parameterized Complexity
A parameterized problem is fixed-parameter tractable if an instance (I, p) (where I is the input and p is the parameter) can be solved in time f (p) • |I| O(1) for some function f that only depends on p. Here, a natural parameter is the number of permitted operations k.The following proposition follows immediately from Lemma 4.
Proposition 1.For all graphs H, the H-Minor Edit and H-Topological Minor Edit problems are fixed-parameter tractable when parameterized by k.
Proof.Lemma 4 tells that the graph G of any yes-instance (G, k) of H-Minor Edit and H-Topological Minor Edit can have at most |V H | + k vertices.Hence, we can use brute force to solve these two problems in fpt time.
We now take |V H | as the parameter.Theorem 2 shows that in that case H-Minor Edit and H-Topological Minor Edit are fixed-parameter tractable and para-NP-complete, respectively, when H is a complete graph (a problem is para-NP-complete when it is NP-complete for some fixed value of the parameter).The running times of the algorithms given by Theorems 3-5 are bounded by O(n |V H | ), where H is a path, subdivided star or cycle, respectively.A natural question would be if we can show fixed-parameter tractability with parameter |V H | for these cases.However, the following result shows that this is unlikely (the class W [1] is regarded as the parameterized analog to NP).Proposition 2. For H ∈ {C r , P r , K 1,r }, the problems H-Minor Edit and H-Topological Minor Edit are W[1]-hard when parameterized by r.
Proof.Let H = P r .Papadimitriou and Yannakakis [24] proved that the problem of testing whether a graph contains P r as an induced subgraph is W[1]-hard when parameterized by r (their proof was not done in terms of parameterized complexity theory and was later rediscovered by Haas and Hoffmann [14]).We observe that a graph G contains P r as an induced subgraph if and only if G contains a P r -(topological) minor sequence of length at most |V G | − r.Hence, P r -Minor Edit and P r -Topological Minor Edit are W[1]-hard when parameterized by r.
Let H = C r .It is known that the problem of testing whether a graph contains C r as an induced subgraph is W[1]-hard when parameterized by r [14,24].The corresponding hardness proofs in [14,24] immediately imply that the problem of testing whether a graph G contains a cycle C s with s ≥ r as an induced subgraph is W[1]-hard as well, when parameterized by r.We observe that a graph G contains a cycle C s with s ≥ r as an induced subgraph if and only if G contains a C r -(topological) minor sequence of length at most |V G | − r.Hence, C r -Minor Edit and C r -Topological Minor Edit are W[1]-hard when parameterized by r.
Let H = K 1,r .It is known that the problem of testing whether a graph has an independent set of size at least r is W[1]-complete when parameterized by r (see [6]).We use this result as follows.
First we consider the K 1,r -Minor Edit problem.Let G be the graph obtained from a graph G by adding a new vertex v that is made adjacent to all the vertices of G.We first claim that G has an independent set of size r ≥ 2 if and only if K 1,r is an induced minor of G .Suppose that G has an independent set I of size r in G.In G we delete all vertices of I.The presence of v ensures that the resulting graph G is connected.We contract the edges of one of the spanning trees of G .Because v is adjacent to all vertices of I in G , applying these edge contractions in G yields the graph K 1,r .Hence, G contains K 1,r as an induced minor.To prove the reverse implication, suppose that G contains K 1,r as an induced minor.Let W be a K 1,r -witness structure of G .Let W (x 1 ), . . ., W (x r ) be the bags that correspond to the leaves of K 1,r .We choose an arbitrary vertex u i ∈ W (x i ) for i = 1, . . ., r.Because K 1,r is an induced minor of G , any two bags W (x i ) and W (x j ) are not adjacent in G. Hence, the set U = {u 1 , . . ., u r } is an independent set, and because r ≥ 2, we have that v / ∈ U .Thus, U ⊆ V G ; that is, U is an independent set of G.It remains to observe that G contains K 1,r as an induced minor if and only if G has a K 1,r -minor sequence of length at most |V G | − r − 1.
We now consider the problem K 1,r -Topological Minor Edit.Let G be a graph obtained from a graph G by adding a new vertex that is made adjacent to all the vertices of G. Then G has an independent set of size r if and only if G contains K 1,r as an induced subgraph if and only if G contains K 1,r as an induced topological minor if and only if G has a K 1,r -topological minor sequence of length at most |V G | − r − 1.Hence, K 1,r -Topological Minor Edit is W[1]hard when parameterized by r.

Conclusions
The ultimate goal is to complete our partial complexity classifications of H-Minor Edit and H-Topological Minor Edit.This includes addressing the following three research questions.
1. Is H-Minor Edit polynomial-time solvable for all subdivided stars H? 2. Is C r -Minor Edit polynomial-time solvable for all r ≥ 3? 3. Is K 4 -Topological Minor Edit polynomial-time solvable?
Answering Question 1 in the affirmative would generalize Theorem 3, in which target graphs H that are paths or stars are considered.Note that generalizing Theorem 3 to all trees H may be very challenging, because a positive result would solve the aforementioned open problem on H-Induced Minor restricted to trees H, due to Lemma 5-i.The same holds for Question 3: a positive answer to Question 3 would imply membership in P for K 4 -Induced Topological Minor, the complexity status of which is a notorious open case (see e.g.[21]).As regards Question 2, Example 1 shows that we cannot guess a bounded set of vertices and consider the subgraph that these vertices induce instead of the whole input graph, as was done for C r -Topological Minor Edit.Hence, new techniques are needed.So far, we only know that the statement is true if r ≤ 4. Otherwise, we do as follows.We check if G contains C 4 as an induced minor.If so then we return yes.Note that this is equivalent to checking if G contains an induced cycle on at least four vertices, which can be done in polynomial time.If not then G is chordal, and we apply Theorem 6-(ii).
Another question is whether we can prove an analog of Theorem 6 for H-Topological Minor Edit.It is known that for all graphs H, the H-Induced Topological Minor problem is polynomial-time solvable for ATfree graphs [12], chordal graphs [2] and planar graphs [19].However, as noted in Section 2, we cannot always guarantee the existence of a nice topological minor sequence of sufficiently small length.Hence, our proof technique used to prove Theorem 6 can no longer be applied.
Finally, we can consider other graph containment relations as well.An edge lift removes two edges uv and vw that share a common vertex v and adds an edge between the other two vertices u and w involved (should this edge not exist already).A graph G contains a graph H as an immersion if G can be modified into H by a sequence of operations consisting of vertex deletions, edge deletions and edge lifts.If edge deletions are not allowed then G contains H as an induced immersion.It is known that the corresponding decision problems H-Immersion [13] and H-Induced Immersion [3] are polynomial-time solvable for all fixed graphs H (the first problem can even be solved in cubic time [13]).What is the computational complexity of H-Immersion Edit and H-Induced Immersion Edit?The main difficulty is that for both problems, we can swap neither edge lifts with vertex deletions nor edge deletions with vertex deletions.

Lemma
First suppose that our algorithm returns yes.Then G contains an induced subgraph G on at most (r − 1)r vertices, such that (G , k − (|V G | − |V G |)) is a yes-instance of P r -Minor Edit.Hence, G has a P r -minor sequence S of length at most k − (|V G | − |V G |).We add the |V G | − |V G | vertex deletions that we used to modify G into G .This results in a P r -minor sequence of G that has length k.
First suppose that our algorithm returns yes.If G contains C r as an induced topological minor, then G has a C r -topological minor sequence of length at most k ≤ k.Otherwise, G contains an induced subgraph G of at most 2r vertices that has a C r -topological minor sequence of length at most k − (|V G | − |V G |). Adding the |V G | − |V G | vertex deletions that yielded G to this sequence gives us a C r -topological minor sequence of G that has length at most k.

Lemma 11 .
Let G be a graph class and H a graph.If H -Induced Minor is polynomial-time solvable on G for each spanning supergraph H of H, then H-Minor Edit is polynomial-time solvable on G. Proof.Let G be a graph class and H a graph.Suppose that H -Induced Minor is polynomial-time solvable on G for each spanning supergraph H of H. Let G ∈ G and k ∈ Z form an instance of H-Minor Edit.Let k * = |V G | − |V H |.
Then S has length exactly |V G |−|V H | = |V G |−|V H | = k * .We extend S by deleting the edges in E H \ E H .This yields an H-minor sequence S of G.As |E H \ E H | ≤ k − k * , we find that S has length at most k * + k − k * = k.Hence, (G, k) is a yes-instance of H-Minor Edit.

Proposition 3 .
C r -Minor Edit is polynomial-time solvable if r ≤ 4.Proof.If r = 3 then H = C 3 = K 3 and we apply Theorem 2-(i).Let r = 4, and let (G, k) be an instance of C 4 -Minor Edit.We run the following algorithm.Let k = |V G | − r.If k < 0 or k > k, then we return no due to Lemma 4.
4. If (G, k) is a yes-instance of H-Minor Edit or H-Topological Minor Edit, for some graph H, then |V H | ≤ |V G | ≤ |V H | + k. |V H | ≤ |V G |. Second, any H-minor sequence of G has length at least |V G | − |V H |. Hence, |V G | − |V H | ≤ k, or equivalently, |V G | ≤ |V H | + k.