Faster algorithms for cograph edge modification problems
Dekel Tsur

TL;DR
This paper presents faster fixed-parameter algorithms for the Cograph Deletion and Cograph Editing problems, improving the efficiency of transforming graphs into cographs by minimizing edge modifications.
Contribution
The authors develop new algorithms with improved exponential running times for cograph modification problems, advancing the computational methods in graph editing.
Findings
Cograph Deletion algorithm runs in O*(2.303^k) time.
Cograph Editing algorithm runs in O*(4.329^k) time.
Algorithms are fixed-parameter tractable with respect to k.
Abstract
In the Cograph Deletion (resp., Cograph Editing) problem the input is a graph and an integer , and the goal is to decide whether there is a set of edges of size at most whose removal from (resp., removal and addition to ) results in a graph that does not contain an induced path with four vertices. In this paper we give algorithms for Cograph Deletion and Cograph Editing whose running times are and , respectively.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Faster algorithms for cograph edge modification problems
Dekel Tsur Ben-Gurion University of the Negev. Email: [email protected]
Abstract
In the Cograph Deletion (resp., Cograph Editing) problem the input is a graph and an integer , and the goal is to decide whether there is a set of edges of size at most whose removal from (resp., removal and addition to ) results in a graph that does not contain an induced path with four vertices. In this paper we give algorithms for Cograph Deletion and Cograph Editing whose running times are and , respectively.
Keywords
graph algorithms, parameterized complexity, branching algorithms.
1 Introduction
A graph is called a cograph if it does not contain an induced , where is a path with 4 vertices. In the Cograph Deletion (resp., Cograph Editing) problem the input is a graph and an integer , and the goal is to decide whether there is a set of edges of size at most whose removal from (resp., removal and addition to ) results in a cograph. The Cogaph Deletion and Cogaph Editing problems can be solved in and time (where ), respectively, using simple branching algorithms [1]. Nastos and Gao [5] gave an algorithm with running time for Cogaph Deletion and Liu et al. [4] gave an algorithm for Cogaph Editing with running time. In this paper, we give algorithms for Cograph Deletion and Cogaph Editing whose time complexities are and , respectively.
Preleminaries
For a set of vertices in a graph , is the subgraph of induced by (namely, where ). For a graph and a set of edges, is the graph . For a graph and a set of pairs of vertices, is the graph .
For a graph , a set of edges is called a deletion set of if is a cograph. A set of pairs of vertices is called an editing set of if is a cograph.
2 Algorithm for Cogaph Deletion
A graph is called -sparse if for every set of 5 vertices, the graph has at most one induced . A graph is -sparse if and only if it does not contain one of the graphs of Figure 1 as an induced subgraph. Jamison and Olariu [3] showed that a -sparse graph admits a recursive decomposition. To describe this decomposition, we first need the following definition.
Definition 1**.**
A graph is a spider if the vertices of can be partitioned into disjoint sets , , and such that
. 2. 2.
* is an independent set and is a clique.* 3. 3.
Every vertex in is adjacent to all the vertices in and not adjacent to all the vertices in . 4. 4.
There is a bijection such that one of the following two cases occurs.
- (a)
* for every .* 2. (b)
* for every .*
The recursive decomposition of -sparse graphs is based on the following theorem from [3].
Theorem 2**.**
Let be a -sparse graph with at least 2 vertices. Then exactly one of the following cases occurs.
* is not connected.* 2. 2.
* is not connected.* 3. 3.
* is a spider.*
For a graph , let be a set containing every inclusion minimal deletion set of . The branching vector than corresponds to is a vector that contains the sizes of the sets in . We now describe the algorithm of Nastos and Gao [5] for the Cograph Deletion problem. The algorithm is a branching algorithm (cf. [2]). The algorithm first repeatedly applies the following branching rule, until the rule cannot be applied.
(B0) If is not -sparse, find a set such that is isomorphic to one of the graphs in Figure 1. For every , recurse on the instance .
Let denote the minimum size of a deletion set of . When is -sparse, the algorithm computes in polynomial time and then returns whether . The computation of relies on the recursive decomposition of .
Lemma 3**.**
Let be a -sparse graph. If has less than 4 vertices, . If (resp., ) is not connected, let be the connected components of (resp., ). Then, . Otherwise, is a spider and let be the corresponding partition of the vertices of . Then, , where is either or .
The worst case of Rule (B0) is when induces a pan. In this case , where are the edges of according to Figure 1(b). Thus, the branching vector in this case is and the branching number is at most 2.562. Therefore, the running time of the algorithm is .
The main idea behind our improved algorithm is as follows. The proof of Theorem 2 is based on showing that certain graphs with 6 to 8 vertices cannot occur in since these graphs have induced subgraphs that are isomorphic to graphs in Figure 1. Instead of destroying subgraphs of that are isomorphic to the graphs of Figure 1, our algorithm destroys the graphs considered in the proof of Theorem 2. We then show that a graph that does not contain these graphs as induced subgraphs admits a recursive decomposition similar to the decomposition of -sparse graphs, and this decomposition can be used to solve the problem in polynomial time.
Before describing our algorithm, we need some definitions. Suppose that is a set of vertices that induces a . Denote by (resp., ), the set of vertices such that (resp., ). Let . In other words, is the set of vertices such that . Let be the set of vertices such that and is adjacent to the two internal vertices of the path induced by . Let . For a graph , let , where is an induced subgraph of that contains at least one induced and such that the branching number corresponding to is minimized.
We now describe the branching rules of our algorithm. In these rules, the algorithm finds a set of 6 to 8 vertices that induces a certain graph and then it performs branching according to . We note that the algorithm branches according to rather than according to since in some cases the former branching is more efficient (for example, if induces a then the branching number corresponding to is 2.303 while the branching number corresponding to is 2.45).
The first three branching rules add restrictions on vertices in .
(B1) Let be a set that induces a such that there are distinct vertices and for which is not isomorphic to either of the graphs in in Figure 2. For every , recurse on the instance .
To bound the branching number of Rule (B1), we used a Python script. The script enumerates all possible cases for the graph . Denote by the path induced by . For the vertex , the script enumerates all possible cases for . After removing symmetric cases, there are 7 possible cases for : , , , , , , and . For each case of , the script enumerates all possible cases for (here symmetric cases are not removed) and it also considers the cases and . For each possible case the scripts computes . by enumerating the induced subgraphs of . For each induced subgraph , the script enumerates all subsets of and checks which of these sets are deletion sets. The worst branching vector for Rule (B1) is and the branching number is at most . The script was also used to compute the branching numbers of the other rules of the algorithm.
(B2) Let be a set that induces a such that there are non-adjacent vertices and . For every , recurse on the instance .
(B3) Let be a set that induces a such that there are adjacent vertices and for which is not isomorphic to the graph in Figure 3. For every , recurse on the instance .
The last rule handles cases in which the proof of Theorem 2 relies on the fact that is -sparse. For example, Observation 2.3 in [3] states that there is no vertex and vertices such that . This observation is proved by showing that if such vertices exist, has an induced subgraph isomorphic to a fork (see Figure 1(f)). Therefore, we add a rule that is applicable if there are such vertices . The rule performs branching according to . Since the proof of Theorem 2 can consider the complement graph of , we also need to add a complement rule that is applicable if the former rule is applicable in . In other words, the new rule is applicable if there are vertices and such that .
(B4) Let be a set that induces a such that one of the following cases occurs.
There are vertices and such that (Observation 2.3 in [3]). 2. 2.
There are vertices and such that (Observation 2.3). 3. 3.
There are vertices and such that (Observation 2.4). 4. 4.
There are vertices and such that (Observation 2.4). 5. 5.
There are vertices and such that is not adjacent to (Observation 2.6). 6. 6.
There are vertices and such that is adjacent to (Observation 2.6). 7. 7.
There are vertices and such that is not adjacent to (Observation 2.7). 8. 8.
There are vertices and such that is adjacent to (Observation 2.7). 9. 9.
There are vertices , , and such that (Observation 2.14). 10. 10.
There are vertices , , and such that (Observation 2.14). 11. 11.
There are vertices , , and such that (Fact 2.15). 12. 12.
There are vertices , , and such that (Fact 2.15). 13. 13.
There are vertices , , and , such that (Fact 2.15). 14. 14.
There are vertices , , and such that (Fact 2.15).
For every , where is a set containing the vertices mentioned in the cases above, (namely, in Cases 1, 2, 7, and 8, in Cases 3, 4, 5, 6, 9, 10, 11, and 12, and in Cases 13 and 14). recurse on the instance .
The branching numbers of Rule (B2), Rule (B2) and Rule (B4) are at most 2.27, 2.303, and 2.21, respectively.
We now show that a graph in which the branching rules cannot be applied has a recursive decomposition.
Theorem 4**.**
Let be a graph with at least 7 vertices in which Rules (B1)–(B3) cannot be applied. Then one of the following cases occurs.
* is not connected.* 2. 2.
* is not connected.* 3. 3.
* is a spider.* 4. 4.
* is a bipartite graph with parts and such that (a) (b) There is a vertex such that is adjacent to exactly one vertex in and every vertex in is adjacent to the two vertices of .*
Proof.
Suppose that is a graph such that and are connected. We choose a set that induces a such that is maximized. Denote the vertices of the path by .
Recall that Theorem 2 requires the graph to be -sparse. The proof of Theorem 2 relies on this requirement in the following places: (1) in the proofs of Observations 2.3, 2.4, 2.6, 2.7, 2.14, and 2.15. (2) the requirement that is sparse implies that and the emptiness of is used in the proof. Since Rule (B3) cannot be applied, the observations mentioned above remain true. If then the arguments used in the proof of Theorem 2 are also true here, and therefore is a spider.
Now suppose that . Since Rule (B3) cannot be applied, . The proof of Theorem 2 shows the following properties (More precisely, the proof of Theorem 2 shows that the first property below is satisfied in either or . The second property below is satisfied in if and only if the first property is satisfied in ).
If then there is an injective mapping such that for every . 2. 2.
If then there is an injective mapping such that for every .
These properties are also true here, since the proof of these properties does not rely on the emptiness of .
We now claim that . Suppose conversely that there is a vertex . By Property 1, there is a vertex such that is not adjacent to . This is a contradiction to the assumption that Rule (B2) cannot be applied. Therefore, .
Suppose that . If then has at most 6 vertices and we are done. Otherwise, since Rule (B3) cannot be applied, without loss of generality for every and is an independent set. Therefore, satisfies Case 4 of the theorem with and .
Now suppose that . Let . By Property 2, there is a vertex such that . Since Rule (B2) cannot be applied, without loss of generality, . We claim that . Suppose conversely that and let . By Property 2, is adjacent to a vertex . Since Rule (B2) cannot be applied, either or . In both cases we obtain a contradiction to the assumption that Rule (B3) cannot be applied. Therefore, . Since Rule (B3) cannot be applied, either , or and . In the latter case we obtain that case 2 of Rule (B3) can be applied on (recall that ), a contradiction. Therefore, . By Property 2, , and thus contains 6 vertices. ∎
Given a graph in which Rules (B1)–(B3) cannot be applied, can be computed in polynomial times as follows. If has at most 6 vertices, compute by enumerating all subsets of . If satisfies Case 4 of Theorem 4 then . Otherwise, we have that either is not connected, is not connected, or is a spider. In each of these cases can be computed recursively according to Lemma 3.
Theorem 5**.**
There is an -time algorithm for Cograph Deletion.
Proof.
Every application of a branching rule decreases the number of edges of the graph by at least 1. Therefore, the depth of the recursion tree is at most . By Theorem 4, an instance in which the branching rules cannot be applied can be solved in polynomial time. Since each rule can be applied in polynomial time and since the branching rules have branching numbers at most 2.303, it follows that the time complexity of the algorithm is .
The correctness of the algorithm follows from the safeness of the rules (which follows from the definition of ) and from the fact that the algorithm terminates on every input. ∎
3 Algorithm for Cograph Editing
The algorithm for Cograph Editing is similar to the algorithm for Cograph Deletion. The differences are as follows.
In each branching rule, the algorithm recurses on for every for the corresponding graph , where is a set containing every inclusion minimal editing set of . 2. 2.
Rule (B3) is applied also when is isomorphic to a graph in Figure 2. Similarly, Rule (B2) is applied also when is isomorphic to the graph in Figure 3. 3. 3.
If is a graph in which Rules (B3)–(B4) cannot be applied, either contains at most 5 vertices, is not connected, is not connected, or is a spider. Therefore, the minimum size of an editing set of can be computed in polynomial time using the algorithm for -sparse graphs of Liu et al. [4].
Using an automated analysis as in Section 2, we obtain that the branching numbers of Rules (B3)–(B2) are at most 4.313, and the branching number of Rule (B3) is at most 4.329. We obtain the following theorem.
Theorem 6**.**
There is an -time algorithm for Cograph Editing.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] L. Cai. Fixed-parameter tractability of graph modification problems for hereditary properties. Information Processing Letters , 58(4):171–176, 1996.
- 2[2] M. Cygan, F. V. Fomin, Ł. Kowalik, D. Lokshtanov, D. Marx, M. Pilipczuk, M. Pilipczuk, and S. Saurabh. Parameterized algorithms . Springer, 2015.
- 3[3] B. Jamison and S. Olariu. A tree representation for p 4-sparse graphs. Discrete Applied Mathematics , 35(2):115–129, 1992.
- 4[4] Y. Liu, J. Wang, J. Guo, and J. Chen. Complexity and parameterized algorithms for cograph editing. Theoretical Computer Science , 461:45–54, 2012.
- 5[5] J. Nastos and Y. Gao. Bounded search tree algorithms for parametrized cograph deletion: efficient branching rules by exploiting structures of special graph classes. Discrete Mathematics, Algorithms and Applications , 4(01), 2012.
