Exact Algorithms for Edge Deletion to Cactus

We study two related problems on simple, un-directed graphs: Edge Deletion to Cactus and Spanning Tree to Cactus. Edge Deletion to Cactus has been known to be NP-hard on general graphs at least since 1988. We show improved exact algorithms for the fo…

Authors: Sheikh Shakil Akhtar, Geevarghese Philip

Exact Algorithms for Edge Deletion to Cactus Sheikh Shakil Akh tar and Geev arghese Philip Chennai Mathematical Institute, Chennai, India Abstract. W e study tw o related problems on simple, undirected graphs: Edge Deletion to Cactus and Sp anning Tree to Cactus . Edge Deletion to Cactus has been known to be NP-hard on general graphs at least since 1988. In their recent work where they show ed— inter alia —that Edge Deletion to Cactus is NP-hard ev en when restricted to bipartite graphs, Ko c h et al. (Disc. Appl. Math., 2024) p osed the complexit y of Sp anning Tree to Cactus as an op en problem. Our first main result is that Sp anning Tree to Cactus can b e solved in p olynomial time. W e use the p olynomial-time algorithm for Sp anning Tree to Cactus as a black b ox to obtain an exact algorithm that solves Edge Deletion to Cactus in O ⋆ ( n n − 2 ) time, where n is the n umber of vertices in the input graph and the O ⋆ () notation hides p olynomial factors. This is a significant improv ement o v er the brute-force algorithm for Edge Deletion to Cactus that enumerates all subsets of the edge set. W e further improv e the running time for Edge Deletion to Cactus to O ⋆ (3 n ) using dynamic programming; this is our second main result. T o the b est of our kno wledge, this is the fastest known exact-exp onential algorithm for Edge Deletion to Cactus . 1 In tro duction A c actus gr aph is a connected graph in which ev ery edge b elongs to at most one cycle. Equiv alently , any tw o simple cycles in a cactus share at most one vertex. Another equiv alent characterization is that ev ery blo ck (biconnected comp onent) of the graph is either a single edge or a simple cycle. This characterization implies that cactus graphs can b e recognized in p olynomial time using a blo ck decomp osition algorithm, suc h as the classical linear-time algorithm for computing biconnected comp onents by Hop croft and T arjan [ 9 ]. Cactus graphs form a natural generalisation of trees and arise in several areas of graph theory , netw ork design, and algorithmic graph mo dification problems [8,3]. In this pap er, we study tw o closely related edge mo dification problems whose ob jectiv e is to transform a giv en connected graph into a cactus by deleting or selecting edges. Sp anning Tree To Cactus Input: A simple, undirected connected graph G = ( V , E ) and a spanning tree T of G . Question: Find the maximum size of a set F ⊆ E \ E ( T ) such that H = ( V , E ( T ) ∪ F ) is a spanning cactus subgraph of G . Edge Deletion To Cactus Input: A simple, undirected connected graph G = ( V , E ). Question: Find the size of a minimum sized set F ⊆ E suc h that H = ( V , E \ F ) is a connected cactus subgraph of G . The second problem, Edge Deletion to Ca ctus , b elongs to the broad class of graph mo dification problems, in which the goal is to transform a given graph into a graph b elonging to a sp ecified class using a minimum num b er of edits. Such problems hav e b een extensively studied for graph classes including forests, interv al graphs, chordal graphs, and planar graphs. A closely related problem is Ver tex Deletion to Cactus , which asks for a minimum-sized set of vertices whose remov al transforms the input graph into a cactus. Several results in this direction are kno wn [13,2,11,1]. The computational complexity of Edge Deletion to Cactus was first in v estigated b y El-Mallah and Coulb orn [ 5 ], who prov ed that the problem is NP-complete for general graphs. More recently , Ko ch et al. [ 10 ] strengthened this result by showing that the problem remains NP-complete even when restricted to bipartite graphs. In the same w ork, the authors explicitly p osed the complexity of the first problem, Sp anning Tree to Cactus , as an op e n question. T o the b est of our knowledge, no p olynomial-time algorithm was previously kno wn for Sp anning Tree to Cactus , and no exact exponential-time algorithm w as known for Edge Deletion to Cactus with a running time substantially b etter than brute-force enumeration o v er all subsets of edges. Our c ontributions. W e resolve b oth problems algorithmically . First, w e design a polynomial-time algorithm for Sp anning Tree to Cactus . Theorem 1. Ther e exists a p olynomial-time algorithm that solves Sp anning Tree to Cactus . This algorithm is based on a reduction to the Maximum Indep enden t Set problem on Edge Path T ree (EPT) graphs [ 7 , 6 , 12 ], obtained by constructing an auxiliary intersection graph of the unique paths b etw een the endp oints of the non-tree edges. By com bining this p olynomial-time routine with enumeration o ver all spanning trees of G , we obtain our first exact algorithm for Edge Deletion to Cactus . (In the following theorem the notation O ⋆ ( . ) hides the p olynomial factors on n .) Theorem 2. Ther e exists an algorithm that solves Edge Deletion to Cactus in time O ⋆ ( n n − 2 ) . Although this algorithm is less efficient than the one describ ed later, it still impro v es substantially ov er the brute-force metho d of enumerating all subsets of the edge set, whic h w ould require O ⋆ (2 n 2 ) time in the w orst case. Next, w e solve the Edge Deletion to Cactus problem indep endently in order to obtain a more efficien t exact algorithm. Theorem 3. Ther e exists an algorithm that solves Edge Deletion to Cactus in time O ⋆ (3 n ) . Or ganisation of the p ap er. W e first establish structural prop erties of cactus graphs and edge-minimal non-cactus graphs. Using these prop erties together with results on EPT graphs, we prov e Theorem 1. W e then use this algorithm as a subroutine to obtain Theorem 2. Finally , we dev elop additional structural observ ations on cactus graphs and use them to design a dynamic programming algorithm that prov es Theorem 3. 2 Preliminaries W e use standard notations from graph theory . All graphs considered in this pap er are simple and undirected. Let G = ( V , E ) b e a graph. Throughout the pap er, w e write n := | V | to denote the num b er of vertices of the input graph. The size of a graph is defined as | V | + | E | . F or any graph H , we denote its vertex set by V ( H ) and its edge set by E ( H ). F or tw o graphs G 1 and G 2 , their union, denoted by G 1 ∪ G 2 , is the graph with v ertex set V ( G 1 ) ∪ V ( G 2 ) and edge set E ( G 1 ) ∪ E ( G 2 ). F or a graph G and a vertex x ∈ V ( G ), we denote by deg G ( x ) the degree of x in G . F or any subset X ⊆ V ( G ), we denote by G [ X ] the subgraph of G induced b y X .F or any subset X ⊆ V ( G ), we denote by G − X the induced subgraph G [ V ( G ) \ X ]. If X = { v } for s ome v ∈ V ( G ), we simply write G − v . F or an y subset F ⊆ E ( G ), w e denote by G − F the graph ( V ( G ) , E ( G ) \ F ). If F = { e } for some e ∈ E ( G ), we simply write G − e . A blo ck of a graph is a maximal biconnected subgraph. W e no w define Edge P ath T ree (EPT) graphs follo wing Golumbic and Jamison [ 7 , 6 ]. Let T b e a tree, and let P b e a collection of nontrivial simple paths in T ; that is, eac h path in P con tains at least one edge. W e define the e dge interse ction gr aph of P in T , denoted by Γ ( P , T ), as the graph whose v ertex set corresp onds to the elemen ts of P , with t w o vertices joined by an edge if and only if their corresp onding paths share at least one edge in T . A graph G is called an EPT gr aph if there exist a tree T and a collection of paths P in T suc h that G = Γ ( P , T ). 3 Spanning tree to Cactus In this section, we first prov e Theorem 1 by presen ting a p olynomial-time algo- rithm for the problem Sp anning Tree to Cactus . W e then use this result to establish Theorem 2, which yields an algorithm for Edge Deletion to Cactus with running time O ⋆ ( n n − 2 ). W e require the follo wing theorem for the design of our algorithm. Its pro of is deferred to the app endix; see Section A. A pictorial illustration of the statement is giv en in Figure 1. Theorem 4. L et G = ( V , E ) b e an e dge-minimal non-c actus c onne cte d gr aph; that is, for every e ∈ E , the gr aph G − e is a c actus. Then, for any two e dges e 1 = a 1 b 1 and e 2 = a 2 b 2 , ther e exists a cycle C in G that c ontains b oth e 1 and e 2 . e 1 e 2 Fig. 1. An edge-minimal non-cactus graph with tw o marked edges e 1 and e 2 , such that there exists a cycle which contains b oth e 1 and e 2 , as claimed in Theorem 4 The following theorem establishes a key structural prop ert y that is central to the design of our algorithm. Theorem 5. L et T = ( V , E ) b e a tr e e, and let ˆ E b e a set of e dges with endp oints in V such that ˆ E ∩ E = ∅ . Define a new gr aph H := ( V , E ∪ ˆ E ) . Then H is not a c actus if and only if ther e exist two e dges in ˆ E such that the unique p aths b etwe en their r esp e ctive endp oints in T shar e at le ast one e dge. Pr o of. Supp ose first that there exist tw o edges in ˆ E , say e ′ 1 and e ′ 2 , such that the unique paths b etw een their resp ective endp oin ts in T , denoted by P ′ 1 and P ′ 2 , share at least one edge. Then H con tains tw o distinct cycles, namely P ′ 1 ∪ e ′ 1 and P ′ 2 ∪ e ′ 2 , that share an edge, and hence H is not a cactus. Con v ersely , supp ose that H is not a cactus. Let E ⋆ ⊆ ˆ E b e a minimal set suc h that the graph H ⋆ := ( V , E ∪ E ⋆ ) is not a cactus; that is, for every e ∈ E ⋆ , the graph H ⋆ − e is a cactus. Clearly , H ⋆ is a subgraph of H , and we must hav e | E ⋆ | ≥ 2. Assume, for a contradiction, that for every pair of edges in ˆ E , and hence also in E ⋆ , the unique paths b etw een their resp ective endp oints in T are edge- disjoin t. Let H ′ b e an edge-minimal non-cactus subgraph of H ⋆ ; that is, for ev ery e ∈ E ( H ′ ), the graph H ′ − e is a cactus. Then H ′ m ust con tain all edges of E ⋆ , and therefore it con tains at least t w o edges from ˆ E ; denote them by e 1 and e 2 . Let P 1 b e the unique path in T b et w een the endp oints of e 1 , say a 1 and b 1 , and let P 2 b e the unique path in T b et w een the endp oints of e 2 , say a 2 and b 2 . By Theorem 4, there exists a cycle, denoted by ˜ C , in H ′ that contains b oth e 1 and e 2 . Define ˜ P := ˜ C − e 1 . Then ˜ P is a path b etw een a 1 and b 1 and con tains the edge e 2 . Note that ˜ P is distinct from P 1 , since ˜ P con tains the edge e 2 , whereas P 1 do es not. Consider the graph ˆ C := ˜ P ∪ P 1 . This graph contains the edge e 2 but not e 1 . Moreo v er, it is connected and every edge b elongs either to ˜ P or to P 1 , whic h are t w o distinct paths b etw een a 1 and b 1 . By Lemma 10, ev ery edge in E ( ˜ P ) ∆E ( P 1 ) lies in a cycle. In particular, the edge e 2 is contained in a cycle of ˜ C ; denote this cycle by C ⋆ . This cycle is distinct from P 2 ∪ { e 2 } , since it con tains edges from P 1 , whereas P 2 ∪ { e 2 } do es not, as E ( P 1 ) ∩ E ( P 2 ) = ∅ b y assumption. Observ e that the cycle C ⋆ is presen t in the graph H ′′ := ( V , ( E ∪ E ⋆ ) \ { e 1 } ) . Th us, the graph H ′′ con tains tw o distinct cycles, C ⋆ and P 2 ∪ { e 2 } , that share the edge e 2 . This contradicts the minimalit y of E ⋆ , as H ′′ = H ⋆ − e 1 . Therefore, there must exist tw o distinct edges in E ⋆ and hence in ˆ E , say e i and e j , such that the unique paths b etw een their endp oints share at least one edge. 3.1 The Algorithm Using Theorem 5, we will design an algorithm for the problem Sp anning Tree To Cactus . Let G = ( V , E ) b e a connected graph with T as its spanning tree, which is giv en as input. The elements of E \ E ( T ) are precisely the non-tree edges. Construct an auxiliary graph A T as follo ws: – The v ertices of A T corresp ond to the unique paths in T asso ciated with the non-tree edges. F or example, for a non-tree edge e = ab , there is a v ertex in A T corresp onding to the unique path in T b etw een a and b . – Tw o v ertices in A T are adjacent if and only if their corresp onding tree paths share at least one edge. Observ e that, for any set of non-tree edges F ( ⊆ E \ E ( T )), the graph H := ( V , E ( T ) ∪ F ) is a cactus if and only if the vertices of A T corresp onding to the set F forms an indep endent set. This is due to Theorem 5. Lemma 1. L et G = ( V , E ) b e a c onne cte d gr aph and let T b e a sp anning tr e e of G . Let F ⊆ E \ E ( T ) . We c onstruct an auxiliary gr aph A T as shown ab ove. Then the gr aph H := ( V , E ( T ) ∪ F ) is a c actus if and only if the set of vertic es of A T c orr esp onding to F forms an indep endent set in A T . Pr o of. By Theorem 5, H is a cactus if and only if, there exists no t w o edges from F suc h that the unique paths b etw een their endp oints intersect. Th us, H is a cactus if and only if the set of vertices of A T corresp onding to F forms an indep enden t set in A T . As stated earlier the graph A T is an EPT graph. Moreo ver, T arjan [ 12 ] sho wed that the size of a maximum indep endent set in an EPT graph can b e computed in time p olynomial in the size of the graph. This yields a p olynomial-time algorithm for our problem: the auxiliary graph A T can b e constructed in p olynomial time, and the maximum indep endent set of A T can then b e computed in p olynomial time. Algorithm 1 Sp anningTreeToCactus ( G, T ) Require: A connected graph G = ( V , E ) and a spanning tree T of G Ensure: The maximum num b er of non-tree edges that can b e added to T suc h that the resulting graph remains a cactus 1: Construct the auxiliary graph A T as defined earlier (each vertex corresp onds to a non-tree edge of G , and tw o vertices are adjacent if and only if the corresp onding tree paths in T share at least one edge) 2: Compute a maximum indep endent set of A T using the algorithm of T arjan [12] 3: return the size of this indep endent set Lemma 2. Algorithm 1 is c orr e ct and runs in p olynomial time. Pr o of. The correctness of Algorithm 1 follows directly from Lemma 1. W e no w analyse its running time. Let T b e a spanning tree of the input graph G . The num b er of non-tree edges in G is at most O ( n 2 ). F or each such edge, the algorithm constructs a vertex in the auxiliary graph A T . Hence, the size of A T is b ounded b y O ( n 2 ). The edges of A T are determined by testing pairwise intersections of the corresp onding tree paths, which can b e carried out in p olynomial time. Therefore, the construction of A T tak es p olynomial time in n . As A T is an EPT graph , the size of a maximum indep endent set in it can b e computed in time p olynomial in the size of the graph [ 12 ]. Since A T has size p olynomial in n , this step also runs in p olynomial time. Consequen tly , Algorithm 1 runs in time p olynomial in n . Observ e that the ab ov e algorithm can b e used to design another algorithm for Edge Deletion To Ca ctus , although not as efficien t as the one from Theorem 3. Using an y existing algorithm to enumerate all p ossible spanning tree of the graph G (input to Edge Deletion To Cactus ), we call the ab o v e algorithm for each spanning tree of G and return the ov erall maximum v alue rep orted. Winter [ 14 ], provides an O ⋆ ( τ ( G )) time algorithm for enumerating all spanning tree of a graph G , where τ ( G ) is num b er of spanning trees of a graph G . By the well-kno wn Cayley’s formula, τ ( G ) can b e at most n n − 2 . Thus, we obtain an O ⋆ ( n n − 2 )-time algorithm for Edge Deletion to Cactus , which impro v es up on the brute-force approach of enumerating all subsets of the edge set of G , an approac h that w ould require O ⋆ (2 n 2 ) time. Th us, we hav e established the following theorem. Theorem 2. Ther e exists an algorithm that solves Edge Deletion to Cactus in time O ⋆ ( n n − 2 ) . Pr o of. Let F ⊆ E b e a minimum-size set of edges whose deletion transforms G = ( V , E ) into a cactus, and let H := ( V , E \ F ) . Then H is a connected cactus subgraph of G . In particular, H is a maxim um-sized spanning cactus subgraph of G . Since H is connected, it contains a spanning tree T ′ . The tree T ′ is also a spanning tree of G . Starting from T ′ , the graph H can be obtained b y adding to T ′ a set of non-tree edges such that the resulting graph remains a cactus. By Theorem 1, Algorithm 1 computes, for a giv en spanning tree T , the maxim um n um ber of non-tree edges that can b e added to T while preserving the cactus prop erty . F or the particular tree T ′ , the algorithm therefore returns | E ( H ) | − | E ( T ′ ) | . Consequen tly , if w e execute Algorithm 1 for every spanning tree of G and select the largest v alue obtained, we reco ver the size of a maximum spanning cactus subgraph of G , namely | E ( H ) | . The n um b er of spanning trees of an n -v ertex graph is at most n n − 2 . Since Algorithm 1 runs in p olynomial time for each spanning tree, the ov erall running time is O ⋆ ( n n − 2 ). This yields an algorithm for Edge Deletion to Cactus with running time O ⋆ ( n n − 2 ). 4 A F aster Exact Algorithm In this section, we prov e Theorem 3 and thereby obtain, using dynamic program- ming, an improv ed algorithm for Edge Deletion to Cactus with running time O ⋆ (3 n ). W e observe that solving the ab ov e problem is equiv alent to finding the size of a maximum-sized spanning cactus subgraph of G . Indeed, the complement of the edge set of such a spanning cactus is a minimum-size set of edges whose remov al transforms G in to a cactus. Thus, we will try to solve the problem of finding the size of the largest spanning cactus of the input graph. F or X ⊆ V , where G [ X ] is connected, we define I ( X ) to b e the num b er of edges in a maxim um-sized spanning cactus subgraph of G [ X ]. Let x ∈ X b e such that deg G [ X ] ( x ) ≥ 2, and let A ⊆ X \ { x } b e a non-empty set. Set B := X \ ( A ∪ { x } ) . Supp ose that B is also nonempty and that b oth G [ A ∪ { x } ] and G [ B ∪ { x } ] are connected. W e then define J X [ x, A ] by J X [ x, A ] := max  | E ( C ) |   C is a spanning connected subgraph of G [ X ] , x is a cut v ertex of C , C [ A ∪ { x } ] and C [ B ∪ { x } ] are cacti  . In tuitiv ely , J X [ x, A ] is the maximum n um b er of edges in a spanning cactus subgraph of G [ X ] that is forced to decomp ose into tw o cactus subgraphs on A ∪ { x } and B ∪ { x } , joined together only at the vertex x . Before pro ceeding further, we must ensure that J X [ x, A ] is well defined for all x ∈ X with deg G [ X ] ( x ) ≥ 2 and for all subsets A ⊆ X \ { x } suc h that b oth A and B are nonempty , where B := X \ ( A ∪ { x } ), and such that b oth G [ A ∪ { x } ] and G [ B ∪ { x } ] are connected. The idea is to construct separate spanning trees of the tw o connected subgraphs G [ A ∪ { x } ] and G [ B ∪ { x } ], each ro oted at x , and then to glue them together at x . Their union is a connected spanning subgraph of G [ X ] in which the remo v al of x separates the graph into t w o forests, so that x is a cut v ertex. A more detailed pro of is in the app endix (refer to Lemma 11). W e now pro ceed with the design of the algorithm to find the maximum sized spanning cactus subgraph of a connected graph. F or every set X suc h that G [ X ] is connected and | X | ≤ 5, we compute I ( X ) and all v alues J X [ x, A ] (whenever they are defined) by brute force. If | X | > 5 and G [ X ] is a connected cactus subgraph, then w e set I ( X ) := | E ( G [ X ]) | . W e now consider the remaining case in which | X | > 5 and G [ X ] is connected but not a cactus. Before describing the algorithm for this case, we need to establish some structural prop erties of cactus graphs that will b e used in the design of the algorithm. An y connected non-cactus graph, with at least five vertices, must hav e a maxim um sized spanning cactus s ubgraph with a cut vertex. If a m axim um spanning cactus already has more than one blo ck, then it necessarily has a cut v ertex. Otherwise it is a simple cycle, and since the original graph is not a cactus, w e can sw ap in a non-cycle edge and remov e a cycle edge to obtain another spanning cactus of the same size that now has a cut v ertex. Lemma 3. L et H = ( V , E ) b e a c onne cte d gr aph that is not a c actus, and assume that | V | ≥ 5 . Then ther e exists a maximum-size d sp anning c actus sub gr aph of H that has a cut vertex. (Se e Figur e 2 for an example.) Pr o of. Let C b e a maximum-sized spanning cactus subgraph of H . If C has more than one blo ck, then it already has a cut vertex and there is nothing to prov e. Otherwise, C consists of a single blo ck and is therefore a simple cycle. Since H is not a cactus, there exists an edge e = uv ∈ E ( H ) that is not con tained in C . Let e ′ = u ′ v ′ ∈ E ( C ). Without loss of generality , we ma y assume that u  = u ′ and v  = v ′ , since | V | ≥ 5. u ′ v ′ v u u ′ v ′ v u u ′ v ′ v u Fig. 2. F rom left to right: the graph H , a spanning cycle C of H , and a spanning cactus subgraph C ′ of H with cut vertex u , resp ectively . Define C ′ :=  V , ( E ( C ) ∪ { e } ) \ { e ′ }  . Then C ′ is a spanning cactus subgraph of H with the same num b er of edges as C . W e now show that u is a cut vertex of C ′ . Removing the edge e ′ from the cycle C turns it into a path. Adding the edge e = uv reconnects this path at the vertex u but do es not create a second internally disjoint path b et ween the v ertices u and u ′ . Consequently , in the graph C ′ − u , the vertices that lie on the former path b etw een u and u ′ are separated from the rest of the graph. Th us, deleting u disconnects C ′ , and therefore u is a cut v ertex of C ′ . In the following lemma, we show that gluing t w o cactus graphs together at a single common vertex preserves the cactus prop erty . Intuitiv ely , every cycle in the resulting graph remains entirely within one of the original cacti, and therefore no t w o cycles can share an edge. Lemma 4. L et C and C ′ b e two e dge-disjoint c acti, such that V ( C ) ∩ V ( C ′ ) = { v } . Then C ∪ C ′ is also a c actus. Pr o of. An y cycle in C ∪ C ′ , has all its edges either in C or in C ′ . Thus, if tw o cycles in C ∪ C ′ share edges, then it would mean either C or C ′ is not a cactus, whic h is a con tradiction. The next t w o theorems capture the additiv e b ehaviour of optimal cactus subgraphs when a connected graph is decomp osed at a cut vertex. When such a decomp osition separates the graph in to tw o connected parts, any maximal cactus structure resp ecting this separation consists of optimal cactus subgraphs on each part, and its size is the sum of their sizes. Theorem 6. L et G = ( V , E ) b e a c onne cte d gr aph, and let X ⊆ V b e a set such that | X | > 5 and G [ X ] is c onne cte d. Then I ( X ) = max x ∈ X, A ⊆ X J X [ x, A ] . Pr o of. W e first show that I ( X ) ≤ max x ∈ X, A ⊆ X J X [ x, A ] . Let C b e a spanning cactus subgraph of G [ X ] with the maximum p ossible n um b er of edges. By definition, | E ( C ) | = I ( X ) . By Lemma 3, we can assume that the cactus C has at least one cut vertex; fix suc h a v ertex and denote it by x . Let A b e one of the connected comp onents of C − x , and set B := X \ ( A ∪ { x } ) . Definitely b oth A and B are non-empty and deg G [ X ] ( x ) ≥ 2. Consider the induced subgraphs C [ A ∪ { x } ] and C [ B ∪ { x } ]. These are cactus subgraphs of G [ A ∪ { x } ] and G [ B ∪ { x } ], respectively , and hence both G [ A ∪ { x } ] and G [ B ∪ { x } ] are connected. Moreov er, C is exactly the union of C [ A ∪ { x } ] and C [ B ∪ { x } ]. It follows that the n um b er of edges of C is b ounded ab ov e by J X [ x, A ] for this c hoice of x and A , and therefore I ( X ) ≤ max x ∈ X, A ⊆ X J X [ x, A ] . W e no w prov e the reverse inequalit y . Let x ′ ∈ X and let A ′ ⊆ X \ { x ′ } b e suc h that A ′  = ∅ and the induced subgraphs G [ A ′ ∪ { x ′ } ] and G [ B ′ ∪ { x ′ } ] are connected, where B ′ := X \ ( A ′ ∪ { x ′ } ) . Let B ′  = ∅ . Let C ′ b e a subgraph of G [ X ] with the maximum num b er of edges among all spanning subgraphs of G [ X ] that hav e x ′ as a cut vertex and for whic h C ′ [ A ′ ∪ { x ′ } ] and C ′ [ B ′ ∪ { x ′ } ] are cacti. By construction, | E ( C ′ ) | = J X [ x ′ , A ′ ] . Since C ′ is a cactus subgraph of G [ X ] by Lemma 4, its num b er of edges is at most I ( X ). And x ′ and A ′ w ere c hosen arbitrarily , we hav e max x ∈ X, A ⊆ X J X [ x, A ] ≤ I ( X ) . Com bining the t wo inequalities completes the pro of. Theorem 7. L et G = ( V , E ) b e a c onne cte d gr aph, and let X ⊆ V b e such that | X | > 5 and G [ X ] is c onne cte d. L et x ∈ X satisfy deg G [ X ] ( x ) ≥ 2 , and let A ⊆ X \ { x } b e a nonempty set. Set B := X \ ( A ∪ { x } ) , and supp ose that B is nonempty and that b oth G [ A ∪ { x } ] and G [ B ∪ { x } ] ar e c onne cte d. Then J X [ x, A ] = I ( A ∪ { x } ) + I ( B ∪ { x } ) . Pr o of. Let C b e a maximum-sized connected subgraph of G [ X ] such that x is a cut vertex of C , and such that C [ A ∪ { x } ] and C [ B ∪ { x } ] are cacti. By definition, | E ( C ) | = J X [ x, A ] . Since b oth C [ A ∪ { x } ] and C [ B ∪ { x } ] are cacti, w e ha v e | E ( C [ A ∪ { x } ]) | ≤ I ( A ∪ { x } ) and | E ( C [ B ∪ { x } ]) | ≤ I ( B ∪ { x } ) . Therefore, J X [ x, A ] ≤ I ( A ∪ { x } ) + I ( B ∪ { x } ) . (1) Con v ersely , let C ′ b e a maximum-sized spanning cactus subgraph of G [ A ∪ { x } ], and let C ′′ b e a maximum-sized spanning cactus subgraph of G [ B ∪ { x } ]. Define C ⋆ := C ′ ∪ C ′′ . By Lemma 4, C ⋆ is a cactus subgraph of G [ X ] and spans G [ X ]. Moreo ver, deleting x from C ⋆ disconnects the graph, since there is no edge with one endp oint in C ′ and the other in C ′′ . Hence, x is a cut v ertex of C ⋆ . Th us | E ( C ⋆ ) | ≤ J X [ x, A ], and hence I ( A ∪ { x } ) + I ( B ∪ { x } ) ≤ J X [ x, A ] . (2) Com bining the inequalities 1 and 2, we get the pro of. Com bining Theorems 6 and 7, w e obtain a pro cedure for computing I ( V ), and hence the n um b er of edges in a maximum-sized spanning cactus subgraph of G . In tuitiv ely , the algorithm p erforms dynamic programming ov er all vertex subsets X ⊆ V that induce connected subgraphs, and for each such set it considers all p ossible wa ys of choosing a cut vertex and splitting the remaining v ertices into t w o connected parts. This leads to a branching b eha viour in which each vertex ma y b elong to one of three roles (outside the curren t set, in the first part, or in the second part), yielding a total running time of order 3 n . A pseudo co de description of the algorithm along with more detailed pro ofs of the necessary theorems ha v e b een included in the app endix(refer to Section C.1). Th us w e hav e established the follo wing theorem. Theorem 3. Ther e exists an algorithm that solves Edge Deletion to Cactus in time O ⋆ (3 n ) . 5 Conclusion W e studied tw o closely related graph mo dification problems whose ob jectiv e is to transform a connected graph in to a cactus. F or the Edge Deletion to Cactus problem, which w as known to b e NP-hard, we presented an exact algorithm running in time O ⋆ (3 n ). W e also resolv ed the previously op en problem Sp anning Tree to Cactus by designing a p olynomial-time algorithm based on an auxiliary EPT graph construction and the computation of a maximum indep endent set. As a consequence, this result yields an alternative exact algorithm for Edge Deletion to Cactus with running time O ⋆ ( n n − 2 ). Although this algorithm is less efficien t than our O ⋆ (3 n ) algorithm, it still improv es substantially ov er brute-force enumeration of all subsets of edges. An obvious op en question would b e to obtain an algorithm for Edge Deletion to Cactus whic h runs in time O ⋆ ( c n ), for some c < 3. Another imp ortant direction for future research is the parameterised version of Edge Deletion to Cactus , where the parameter k is the num ber of deleted edges. W e observe that if an input graph G is a Yes -instance of the parameterised version of Edge Deletion to Cactus , then the treewidth of G is at most 2 k + 2 [ 10 ]. Since cactus graphs are exactly those graphs that exclude the diamond as a minor, and since minor-closed graph classes are expressible in monadic second-order logic, the problem admits a fixed-parameter tractable algorithm b y Courcelle’s Theorem [ 4 ]. Ho w ev er, it remains an op en challenge to design an explicit FPT algorithm with a practical and small dep endence on k . F urther directions include w eigh ted v ariants of the problem, where edges hav e costs and the goal is to minimise the total deletion cost, as w e ll as extensions to related graph mo dification problems targeting cactus-like graph classes. W e hop e that the structural insights and algorithmic techniques developed in this w ork will stimulate further progress on cactus mo dification problems and related graph editing questions. References 1. Aoik e, Y., Gima, T., Hanak a, T., Kiy omi, M., Kobay ashi, Y., Kobay ashi, Y., Kurita, K., Otac hi, Y.: An improv ed deterministic parameterized algo- rithm for cactus vertex deletion. Theory of Computing Systems 66 (2), 502–515 (Apr 2022). https://doi.org/10.1007/s00224- 022- 10076- x , https://doi.org/ 10.1007/s00224- 022- 10076- x 2. Bonnet, ´ E., Brettell, N., Kwon, O.j., Marx, D.: Parameterized vertex deletion problems for hereditary graph classes with a blo ck prop erty . In: Heggernes, P . (ed.) Graph-Theoretic Concepts in Computer Science. pp. 233–244. Springer Berlin Heidelb erg, Berlin, Heidelb erg (2016) 3. Brimk ov, B., Hic ks, I.V.: Memory efficient algorithms for cactus graphs and blo c k graphs. Discrete Applied Mathematics 216 , 393–407 (2017). https://doi.org/https://doi.org/10.1016/j.dam.2015.10.032 , https://www. sciencedirect.com/science/article/pii/S0166218X15005193 , graph-theoretic and P olyhedral Combinatorics Issues and Approaches in Imaging Sciences 4. Courcelle, B., Engelfriet, J.: Graph structure and monadic second-order logic. A language-theoretic approach, Encycl. Math. Appl., vol. 138. Cambridge: Cambridge Univ ersity Press (2012) 5. El-Mallah, E., Colb ourn, C.: The complexit y of some edge deletion problems. IEEE transactions on circuits and systems 35 (3), 354–362 (Mar 1988). https: //doi.org/10.1109/31.1748 , funding Information: Manuscript received May 27, 1987; revised Octob er 19, 1987. C. J. Colb ourn’s research was supp orted by NSERC Canada under Grant A0579. This pap er was recommended by K. Thulasiraman and N. Deo, Guest Editors for this issue. 6. Golum bic, M.C., Jamison, R.E.: Edge and vertex intersection of paths in a tree. Discrete Mathematics 55 (2), 151–159 (1985). https://doi.org/https: //doi.org/10.1016/0012- 365X(85)90043- 3 , https://www.sciencedirect.com/ science/article/pii/0012365X85900433 7. Golum bic, M.C., Jamison, R.E.: The edge intersection graphs of paths in a tree. Jour- nal of Combinatorial Theory , Series B 38 (1), 8–22 (1985). https://doi.org/https: //doi.org/10.1016/0095- 8956(85)90088- 7 , https://www.sciencedirect.com/ science/article/pii/0095895685900887 8. Harary , F., Uhlenbeck, G.E.: On the num b er of husimi trees. Pro ceedings of the National Academy of Sciences 39 (4), 315–322 (Apr 1953). https://doi.org/10. 1073/pnas.39.4.315 , https://doi.org/10.1073/pnas.39.4.315 9. Hop croft, J., T arjan, R.: Algorithm 447: efficient algorithms for graph manipulation. Comm un. A CM 16 (6), 372–378 (Jun 1973). https://doi.org/10.1145/362248. 362272 , https://doi.org/10.1145/362248.362272 10. Ko c h, I., P ardal, N., dos San tos, V.F.: Edge deletion to tree-like graph classes. Discrete Applied Mathematics 348 , 122–131 (2024). https://doi.org/https://doi.org/10.1016/j.dam.2024.01.028 , https: //www.sciencedirect.com/science/article/pii/S0166218X24000398 11. Misra, P ., Raman, V., Ramanujan, M.S., Saurabh, S.: Parameterized algorithms for even cycle transversal. In: Golumbic, M.C., Stern, M., Levy , A., Morgenstern, G. (eds.) Graph-Theoretic Concepts in Computer Science. pp. 172–183. Springer Berlin Heidelb erg, Berlin, Heidelb erg (2012) 12. T arjan, R.E.: Decomposition by clique separators. Discrete Mathemat- ics 55 (2), 221–232 (1985). https://doi.org/https://doi.org/10.1016/ 0012- 365X(85)90051- 2 , https://www.sciencedirect.com/science/article/ pii/0012365X85900512 13. Tsur, D.: F aster deterministic algorithm for cactus vertex deletion. Information Pro cessing Letters 179 , 106317 (2023). https://doi.org/https://doi.org/10. 1016/j.ipl.2022.106317 , https://www.sciencedirect.com/science/article/ pii/S0020019022000746 14. Win ter, P .: An algorithm for the enumeration of spanning trees. BIT Numerical Mathematics 26 (1), 44–62 (Mar 1986). https://doi.org/10.1007/BF01939361 , https://doi.org/10.1007/BF01939361 APPENDIX A Prop erties of Edge Minimal Cacti Theorem 4. L et G = ( V , E ) b e an e dge-minimal non-c actus c onne cte d gr aph; that is, for every e ∈ E , the gr aph G − e is a c actus. Then, for any two e dges e 1 = a 1 b 1 and e 2 = a 2 b 2 , ther e exists a cycle C in G that c ontains b oth e 1 and e 2 . Before pro ving the ab o v e theorem, w e first establish a few observ ations that will b e used in the pro of. Lemma 5. L et G = ( V , E ) c ontain two distinct cycles C 1 and C 2 that shar e at le ast one e dge. Then ther e exists a thir d cycle that is distinct fr om b oth C 1 and C 2 . (As shown in Figur e 3.) u 1 P u 3 C 1 C 2 Fig. 3. Two distinct cycles C 1 and C 2 share the path P . Removing the edges of P lea ves tw o distinct paths b etw een u 1 and u 3 , whic h together form a third cycle C 3 . Pr o of. Consider a maximal connected subgraph of G , say P , whose edges are all common to b oth C 1 and C 2 . Then P is a path in G . W rite P = u 1 u 2 . . . u l . Note that b oth u 1 and u l b elong to V ( C 1 ) ∩ V ( C 2 ). No w consider the graph G − { u 1 u 2 , u 2 u 3 , . . . , u l − 1 u l } , that is, the subgraph of G obtained b y deleting the edges of P . This graph con tains t w o paths b et ween u 1 and u l , namely P 1 := C 1 − E ( P ) and P 2 := C 2 − E ( P ) . These t w o paths must be distinct; otherwise, we would hav e C 1 = C 2 in G , con trary to assumption. Hence, the graph G − { u 1 u 2 , u 2 u 3 , . . . , u l − 1 u l } con tains a cycle. Any such cycle is necessarily distinct from b oth C 1 and C 2 . Lemma 6. L et G = ( V , E ) b e an e dge-minimal non-c actus c onne cte d gr aph; that is, for every e ∈ E , the gr aph G − e is a c actus. L et C 1 and C 2 b e two cycles in G that shar e at le ast one e dge. Then E ⊆ E ( C 1 ) ∪ E ( C 2 ) . Pr o of. Supp ose, for a contradiction, that there exists an edge e ′ ∈ E suc h that e ′ / ∈ E ( C 1 ) ∪ E ( C 2 ). Consider the graph G − e ′ . In this graph, b oth cycles C 1 and C 2 are still present and share at least one edge. Hence, G − e ′ is not a cactus. This con tradicts the edge-minimalit y of G . Lemma 7. L et G = ( V , E ) b e an e dge-minimal non-c actus c onne cte d gr aph. L et C 1 and C 2 b e two cycles in G that shar e at le ast one e dge. Then, for every cycle C of G , we have E ( C ) ∩ E ( C 1 )  = ∅ . Pr o of. Supp ose, for a contradiction, that there exists a cycle ˆ C such that E ( ˆ C ) ∩ E ( C 1 ) = ∅ . Then ˆ C is distinct from b oth C 1 and C 2 . Consequently , there exists an edge ˆ e ∈ E ( ˆ C ) such that ˆ e / ∈ E ( C 2 ). Moreo v er, ˆ e / ∈ E ( C 1 ), since E ( ˆ C ) ∩ E ( C 1 ) = ∅ . Consider the graph G − ˆ e . In this graph, the cycles C 1 and C 2 are still present and they share at least one edge. Hence, G − ˆ e is not a cactus. This contradicts the edge-minimalit y of G . Therefore, for ev ery cycle C of G , we must hav e E ( C ) ∩ E ( C 1 )  = ∅ . Lemma 8. L et G = ( V , E ) b e an e dge-minimal non-c actus c onne cte d gr aph. L et C 1 and C 2 b e two cycles in G such that E ( C 1 ) ∩ E ( C 2 )  = ∅ , and let C 3 b e a distinct cycle in G . Then E ( C 1 ) ∆E ( C 2 ) ⊆ E ( C 3 ) . Pr o of. By Lemma 7, we hav e E ( C 1 ) ∩ E ( C 3 )  = ∅ and E ( C 2 ) ∩ E ( C 3 )  = ∅ Supp ose, for a contradiction, that there exists an edge e ′ ∈ E ( C 1 ) ∆E ( C 2 ) such that e ′ / ∈ E ( C 3 ). There can b e tw o cases. Case 1 : e ′ ∈ E ( C 1 ). Consider the graph G − e ′ . In this graph, the cycles C 2 and C 3 are b oth presen t and satisfy E ( C 2 ) ∩ E ( C 3 )  = ∅ . Hence, G − e ′ is not a cactus. Case 2 : e ′ ∈ E ( C 2 ). Consider the graph G − e ′ . In this graph, the cycles C 1 and C 3 are b oth presen t and satisfy E ( C 1 ) ∩ E ( C 3 )  = ∅ . Hence, G − e ′ is not a cactus. Either case con tradicts the edge-minimalit y of G . Theorem 4. L et G = ( V , E ) b e an e dge-minimal non-c actus c onne cte d gr aph; that is, for every e ∈ E , the gr aph G − e is a c actus. Then, for any two e dges e 1 = a 1 b 1 and e 2 = a 2 b 2 , ther e exists a cycle C in G that c ontains b oth e 1 and e 2 . Pr o of. Since G is a non-cactus, there exist tw o distinct cycles C 1 and C 2 suc h that E ( C 1 ) ∩ E ( C 2 )  = ∅ . Consider t w o arbitrary edges e 1 and e 2 . By Lemma 6, b oth e 1 and e 2 b elong to E ( C 1 ) ∪ E ( C 2 ). If b oth edges lie in E ( C 1 ) or b oth lie in E ( C 2 ), then there is nothing to pro v e. No w consider the case in which e 1 ∈ E ( C 1 ) \ E ( C 2 ) and e 2 ∈ E ( C 2 ) \ E ( C 1 ). Since the cycles C 1 and C 2 share edges, Lemma 5 implies that there exists a third cycle C 3 distinct from b oth C 1 and C 2 . By Lemma 8, w e ha v e E ( C 1 ) ∆E ( C 2 ) ⊆ E ( C 3 ) . Therefore, there exists a cycle that con tains b oth e 1 and e 2 . B Relationship b et ween T rees and Cacti Lemma 9. L et G b e a c onne cte d gr aph. Supp ose that ther e exists distinct vertic es x, y ∈ V ( G ) and two distinct e dge-disjoint p aths P 1 and P 2 with endp oints x and y such that E ( G ) = E ( P 1 ) ∪ E ( P 2 ) . Then every e dge of G lies in a cycle. (S e e Figur e 4.) x y P 1 P 2 Fig. 4. A graph G with the prop erties as mentioned in the ab ov e lemma Pr o of. Let e b e an arbitrary edge of G . Since E ( G ) = E ( P 1 ) ∪ E ( P 2 ), we hav e either e ∈ E ( P 1 ) or e ∈ E ( P 2 ). Without loss of generality , assume that e ∈ E ( P 1 ), and let its endp oints b e u and v . Consider a maximal connected subgraph of P 1 that contains the edge e . This subgraph is a subpath of P 1 ; denote its endp oin ts by w and z . Then b oth w and z b elong to V ( P 1 ) ∩ V ( P 2 ). Without loss of generality , assume that w is connected to u (or w = u ) and that z is connected to v (or z = v ) in the graph P 1 − e . Moreov er, w is connected to z by a path in P 2 . W e now construct a path P ′ b et w een u and v in G − e as follows: – a path from u to w in P 1 − e , unless w = u ; – a path from w to z in P 2 ; – a path from z to v in P 1 − e , unless z = v . Th us, P ′ ∪ { e } is a cycle that con tains the edge e . Since e w as chosen arbitrarily , ev ery edge of G b elongs to a cycle. Lemma 10. L et G b e a c onne cte d gr aph. Supp ose that ther e exist distinct vertic es x, y ∈ V ( G ) and two distinct p aths P 1 and P 2 with endp oints x and y such that E ( G ) = E ( P 1 ) ∪ E ( P 2 ) . Then every e dge of G that b elongs to E ( P 1 ) ∆E ( P 2 ) lies in a cycle. x y P 1 P 2 Fig. 5. A graph G with the prop erties as mentioned in the ab ov e lemma Pr o of. Let e b e an arbitrary edge of G with e ∈ E ( P 1 ) ∆E ( P 2 ). Without loss of generalit y , assume that e ∈ E ( P 1 ), and let its endp oints b e u and v . Consider a maximal connected subgraph of P 1 that contains the edge e and con tains no edges of P 2 ; denote this subgraph by P ′ . Then P ′ is a subpath of P 1 . Let its endp oints b e w and z . By maximality , b oth w and z b elong to V ( P 1 ) ∩ V ( P 2 ). Since w and z lie on b oth paths, there exists a path in P 2 b et w een w and z ; denote this path b y P ′′ . By construction, w e ha v e E ( P ′ ) ∩ E ( P ′′ ) = ∅ , since P ′ con tains no edges of P 2 . No w consider the graph P ′ ∪ P ′′ . This graph is connected and has tw o distinct v ertices w and z joined by tw o edge-disjoint paths, namely P ′ and P ′′ . Moreov er, ev ery edge of this graph b elongs to E ( P ′ ) ∪ E ( P ′′ ). By Lemma 9, every edge of P ′ ∪ P ′′ lies in a cycle. Since e ∈ E ( P ′ ), it follo ws that e lies in a cycle. As e was chosen arbitrarily , ev ery edge in E ( P 1 ) ∆E ( P 2 ) lies in a cycle. C Some results needed for the Dynamic Programming Algorithm Lemma 11. L et H = ( V , E ) b e a c onne cte d gr aph, and let x ∈ V b e a vertex such that deg H ( x ) ≥ 2 . L et A ⊆ V \ { x } b e nonempty, and set B := V \ ( A ∪ { x } ) , with B also nonempty. Supp ose that b oth H [ A ∪ { x } ] and H [ B ∪ { x } ] ar e c onne cte d. Then ther e exists a sp anning c onne cte d sub gr aph of H , say T , such that x is one of the cut vertic es of T , and such that b oth T [ A ∪ { x } ] and T [ B ∪ { x } ] ar e c acti. Pr o of. Let x ∈ V b e a v ertex with deg ( x ) H ≥ 2, and let A ⊆ V \ { x } b e nonempt y . Set B := V \ ( A ∪ { x } ) , and supp ose that B is also nonempt y . Assume further that b oth H [ A ∪ { x } ] and H [ B ∪ { x } ] are connected. Let T 1 b e a spanning tree of H [ A ∪ { x } ] ro oted at x , and let T 2 b e a spanning tree of H [ B ∪ { x } ] ro oted at x . Define T := T 1 ∪ T 2 . By construction, T is a spanning subgraph of H , and it is connected. Moreov er, deleting x from T disconnects the graph T , and hence x is a cut vertex of T . Finally , w e observe that T [ A ∪ { x } ] = T 1 and T [ B ∪ { x } ] = T 2 , which are b oth trees and therefore cacti. C.1 The Dynamic Programming Algorithm W e describ e a dynamic programming pro cedure for computing the v alue I ( X ) for ev ery v ertex set X ⊆ V suc h that the induced subgraph G [ X ] is connected. F or all sets X ⊆ V with | X | ≤ 5 and with G [ X ] connected, the v alues I ( X ) and all defined v alues J X [ x, A ] are computed by brute force. F or every vertex set X ⊆ V suc h that the induced subgraph G [ X ] is a cactus (a prop ert y that can b e tested in p olynomial time), we assign I ( X ) := | E ( G [ X ]) | . F or all remaining sets X , we initialise I ( X ) := 0. F or eac h vertex set X ⊆ V suc h that G [ X ] is connected, w e inv oke the pro cedure FindMaxCactus ( X ) and assign its return v alue to I ( X ). The pro cedure FindCutCactus ( x, A, X ) computes the contribution of a decomp osition of X in to the tw o vertex sets A ∪ { x } and B ∪ { x } , where B := X \ ( A ∪ { x } ), under the assumption that b oth induced subgraphs G [ A ∪ { x } ] and G [ B ∪ { x } ] are connected. In other words, it calculates the v alue J X [ x, A ], for the c hoice of x and A . In tuitiv ely , FindMaxCactus ( X ) considers all choices of a cut vertex x ∈ X of a cactus subgraph of G [ X ] and all partitions of X \ { x } in to t w o nonempty sets A and B suc h that the induced subgraphs G [ A ∪ { x } ] and G [ B ∪ { x } ] are Algorithm 2 FindMaxCactus ( X ) 1: if | X | ≤ 5 or G [ X ] is a cactus then 2: return I ( X ) 3: end if 4: for all x ∈ X such that deg G [ X ] ≥ 2 do 5: for all A ⊆ X \ { x } do 6: B ← X \ ( A ∪ { x } ) 7: if A  = ∅ and B  = ∅ then 8: if G [ A ∪ { x } ] and G [ B ∪ { x } ] are connected then 9: s ← FindCutCactus ( x, A, X ) 10: if s > I ( X ) then 11: I ( X ) ← s 12: end if 13: end if 14: end if 15: end for 16: end for 17: return I ( X ) Algorithm 3 FindCutCactus ( x, A, X ) 1: B ← X \ ( A ∪ { x } ) 2: if | A ∪ { x }| ≤ 5 then 3: s 1 ← I ( A ∪ { x } ) 4: else 5: s 1 ← FindMaxCactus ( A ∪ { x } ) 6: end if 7: if | B ∪ { x }| ≤ 5 then 8: s 2 ← I ( B ∪ { x } ) 9: else 10: s 2 ← FindMaxCactus ( B ∪ { x } ) 11: end if 12: return s 1 + s 2 connected. F or each such c hoice, it combines optimal cactus solutions on the t w o vertex sets A ∪ { x } and B ∪ { x } . The pro cedure FindCutCactus ( x, A, X ) computes the maxim um size of a spanning subgraph obtained by joining optimal cactus subgraphs of G [ A ∪ { x } ] and G [ B ∪ { x } ] at the common vertex x . The correctness of the t w o pro cedures follo ws from Theorem 6 and Theorem 7. W e no w analyse the running time of the pro cedures FindMaxCactus and FindCutCactus . Theorem 8. L et G = ( V , E ) b e a gr aph with n := | V | . The pr o c e dur es Find- MaxCactus and FindCutCactus c ompute the values I ( X ) for al l vertex sets X ⊆ V such that G [ X ] is c onne cte d in time O ⋆ (3 n ) . Pr o of. The dynamic programming table is indexed by vertex sets X ⊆ V suc h that the induced subgraph G [ X ] is connected. In the worst case, every subset of V induces a connected subgraph, and hence the num b er of subproblems is at most 2 n . Consider a fixed set X ⊆ V with | X | = k . If | X | ≤ 5 or G [ X ] is a cactus, the v alue I ( X ) is returned in p olynomial time. Otherwise, the pro cedure Find- MaxCactus ( X ) iterates ov er all vertices x ∈ X with deg G [ X ] ( x ) ≥ 2 and ov er all subsets A ⊆ X \ { x } . F or each suc h choice, it p erforms p olynomial-time tests for nonemptiness and connectivity of the induced subgraphs G [ A ∪ { x } ] and G [ B ∪ { x } ], where B := X \ ( A ∪ { x } ), and makes a call to FindCutCac- tus ( x, A, X ). Th us, for a fixed set X of size k , the total work p erformed by FindMaxCac- tus ( X ) is b ounded by O ⋆ ( k · 2 k − 1 ) = O ⋆ (2 k ) . The pro cedure FindCutCactus ( x, A, X ) in v ok es the pro cedure FindMax- Cactus on the strictly smaller vertex sets A ∪ { x } and B ∪ { x } , and otherwise p erforms only p olynomial-time op erations. Hence, the running time of FindCut- Cactus is dominated by the running time of these calls to FindMaxCactus . In particular, FindCutCactus do es not contribute any additional exp onen tial factor b ey ond that already accoun ted for in the analysis of FindMaxCa ctus . Summing o v er all vertex sets X ⊆ V , the total running time is b ounded by O ⋆ ( X X ⊆ V 2 | X | ) = O ⋆ n X k =0  n k  2 k ! . Using the binomial identit y P n k =0  n k  2 k = (1 + 2) n = 3 n , w e obtain a total running time of O ⋆ (3 n ). Therefore, the combined execution of FindMaxCa ctus and FindCutCac- tus runs in time O ⋆ (3 n ). This pro v es the following theorem. Theorem 3. Ther e exists an algorithm that solves Edge Deletion to Cactus in time O ⋆ (3 n ) .

Original Paper

Loading high-quality paper...

Comments & Academic Discussion

Loading comments...

Leave a Comment