Efficient enumeration of maximal split subgraphs and sub-cographs and related classes
Caroline Brosse, Aurélie Lagoutte, Vincent Limouzy, Arnaud Mary, Lucas Pastor
EEfficient enumeration of maximal split subgraphs andsub-cographs and related classes ∗ Caroline Brosse , Aurélie Lagoutte , Vincent Limouzy , Arnaud Mary and Lucas Pastor July 3, 2020 Limos , Univ. Clermont-Auvergne,2.
Lbbe , Univ. Claude Bernard- Lyon 1July 3, 2020
Abstract
In this paper, we are interested in algorithms that take in input an arbitrary graph G , and thatenumerate in output all the (inclusion-wise) maximal “subgraphs” of G which fulfil a given propertyΠ. All over this paper, we study several different properties Π, and the notion of subgraph underconsideration (induced or not) will vary from a result to another.More precisely, we present efficient algorithms to list all maximal split subgraphs, sub-cographsand some subclasses of cographs of a given input graph. All the algorithms presented here runin polynomial delay, and moreover for split graphs it only requires polynomial space. In orderto develop an algorithm for maximal split (edge-)subgraphs, we establish a bijection between themaximal split subgraphs and the maximal independent sets of an auxiliary graph. For cographsand some subclasses , the algorithms rely on a framework recently introduced by Conte & Uno [9]called Proximity Search . Finally we consider the extension problem, which consists in deciding ifthere exists a maximal induced subgraph satisfying a property Π that contains a set of prescribedvertices and that avoids another set of vertices. We show that this problem is NP-complete for every“interesting” hereditary property Π. We extend the hardness result to some specific edge version ofthe extension problem.
In this paper, we are interested into algorithms that take in input an arbitrary graph G , and thatenumerate in output all the (inclusion-wise) maximal “subgraphs” G of G that fulfil a given propertyΠ. All over this paper, we study several different properties Π, which all are hereditary and recognisablein polynomial time. The input graph G will never be restricted to a specific class of graphs. The notionof subgraph under consideration (induced or not) will vary from a result to another.In some applications, for example database search [38], network analysis [21], or bioinformatics [13,29], the classical combinatorial approach consisting in finding one single optimal solution is not completelyrelevant, because the most useful answer is the list of all solutions, instead of a single one. This leadto the design of enumerating algorithms. In particular, many algorithms have been developed to findspecific maximal subgraphs such as maximal independent sets [32, 1], spanning trees [31, 17], or maximalmatchings [33, 34] to name a few (a more exhaustive list can be obtained in Wasa’s survey [35]). For allthese problems, the algorithms which were designed are very efficient: they run in polynomial delay andusually only require polynomial space. More recently, authors started to look at more general subgraphs.For example, Calamoneri et al. [3] considered maximal chain graphs in a bipartite graph, and Conte etal. [8, 9] considered several graph classes such as maximal chordal graphs, maximal bipartite graphs, ormaximal k -degenerate graphs inside an arbitrary graph.As we are potentially dealing with a large number of objects, the classical notion of efficiency of analgorithm is no longer relevant. It is often the case that the number of solutions is exponential in the size ∗ This research was partially financed by the French government IDEX-ISITE initiative 16-IDEX-0001 (CAP 20-25). -A. Lagoutte and A. Mary are supported by ANR Project GrR (ANR-18-CE40-0032) a r X i v : . [ c s . D M ] J u l f the input, hence it is hopeless to look for polynomial time algorithms. In the following we will expressthe complexity of the algorithms in terms of the input size and the output size. Such an approach isoften called output sensitive in the literature (in opposition to input sensitive where only the input size istaken into account). For that reason, several complexity classes were introduced by Johnson et. al. [24]to capture the notion of efficiency for enumeration algorithms. The natural translation of polynomialtime complexity into the field of enumeration problems is called output polynomial: an algorithm is saidto be output polynomial if the time necessary to list all the objects depends polynomially on the size ofthe input and the size of the output. However, this notion is not completely satisfying: since we dealwith a large number of objects, the time to produce the first solution might sometimes be exponentialin the input size. For this reason, a refinement of the class was introduced: an algorithm is said tobe incremental polynomial when the time necessary to produce a new solution depends polynomiallyon the size of the input and the number of solutions which have already been found. It is possible tofurther refine this notion by eliminating the dependence on the number of already found solutions. Analgorithm is said to be polynomial delay when the time necessary to produce a new solution is boundedby a polynomial in the size of the input.The enumeration of some maximal induced subgraphs is related to another important problem inenumeration, namely the enumeration of minimal transversals of an hypergraph. This problem is alsoknown as the dualisation of monotone boolean formulas. The best algorithm for this problem is dueto Fredman and Khachiyan [16] and runs in quasi-polynomial time. Enumerating the maximal inducedsubgraphs of a hereditary class of graphs is equivalent to finding all the minimal subsets of vertices thatintersect all the minimal forbidden induced subgraphs contained in the original graph.Thanks to the result of Eiter et. al. [14] on the enumeration of minimal transversals of hypergraphsof bounded edge size, it is straightforward to obtain an incremental algorithm for the enumeration ofmaximal induced subgraphs lying in C , where C is a hereditary class of graphs characterised by a finitenumber of forbidden subgraphs. Indeed, a minimal transversal of the hypergraph formed by the forbid-den subgraphs corresponds to a minimal set of vertices, of which the removal from the original graphyields a maximal subgraph in the desired class C . If in addition the considered class C is monotone ( i.e. closed under edge removal), the maximal subgraphs can be obtained in a similar way.The study of such enumeration problems gave rise to efficient algorithmic frameworks such as Reversesearch introduced by Avis & Fukuda [1]. Reverse search provides a general strategy to explore the spaceof solutions. Another useful technique called
Binary partition or sometimes
Flashlight [31] relies on whatwe call the extension problem . For maximal induced subgraphs, Cohen et al. [7] devised an interestingframework which manages to link the complexity of enumerating maximal induced subgraphs that fulfila hereditary property Π to the complexity of a so-called restricted problem , defined as follows. Given agraph H that fulfils a hereditary property Π and an additional vertex v not in H that is connected to somevertices in H , the restricted problem consists in asking for the list of all the maximal induced subgraphsof H + v that fulfil property Π. If the restricted problem admits a polynomial number of solutions(and if these solutions can be found in polynomial time), then a polynomial delay and polynomial spaceenumeration algorithm can be derived for the general problem. They also present analogous results forincremental and output polynomial time algorithms, which we will not develop here.Recently, Conte & Uno introduced a new framework called Proximity Search [9]. This frameworkis well-suited for enumerating maximal subgraphs, coping with some of the limitations of the restrictedproblem approach, but does not always guarantee polynomial space.The results of this paper split into two categories: first, polynomial delay enumeration algorithmsthat are summarised in Table 1 (and contextualised in the following of this introduction) ; secondly,negative results concerning the extension problem.For all the provided algorithms, we fix a property Π and a notion of “subgraph” (resp. “supergraph”)and the goal is, given an arbitrary input graph G , to enumerate all inclusion-wise maximal “subgraphs”(resp. minimal “supergraphs”) of G . Each property Π under consideration is hereditary and recognisablein polynomial time, and moreover corresponds to a very structured class of graphs, all of which beingsubclasses of perfect graphs. Because of the multiple applications of chordal graphs and cographs,we focused on them and designed algorithm when Π describes cographs, and when it describes somesubclasses of graphs that are both chordal and cographs: P -free graphs, threshold graphs, and triviallyperfect graphs; and also when Π describes split graphs, which are chordal graphs but not-necessarily2rop. Π: Max. induced subgraphs Max. edge-subgraphs Min. edge-supergraphsbeing a.... also called min. deletions also called min. completionssplit graph poly. delay, poly. space poly. delay, poly. space poly. delay, poly. spaceCao [4] Theorem 2 Theorem 2 via restricted problem via self-complementarity via ad-hoc bijectioncograph poly. delay poly. delay poly. delayTheorem 4 Theorem 5 Theorem 5 via Proxi. Search via Proxi. Search via self-complementarity P -free graph poly. delay, poly. space poly. delay poly. delayCao [4] Theorem 6 see Observation 1 via restricted problem via Proxi. Search trivialthreshold poly. delay, poly. space poly. delay poly. delaygraph Cao [4] Theorem 7 Theorem 7 via restricted problem via Proxi. Search via self-complementaritytrivially poly. delay, poly. space poly. delayperfect graph Cao [4] Theorem 8 ? via retaliation-free paths via Proxi. Search Table 1: Summary of known and new algorithms that, given an input graph G , enumerate all maximal“subgraphs” (or minimal supergraphs) of G that fulfil a property Π, where Π describes a subclass ofcographs or a subclass of chordal graphscographs. Although polynomial delay algorithms are already known for the enumeration of minimalchordal deletions and maximal induced chordal subgraphs [9], it would be of great interest to providesuch an algorithm for minimal chordal completions, also known as minimal triangulations.Observe that all the aforementioned properties Π are closed under adding isolated vertices. Hence,given a graph G , all inclusion-wise maximal subgraphs fulfilling Π must contain all vertices of G . Inother words, all the subgraphs under interest can be described by the set of edges that are removedfrom G , hence we will call them edge-subgraphs , or deletions of G . In the same fashion, when all cliquesfulfil property Π, it is of interest to study the opposite operation: add edges to G in order to get anedge-supergraph of G fulfilling Π. This will be called a Π -completion of G . It is straightforward toobserve that enumerating all minimal deletions of G that fulfil property Π is equivalent to enumeratingall minimal completions of G that fulfil property Π. So, when Π is closed under complement, we mightchoose to study one problem or the other, depending on which seems easier to visualise.Notice that some properties Π considered in this article have already been studied in the light ofmaximal induced subgraphs or maximal edge-subgraph: an algorithm to find a single maximal splitedge-subgraph of the input graph has been designed in [22]; and algorithms to find a single maximaledge-subgraph that is a cograph have been given in [12, 28]. As for enumeration, Cao [4] recentlyproved that the above-mentioned restricted problem admits a polynomial number of solutions for severalgraph classes. From this result, he thus obtained polynomial delay and polynomial space algorithms toenumerate all maximal induced subgraphs that fulfil property Π, for most properties Π studied in thisarticle (see Table 1).In Section 3, we focus on the case where Π describes split graphs: we provide an efficient algorithmto enumerate all minimal split completions of a given input graph G , by establishing a bijection betweenthem and the maximal stable sets of an auxiliary graph built from G .In Section 4, the desired property Π refers to being a cograph. At first sight, one may hope toenumerate all maximal induced subgraphs that are cographs by using the restricted problem; however,it turns out that the restricted problem in this case may have an exponential number of solutions, henceit cannot be used to derive a polynomial delay algorithm. Fortunately, in both versions of the problem(induced subgraphs or edge-subgraphs), we are able to adapt the Proximity Search framework mentionedabove, recently introduced by Conte & Uno [9]. In order to make it work, we rely on the constructionordering with true and false twins. We generalise this approach in the edge-subgraph version (minimaldeletions).The approach developed for cographs can be extended to some sub-classes, such as P -free graphsin Section 5: we obtain a polynomial delay algorithm to enumerate all minimal P -free deletions of the3nput graph. Since P -free graphs are not closed under complement, this does not give an enumerationalgorithm for minimal P -free completions. However, it turns out that there is a single minimal P -freecompletion for any input graph G , which gives a trivial polynomial time algorithm (see Observation1). With those two algorithms, one can trivially enumerate all minimal completions or deletions in thecomplement class, namely ( K + K )-free graphsFollowing the same outline as for cographs, we obtain in Sections 6 and 7 polynomial delay algorithmsto enumerate all minimal threshold deletions, and all minimal trivially perfect deletions, respectively.Finally in Section 8 we consider the extension problem. The extension problem is a decision problemthat, if solvable in polynomial time, can be derived into a simple and classical polynomial delay andpolynomial space algorithm called Binary partition or Flashlight for the associated enumeration problem.The maximal induced subgraph extension problem, studied in Subsection 8.1 is the following. Givena graph G , a property Π and two disjoint subsets of vertices A and B of G , does there exist a maximalsubgraph of G that fulfils property Π and contains all the vertices of A and none of B ? We prove thatthe extension problem for maximal induced subgraphs is NP-complete for every nontrivial hereditaryproperty Π (here, nontrivial means that Π is true for infinitely many but not all graphs). This provesthat such a classical strategy cannot be applied to enumerate maximal induced subgraphs.Lastly in Subsection 8.2, we study the extension problem for maximal edge-subgraphs. We were notable to obtain such a general result as the above-mentioned one, however for basic classes that are P k -freegraphs and C k -free graphs for k at least 3, the respective extension problems are both NP-complete. For the remainder of this section, let G be a graph. We denote by V ( G ) the vertex set of G and by E ( G )its edge set. When G = ( V, E ), and if there is no ambiguity, we may use V and E instead of V ( G ) and E ( G ).The neighbourhood of a vertex v in G is denoted N G ( v ) and is defined as N G ( v ) = { w ∈ V ( G ) | vw ∈ E ( G ) } . The closed neighbourhood of a vertex v in G is denoted by N G [ v ] and is equal to N G ( v ) ∪ { v } .When it is clear from the context, the subscript G might be omitted. Two vertices x and y are called twins whenever N ( x ) \ { y } = N ( y ) \ { x } . Two twins are called true twins if there exists an edge betweenthem, or false twins otherwise.Given X, Y two subsets of vertices, the symmetric difference between X and Y , denoted by X Y , isdefined as ( X ∪ Y ) \ ( X ∩ Y ).If X ⊆ V , then G [ X ] denotes the subgraph of G induced by X , that is ( X, E ( G ) ∩ X ) (obtainedfrom G by removing vertices not in X and edges incident to at least one deleted vertex). A graph H isan induced subgraph of G if there exists X ⊆ V such that H = G [ X ]. For X ⊆ V , we might sometimeswrite G \ X instead of G [ V \ X ].A graph H is a subgraph of G if H can be obtained from G by removing some vertices and someedges of G , that is to say if V ( H ) ⊆ V ( G ) and E ( H ) ⊆ E ( G ). If moreover V ( H ) = V ( G ), then H iscalled an edge-subgraph , or else a deletion , of G . By abuse of language, if E ⊆ E ( G ), we might call E adeletion of G , referring to ( V ( G ) , E ). A graph H is called an edge-supergraph of G , or a completion of G , if V ( H ) = V ( G ) and E ( G ) ⊆ E ( H ). Then E ( H ) \ E ( G ) is called the set of fill edges .A graph property Π is called hereditary when it is closed under vertex removal. In other words, ifthe property is fulfilled by the graph we consider, then it is fulfilled by all its induced subgraphs. Allthe properties considered in this paper are hereditary. A graph property is called monotone when it isclosed under both edge removal and vertex removal. That is to say, if the property is fulfilled by G , thenthe property is fulfilled by all subgraphs of G . A property Π is called sandwich monotone [23] if, for anytwo graphs G and H on the same vertex set V , that both fulfil the property Π, and such that H is anedge-subgraph of G , there exists a sequence of edges s = ( e , e , . . . , e k ) of E ( G ) \ E ( H ) such that: forany 1 ≤ i ≤ k , the graph ( V, E ( H ) ∪ s i ) fulfils the property Π, where s i = { e , . . . , e i } .A graph H is a Π -edge-subgraph of G , also called a Π -deletion of G , if it is an edge-subgraph of G and itfulfils property Π. It is called a maximal Π-edge-subgraph, or a minimal
Π-deletion, if it is inclusion-wisemaximal, that is to say there is no Π-edge-subgraph H of G such that E ( H ) (cid:40) E ( H ) ⊆ E ( G ). Similarly,a graph H is a Π -edge-supergraph of G , also called a Π -completion of G , if it is an edge-supergraph and G and it fulfils property Π. It is called a minimal Π-edge-supergraph of G , or minimal Π-completion, ifit is inclusion-wise minimal: there is no Π-supergraph H of G such that E ( G ) ⊆ E ( H ) (cid:40) E ( H ). When4 refers to being in some known class of graphs, say being a split graph, we will omit the hyphen andsimply say: a split edge-subgraph, a split deletion, a minimal split deletion, and so on.All over this paper, maximal (resp. minimal ) will always refer to inclusion-wise maximal (resp.minimal), and never to maximum (resp. minimum) cardinality. Split graphs [15, 19] are graphs whose vertex set can be partitioned into two sets K and S , , where K isa clique of G and S is an independent set. This partition K + S is called a split partition of the graph,and is not necessarily unique. Split graphs can also be characterised as ( C , K , C )-free graphs. Thisclass of graphs is self-complementary, meaning that for any split graph G , its complement G is also split.Split graphs have been studied in detail in [22] in order to find one single minimal split completionof a given graph, and in [4] to enumerate all maximal split induced subgraphs. Our aim here is toenumerate all minimal split completions of G into a split graph, using a polynomial delay polynomialspace algorithm.Recall that a minimal split completion of a graph G is an inclusion-wise minimal split supergraphof G on the same vertex set; that is to say a split graph H such that V ( H ) = V ( G ), E ( G ) ⊆ E ( H ),and there exists no split graph H = ( V ( G ) , E ( H )) such that E ( G ) ⊆ E ( H ) (cid:40) E ( H ). Every edge in E ( H ) \ E ( G ) is called a fill edge .Since the class of split graphs is self-complementary, we can list all maximal split deletions of G simply by computing all minimal split completions of the complement graph G , and then complementingthe solutions.First, note that a split completion of G can always be obtained from a stable set. Indeed, if S is astable set of G , adding all possible edges between pairs of vertices of V \ S makes V \ S into a clique,and the resulting graph is a split completion H of G . We will say that H is the split completion induced by S . In the sequel we will see how to characterise the stable sets which will produce different minimalsplit completions. Lemma 1.
Let G = ( V, E ) be a graph. For any minimal split completion H of G , there exists a splitpartition V = K + S of H such that S is a maximal stable set of G .Proof. Let H be a minimal split completion of G . The graph H is split so there exists a split partition,and H = ( S + K, E + F ) (where F is the set of fill edges). If S is not a maximal stable set of H ,there exists x ∈ V such that S ∪ { x } is a stable set of H , and of course K \ { x } is still a clique of H .Consequently, suppose that S is a maximal stable set of H .For contradiction, suppose that S is not a maximal stable set of G . There exists y such that S ∪ { y } is a stable set of G . As S ⊆ S ∪ { y } , the split completion induced by S ∪ { y } is a split sub-completionof H , supposed to be minimal. Therefore S ∪ { y } is a stable set of H , that is, S is not a maximal stableset of H : contradiction.Hence it is only necessary to consider (inclusion-wise) maximal stable sets when looking for minimal split completions.In the following, we identify two kinds of vertices which can cause a solution to be non-minimal orproduced twice. They are true twins and redundant vertices , the definition of which relies on nestedneighbourhoods. Definition 1 (Redundant vertices) . Let G = ( V, E ) be a graph. A vertex v ∈ V is redundant if thereexists u ∈ V such that N [ u ] (cid:40) N [ v ] . Remark that, because of the strict inclusion between the closed neighbourhoods, for every redundantvertex v there exists a vertex u which is not redundant such that N [ u ] (cid:40) N [ v ]. The set N [ u ] is inclusion-wise minimal. The interest of identifying redundant vertices is given by the following observation (astronger version of this will be proved in Lemma 2): if S is a maximal stable set of G not inducing aminimal split completion, then S contains a redundant vertex. However, the converse is not necessarilytrue, as shown on Figure 1: this graph admits a maximal stable set S = { , } containing redundantvertices (2, 4, and 5 are redundant vertices), still inducing a minimal split completion. Hence, we need5o push further to identify which redundant vertices should be avoided in a stable set S in order for theinduced completion to be minimal. Figure 1: In this graph, the vertices 2 and 5 are redundant but the completion induced by the stable set { , } is minimal.The right characterisation of minimal split completions is in fact the following: Lemma 2.
Let G be a graph, let I be a maximal stable set of G . The split completion of G induced by I is minimal if and only if I does not contain any redundant vertex x such that V \ N ( x ) is a stable setof G . In order to prove Lemma 2, we need the following lemma which establishes a link between the splitpartitions of a graph and those of its subgraphs. In particular it can be used to compare two different splitpartitions of a split graph. This result will be invoked when characterising non-minimal split completions.
Lemma 3 ([22, Observation 4] & Corollary) . Let G = ( V, E ) and G = ( V, E ) be two split graphs suchthat E ⊆ E , and let V = I + K and V = I + K be split partitions of G and G respectively. Then thefollowing two inequalities hold: • | K ∩ K | ≥ | K | − ; • | I ∪ I | ≤ | I | + 1 . Lemma 4.
Let G = ( V, E ) be a graph. Let I be a maximal stable set of G . If the split completion of G induced by I is not minimal, there exists a redundant vertex w ∈ I such that N ( w ) = V \ I .Proof. Let I be a maximal stable set of G , let H = ( I + C, E + F ) be the split completion of G inducedby I . Assume that the completion H is not minimal. Then there exists a nonempty set of edges A ⊆ F such that H − A is a minimal split completion of G . By Lemma 1 there exists a maximal stable set S of G such that H − A = ( S + K, E + F − A ) is the split completion of G induced by S .We have the inclusions G ⊆ H − A ⊆ H . By Lemma 3, | S | ≤ | S ∪ I | ≤ | S | + 1. Because S and I areboth maximal stable sets of G we cannot have I ⊆ S , so necessarily | S ∪ I | = | S | + 1. Then, | S | + 1 = | S ∪ I | = | S | + | I \ S | . Therefore | I \ S | = 1, and we also have | S \ I | > S is maximal. Consequently there exist w ∈ V and U ⊆ V such that I = T ∪ { w } and S = T ∪ U , where U and T = S ∩ I are disjoint stable sets of G .Figure 2 illustrates this situation.All fill edges of H − A are also fill edges of H . Because w is in I , there is no fill edge incidentto w in H , so there is also no fill edge incident to w in H − A . As w ∈ K in H − A , this implies K ∩ C ⊆ N ( w ) ⊆ ( K ∩ C ) ∪ U = C .Let x ∈ U . As I is a maximal stable set of G , the vertex x has a neighbour in I . This neighbour isnot in S because x ∈ S . Therefore, it is in I \ S = { w } , that is, xw ∈ E . Besides, N [ x ] ⊆ K ∩ C ⊆ N [ w ].This being true for all x ∈ U , we have N ( w ) = C = V \ I .Moreover, the completion H is not minimal, so there exists y ∈ U incident to a fill edge of H . Hencethere exists z ∈ C such that yz / ∈ E . Then z ∈ N [ w ] \ N [ y ], so N [ y ] (cid:40) N [ w ] and w is redundant.Lemma 4 admits a converse, which is the following.6 − AK S xw H CI U T
Figure 2: A partition of V for the split completion H and another split partition for H − A . The vertex w is universal to C . Edges inside S ∩ C belong to H but not to H − A . Lemma 5.
Let G = ( V, E ) be a graph. Suppose that there exist a redundant vertex x such that V \ N ( x ) is a stable set of G . If I is a maximal stable set of G containing x , then the split completion induced by I is not minimal.Proof. Let I be a maximal stable set of G containing x . Necessarily I = V \ N ( x ) because V \ N ( x )is a stable set. Let H := ( I + V \ I, E + F ) the split completion induced by I . Since x is redundant,there exists y ∈ V such that N [ y ] (cid:40) N [ x ]. The vertex y is a neighbour of x so y ∈ V \ I . Therefore y isadjacent to every vertex of V \ I in H . But N [ y ] (cid:40) N [ x ], so there exists z ∈ V \ I such that yz / ∈ E . Inthis case, H − { yz ∈ F | z ∈ N ( x ) } is a proper sub-split completion of H . Hence H is not minimal.We can now get the exact characterisation announced in Lemma 2. Proof of Lemma 2.
Lemma 4 gives one direction of implication, and Lemma 5 gives the other (by noticingthat N ( w ) = V \ I rewrites to I = V \ N ( w )).In the light of Lemma 2, the idea is now to remove from G the “bad” redundant vertices identified inthe lemma, and then to only enumerate split partitions induced by maximal stable sets of this auxiliarygraph. But in order to do so, we need to ensure that maximal stable sets in this smaller graph are alsomaximal in G . Lemma 6.
Let G = ( V, E ) be a graph and let R be its set of redundant vertices. For all R ⊆ R , themaximal stable sets of G \ R are maximal stable sets of G .Proof. Let R ⊆ R . Recall that R = { v ∈ V | ∃ u ∈ V, N [ u ] (cid:40) N [ v ] } . All maximal stable sets of G \ R are stable sets of G . We will see that they are maximal.Let S be a maximal stable set of G \ R . For contradiction, assume that S is not a maximal stableset of G . Hence there exists v ∈ V such that S ∪ { v } is a stable set of G , and v ∈ R because otherwise S would not be maximal in G \ R . The vertex v is redundant so there exists u ∈ V \ R such that N [ u ] (cid:40) N [ v ]. This way, S ∪ { u } is a stable set of G and a stable set of G \ R : contradiction.Nevertheless, we are not yet finished. Given a graph G , we know that removing some identifiedredundant vertices from G provides a graph in which every maximal stable set gives a minimal splitcompletion of G , and doing so we guarantee to actually get every minimal spit completion of G . However,nothing prevents us from finding the same solution several times. This phenomenon is illustrated in Figure3, where the stable sets are the sets of circled vertices, and the completion consists only in adding themiddle horizontal edge. To solve this issue, we will characterise stable sets which give the same minimalcompletion, among the ones satisfying conditions of Lemma 2. This time, the vertices at which we arelooking are true twins . This leads us to the following: two distinct maximal stable sets induce the samesplit completion if and only if their symmetric difference is a pair of true twins. More precisely:7igure 3: The two stable sets represented by circled vertices give the same minimal split completion. Lemma 7.
Let G be a graph, let S and S be two distinct maximal stable sets of G . Denote by H and H the split completions of G induced by S and S respectively. Define S := S ∩ S . Then S and S induce the same split completion (that is to say, E ( H ) = E ( H ) ) if and only if there exists a pair oftrue twins x , x ∈ V such that S = S ∪ { x } and S = S ∪ { x } , with N G [ x ] = N G [ x ] = V \ S .Proof. Let K := V \ S and K := V \ S be cliques in H and H , respectively.Assume S and S induce the same split completion, that is to say E ( H ) = E ( H ). By Lemma 3,we have | S ∪ S | = | S | + 1 and | S ∪ S | = | S | + 1. Then | S = | S and there exists x ∈ S \ S and x ∈ S \ S such that S = S ∪ { x } and S = S ∪ { x } .There is no fill edge incident to x in H . But because x ∈ K , we have K ∩ K ⊆ N G ( x ) ⊆ ( K ∩ K ) ∪ { x } . Moreover x x ∈ E ( G ), otherwise S ∪ S would be a stable set of G containing S ,assumed to be maximal. This implies that N [ x ] = V \ S . By symmetry of the roles of x and x , itgives N [ x ] = N [ x ] = V \ S , and in particular x and x are true twins.Conversely, as N [ x ] = N [ x ] = V \ S , there is no fill edge incident to x in H , and there isno fill edge incident to x in H . Consequently, the only fill edges in H and in H are betweenvertices of V \ S = K ∩ K . Since H and H are both split, they have the same set of fill edges, so E ( H ) = E ( H ).Inspired by Lemmas 2 and 7, we can then construct from every graph G an auxiliary graph f ( G ).Let B = { x ∈ V ( G ) | x is redundant and V \ N ( x ) is a stable set } . First remove B from G , and observethat G [ V \ B ] had no extra pair of true twins compared to G itself. Then from G [ V \ B ], remove all butone vertex from each set of pairwise true twins, resulting in the graph f ( G ) having no pair of true twins.The auxiliary graph f ( G ) is not unique because of the choice between pair of true twins, but is does notmatter for the following. Theorem 1.
Let G be a graph. There exists a bijection between the set of all minimal split completionsof G and the set of all maximal stable sets of any auxiliary graph f ( G ) .Proof. Let B as in the definition of f ( G ). Observe that G [ V \ B ] cannot contain a redundant vertex x of which the non-neighbourhood in G [ V \ B ] is a stable set, and the same applies to f ( G ). Moreover,a set I ⊆ V ( f ( G )) is a maximal stable set of f ( G ) if and only if it is a maximal stable set of G [ V \ B ]included in V ( f ( G )) (because adding a true twin to an existing vertex in f ( G ) preserves the maximalityof I ). So, by combining Lemmas 6 and 2, a set I ⊆ V ( f ( G )) is a maximal stable set of f ( G ) if andonly if the split completion induced by I is a minimal split completion of G . This, combined with thenon-existence of true twins in f ( G ) and Lemma 7, ensures the bijection.The following procedure produces the auxiliary graph f ( G ) mentioned in Theorem 1, containing noredundant or true twin vertex v such that V \ N ( v ) is an independent set. Procedure 1.
Construction of the auxiliary graph.
Input : a graph G Output : the auxiliary graph f ( G )
1. Mark redundant and true twin vertices: • Begin with all vertices unmarked. • For each unmarked x ∈ V , search the list of unmarked y ∈ N ( x ) . If N [ x ] ⊆ N [ y ] , mark y .2. For each marked vertex x , f V \ N [ x ] is a stable set of G , then remove x . During Step 1, every redundant vertex will be marked, as well as all but one vertex of each set ofpairwise true twin vertices.Theorem 1 ensures that we can enumerate exactly once every minimal split completion of an inputgraph G by running Procedure 1 followed by an algorithm that enumerates all maximal stable sets of f ( G ). Since Procedure 1 is polynomial in time and in space, the complexity of this algorithm onlydepends on the complexity of the algorithm used for the enumeration of maximal stable sets. We arelooking for such an algorithm running in polynomial delay and polynomial space. For example, thealgorithm given in [32] fulfils these complexity requirements and allows to state the following. Theorem 2.
Minimal split completions of a graph can be enumerated in polynomial delay and polynomialspace.
According to Lemma 1, the number of maximal split completions of a graph G is at most the numberof its maximal stable sets. It is proven in [30] that this number can be as large as 3 n/ , reached for agraph built from n/ . . . Figure 4: A graph built from n/ G with no redundant vertex u suchthat V ( G ) \ N ( u ) is a stable set. The graph presented in Figure 4 verifies this property. Theorem 3.
The upper bound n/ on the number of minimal split completions is tight. Cographs (see [10]) can be constructed recursively using disjoint union and complement. Their charac-terisations are various and numerous: also known as P -free graphs, cographs benefit from a unique treerepresentation, the cotree . Because of this, cographs can be recognised in linear time [11].An induced sub-cograph of G is an induced subgraph that is also a cograph; and it is moreover maximalif it is inclusion-wise maximal among all induced sub-cographs of G . To the best of our knowledge, nopolynomial delay algorithm is yet known for the enumeration of maximal induced sub-cographs of agraph. This is why we present enumeration algorithms for both maximal induced sub-cographs andminimal cograph deletions, relying on the same principle. In the case of cographs, the restricted problem defined in [7, 26] cannot be solved in polynomial time.Indeed, the graph G of Figure 5 verifies that G − v is a cograph, whereas removing one vertex among { x i , y i } for all 1 ≤ i ≤ k produces a maximal induced sub-cograph of G . This way, we obtain 2 k maximalinduced sub-cographs of G , which implies that the restricted problem has an exponential number ofsolutions in this case. Hence, the approach presented in [7] cannot be used to produce a polynomialdelay algorithm for the enumeration of maximal induced sub-cographs.Nevertheless, adding one vertex to a cograph produces a polynomial number of induced P . In thiscase, the results presented in [25] can be used to obtain an incremental polynomial algorithm for theenumeration of maximal induced sub-cographs. We show here that this time complexity can be improvedto polynomial delay with the Proximity Search introduced in [9].Proximity Search will also be used in the next subsection to enumerate all minimal cograph deletionsof a given graph. 9 x x k y y y k . . .v Figure 5: The graph G − v is a cograph, and G has an exponential number of maximal induced sub-cographs.As many enumeration paradigms (for example [1, 7]), Proximity Search relies on an organised walkamong all solutions. The general idea is to go from a solution to another using a problem-specifictransition operation, which cannot be reversed in general, thus implicitly building a directed solutiongraph (the vertices of which are all wanted solutions of the problem). Showing that the solution graph isstrongly connected, by showing we can increase the proximity to a target solution at each step, ensuresthat the search will go trough every solution: all of them will be enumerated.There are three major requirements to apply Proximity Search. • A notion of proximity ˜ ∩ between two solutions. This proximity does not need to induce a distancebecause it is not symmetric in general, but it must satisfy | S ˜ ∩ S | = | S | ⇒ S = S . • A function neighbours , computing in polynomial time all (out-)neighbours of a given solution.In particular, every solution has a polynomial number of neighbours. • A function complete , adding elements to a given solution, in order to produce a maximal one.The use of this function is mostly hidden in the computation of neighbours . Therefore, thefunction complete needs to be computable in polynomial time.The general
Proximity Search algorithm is the following.
Algorithm 1.
Proximity Search [9]
Input : a graph G , an enumeration problem P Output : all (maximal) solutions of P in G S ← ∅
2. Let S be an arbitrary solution of P .3. Run enum ( S, S ) .Function enum ( S, S ) :1. S ← S ∪ { S } Output S if recursion depth is even.
2. For each S ∈ neighbours ( S ) do:if S / ∈ S , then enum ( S , S ) Output S if recursion depth is odd. For all S , neighbours ( S ) is the set of solutions that are neighbours of S . As discussed earlier, thesesolutions are obtained via a transition operation which is specific to the problem. To obtain a polynomialdelay algorithm, we need to be able to compute all neighbours of S in time polynomial in n for all S .This ensures that the function enum called in the algorithm will be polynomial.Note that it is also necessary to be able to find one first solution in polynomial time to have apolynomial delay algorithm. Plus, if exponential space is allowed, it is possible to test in linear time if S ∈ S , using a dictionary in which insertion and verification (Step 2) are possible in time polynomial inthe size of S . With all these elements, Algorithm 1 run in polynomial delay.10ll cographs can be constructed from an isolated vertex by adding true or false twins, as shown in[10]. From such a construction, we obtain an order v . . . v n on the vertices of a cograph G , such thatfor all j ∈ { , . . . , n } , v j has at least one (true or false) twin in G [ v , . . . , v j ]. Every maximal inducedsub-cograph can then be identified with an ordered set of vertices; this will be done in the sequel.To define if two solutions are “close” (high proximity) or not, it seems natural to compare their twinconstruction orderings, but these orderings are not unique; the first thing to do is then to make themcanonical.Remark that, as the class of cographs is hereditary, the greedy complete function which adds onevertex a a time while the result is a cograph can be used, and it runs in polynomial time (because therecognition algorithm for cographs does). Hence, to use Proximity Search on the class of cographs, weneed: • a canonical ordering of V ( G ) for each induced sub-cograph G of G , based on an arbitrary orderingof the vertices of G ; this canonical ordering is then used to define the proximity between twomaximal induced sub-cographs; • a neighbouring function , enabling to go from one maximal induced sub-cograph S to some othermaximal induced sub-cographs, among which one will provably be closer to a target solution, bycontaining a well-chosen vertex x / ∈ S .Let G be a graph for which we want to enumerate all maximal induced sub-cographs. Let u , . . . , u n be an arbitrary order on the vertices of G ; u i is said to be smaller than u j if i < j . Definition 2 (Canonical ordering for induced cographs) . The canonical ordering of an induced sub-cograph S of G is the lexicographically smallest twin construction ordering of S , with respect to u , . . . , u n .In particular, it is a sequence v . . . v k of vertices of G such that v is the smallest vertex of G belongingto S . The canonical ordering defined above enables us to define a notion of proximity between two solutions S and S as follows. Definition 3 (Proximity for maximal induced sub-cographs) . Let S and S be two solutions, i.e. twomaximal induced sub-cographs of G . Denote k = | S | and consider v . . . v k the canonical ordering of S .The proximity S ˜ ∩ S between S and S is the longest prefix v . . . v i of the canonical ordering of S suchthat { v , . . . , v i } ⊆ S . In this case, | S ˜ ∩ S | = i . Note that this notion of proximity is not symmetric and the only solution S maximising S ˜ ∩ S is S itself.The next step is to define a neighbouring function, called neighbours , to construct the solutiongraph. To define neighbours , we use a greedy function complete , following the arbitrary ordering u , . . . , u n , to complete any sub-cograph into a maximal one, as already mentioned.Recall that for all S , the cardinality of neighbours ( S ) must be polynomial in n . For simplicity of notation, we mightsometimes refer to S as a set of vertices instead of a graph (without introducing any ambiguity on theset of edges, since we are only considering induced subgraph of G in this subsection). Neighbouring function.
Let S be a maximal induced sub-cograph. For all x / ∈ S and all y ∈ S , define S xy := complete (( S \ ( N G ( x ) N S ( y ))) ∪ { x, y } ) Then let neighbours ( S ) := (cid:8) S xy | x / ∈ S, y ∈ S (cid:9) . Each solution has at most a quadratic number ofneighbours. The idea behind this definition of neighbouring function is to add vertex x and make sure that x and y become twins (true or false according to their adjacency) in S xy . The neighbouring function for inducedsub-cographs is illustrated in Figure 6. Circled vertices represent the elements of ( N G ( x ) N S ( y )), twoof which are in S , so are removed so that x and y become twins in ( N G ( x ) N S ( y ))) ∪ { x, y } . The canonical ordering is not actually used in the procedure but it can be found in polynomial time from the cotreeassociated to S . y xy S \ ( N G ( x ) (cid:52) N S ( y )) ∪ { x, y } xy complete S (cid:48) xy S Figure 6: Illustration of the neighbouring function for maximal induced sub-cographs.
Lemma 8.
For every maximal induced sub-cograph S , and for every x / ∈ S , y ∈ S , the graph S xy is amaximal induced sub-cograph of the input graph G .Proof. Let ˆ S := ( S \ ( N G ( x ) N S ( y ))) ∪ { x, y } and suppose that ˆ S is not a cograph. Then there isan induced P in ˆ S . Remark that ˆ S \ { x } is a cograph, as an induced subgraph of the cograph S .Hence necessarily x participates to this newly-induced P , and y does not because it is twin with x . Butsubstituting x for y produces an induced P in ˆ S \ { x } , which is excluded. Therefore ˆ S is a cograph.The function complete , when given an induced sub-cograph of G , returns a maximal one. Conse-quently, S xy is indeed a maximal induced sub-cograph of G .The previous lemma guarantees that the neighbouring function is well-defined and that all neighboursof a solution are also solutions. Now that we have a solution graph, it remains to show that this solutiongraph is strongly connected; in other words, that every solution can be reached from any other one byincreasing proximity at each step. Lemma 9.
Let S and S ∗ be two distinct maximal induced sub-cographs of a given graph G . There exist x / ∈ S and y ∈ S such that S xy is a maximal induced sub-cograph of G , satisfying | S xy ˜ ∩ S ∗ | > | S ˜ ∩ S ∗ | .Proof. Denote by v ∗ , . . . , v ∗ l the canonical ordering of S ∗ .If | S ˜ ∩ S ∗ | = 0, then v ∗ / ∈ S . Let y ∈ S , then v ∗ ∈ S v ∗ y and | S v ∗ y ˜ ∩ S ∗ | ≥ > | S ˜ ∩ S ∗ | .Else, let k be the smallest index such that v ∗ k / ∈ S (in this case we have | S ˜ ∩ S ∗ | = k − i < k such that v ∗ k and v ∗ i are twins in S ∗ [ v ∗ , . . . , v ∗ k ]. By minimality of k , v ∗ i is a vertex of S .Consider S v ∗ k v ∗ i . It is a cograph by Lemma 8. It remains to show that S v ∗ k v ∗ i contains v ∗ , . . . , v ∗ k . Forcontradiction, assume that there exists j ∈ { , . . . , k − } such that v ∗ j / ∈ S v ∗ k v ∗ i . Since { v ∗ , . . . , v ∗ k − } ⊆ S ∩ S ∗ , it implies that v ∗ j ∈ N G ( v ∗ k ) N S ( v ∗ i ).But by definition of the canonical ordering of S ∗ , v ∗ i and v ∗ k are twins in G [ v ∗ , . . . , v ∗ k ], so no vertex of { v ∗ , . . . , v ∗ k } can be in N G ( v ∗ k ) N G ( v ∗ i ). Therefore, S v ∗ k v ∗ i contains v ∗ , . . . , v ∗ k .Consequently, | S v ∗ k v ∗ i ˜ ∩ S ∗ | ≥ k > | S ˜ ∩ S ∗ | .By Lemma 9, it is possible to apply Proximity Search on induced cographs. Algorithm 1 can thenbe used to enumerate all maximal induced sub-cographs in polynomial delay, hence the following. Theorem 4.
Maximal induced sub-cographs of a graph G can be enumerated in polynomial delay, andexponential space. We show here that Proximity Search can also be used for the enumeration of minimal cograph deletions.Since the class of cographs is stable under complement, the enumeration of minimal cograph completionsis equivalent to the enumeration of minimal cograph deletions. Although the class of cographs is not sandwich-monotone [23], strongly accessible [8], or even weakly accessible [8], it is possible to produce apolynomial complete function for cographs relying on successive calls to the cograph sandwich algorithm of [20]. 12ecall that a cograph deletion of G is subgraph S of G such that S is cograph. A cograph deletion ismoreover minimal if the subgraph is inclusion-wise maximal among all sub-cographs of G . Since cographsare closed under adding isolated vertices, any minimal cograph deletion S satisfies V ( S ) = V ( G ). Hence,there will never be any ambiguity on the vertex set, so S will often be used to denote both the subgraphand its set of edges E ( S ) ⊆ E ( G ).The sandwich problem [20] is a decision problem defined as follows. We are given a graph propertyΠ, and two graphs G = ( V, E ) and G = ( V, E ) on the same vertex set such that E ⊆ E , whichboth typically do not satisfy property Π. The question is to determine whether there exists a graph G = ( V, E ) satisfying Π such that E ⊆ E ⊆ E . A polynomial algorithm answering this question forcographs is provided in [20], and called a sandwich algorithm in the sequel.To produce a polynomial complete function for cographs, we will make several calls to the sandwichalgorithm, growing G at each step. The procedure is the following. At the beginning, consider G thesub-cograph of G we want to complete, and try growing G one edge e at a time: if the algorithm returns true when called with G := G + e and G := G , and then let G := G + e and continue addingedges. When the sandwich algorithm returns false for all remaining edges (which will happen because G is not a cograph), it means that G is a maximal induced sub-cograph of G . Observe that G may notbe a cograph during the whole procedure, but it is always included in a maximal sub-cograph (hence itmust be a cograph when the procedure stops).As for the induced problem, it remains to define a canonical ordering of a solution, a notion of proximitybetween two solutions, and a neighbouring function to go from one solution to some others. These willallow us to use Proximity Search for the enumeration of minimal cograph deletions of a graph.The canonical ordering for minimal cograph deletions relies on the twin construction ordering of acograph previously defined and used for maximal induced sub-cographs. As before, let then u , . . . , u n be an arbitrary ordering of the vertices of G . For a solution S , the canonical ordering of its vertices isthe smallest twin construction ordering for the lexicographic order associated to u , . . . , u n . Definition 4 (Canonical edge ordering for minimal cograph deletions) . Let G be a graph and let S be aminimal cograph deletion of G . Let v , . . . , v n be the canonical ordering of the vertices of S .Order each edge v j v i such that i < j and take the smallest lexicographic order on the ordered edges.This gives the canonical ordering on the edges of S . An example of the edge canonical ordering is illustrated in Figure 7.
13 2 4
Figure 7: The canonical ordering of the vertices of this graph is 1 , , ,
3. The canonical ordering of itsedges is given by 21 , , , Definition 5 (Proximity for minimal cograph deletions) . Let S and S be two solutions of the minimalcograph deletion problem. The proximity S ˜ ∩ S between S and S is the longest prefix of the canonicaledge ordering of S which is included in S . For this notion of proximity, it also holds that S is the only solution maximising proximity with itself.Now, let us define a neighbouring function for minimal cograph deletions. The idea is the same as formaximal induced sub-cographs: for each pair of vertices, try to make them twins and complete. Neighbouring function.
Let G be a graph, and let S be a minimal cograph deletion of G . For x and y two vertices of G , build a new subgraph e S xy of G in which x and y will be twins. For any vertex s ,define two sets E S ( s ) := { st | t ∈ N S ( s ) } and E G ( s ) := { st | t ∈ N G ( s ) } . Now, consider the followingsets of edges of G : . e E ( x ) := E S ( x ) ∩ { xw | w ∈ N G ( y ) } ;2. e E ( y ) := E G ( y ) ∩ { yw | w ∈ N S ( x ) } ;3. for all v ∈ N S ( y ) such that vy / ∈ e E ( y ) , e E ( v ) := ∅ ;4. for every other vertex v , e E ( v ) := E S ( v ) \ { vw | e E ( w ) = ∅ } .Define e S xy := complete (cid:18) S v ∈ V e E ( v ) (cid:19) , and let neighbours ( S ) := { e S xy | x, y ∈ V } . Each solution hasa quadratic number of neighbours. This operation is not symmetrical in x and y ( i.e. e S xy = e S yx in general). An illustration of theneighbouring function is presented in figure 8, before completion. Edges with a cross on them areremoved during the process, and the red edge is added. Dashed edges are available in G but do notbelong to the considered solution. x xy y Figure 8: Neighbouring function for minimal cograph deletions.
Lemma 10.
For all x , y ∈ V , e S xy is a minimal cograph deletion of G .Proof. We will show that the graph e S induced on V ( G ) by the edge set S v ∈ V e E ( v ) is a cograph. Then the complete function will transform it into a minimal cograph deletion e S xy .For contradiction, assume that e S is not a cograph. Then there exists an induced P in e S . As allvertices of N S ( y ) \ N e S ( y ) are isolated vertices in e S , they do not belong to the induced P . This induced P cannot contain only vertices of A := V \ (( N S ( y ) \ N e S ( y )) ∪ { x } ). Indeed, S [ A ] = e S [ A ] is an inducedsubgraph of S , which is a cograph. Thus the induced P necessarily contains y .Since x and y are twins in e S , if there exists an induced P containing y , there exists an induced P containing x , and not containing both. Replacing y by x in the induced P of e S produces an induced P in e S [ A ] = S [ A ], which is excluded.Hence e S is a cograph and the neighbouring function is well-defined.The following lemma ensures that any solution can be reached from any other by increasing proximityat each step. Lemma 11.
Let S and S ∗ be two distinct minimal cograph deletions of a graph G . There exist x , y ∈ V ( G ) such that e S xy is a minimal cograph deletion of G , satisfying | e S xy ˜ ∩ S ∗ | > | S ˜ ∩ S ∗ | .Proof. Let v ∗ , . . . , v ∗ n be the canonical vertex ordering of S ∗ .The solutions S and S ∗ are distinct and maximal, therefore there exists an edge of G belonging to S and not to S ∗ . Consider v ∗ j v ∗ k the first edge of the canonical edge ordering of S ∗ which does not appearin S . We can assume that j > k . By definition of the canonical edge ordering of S ∗ , v ∗ j has at least atwin in S ∗ [ v ∗ , . . . , v ∗ j ]. Let i be the smallest index such that v ∗ i and v ∗ j are twins in S ∗ [ v ∗ , . . . , v ∗ j ].We will prove that the graph b S v ∗ i v ∗ j satisfies | e S v ∗ i v ∗ j ˜ ∩ S ∗ | > | S ˜ ∩ S ∗ | . To do this it suffices to provethat all edges of S ∗ [ v ∗ , . . . , v ∗ j ] are contained in e S = S v ∈ V e E ( v ).14or contradiction, assume that there exists s < t ∈ { , . . . , j } such that v ∗ s v ∗ t is an edge of S ∗ but notof e S .If t < j , then v ∗ s v ∗ t is an edge of S . Moreover, v ∗ s v ∗ t ∈ E ( S ∗ ) ⊆ E ( G ), which implies v ∗ s ∈ N S ∗ ( v ∗ t ). • If s = i , then v ∗ j v ∗ i ∈ E ( S ) and v ∗ i ∈ N G ( v ∗ j ), so v ∗ j ∈ e E ( v ∗ i ). It is an edge of e S : contradiction. Thesame holds if t = i . • Suppose s, t = i . Since v ∗ s v ∗ t is an edge of S ∗ but not of e S , it means that v ∗ s or v ∗ t is a neighbour of v ∗ j in S – without loss of generality, we can assume v ∗ j v ∗ s ∈ E S ( v ∗ j ) – such that v ∗ s v ∗ j / ∈ e E ( v ∗ j ). Thusby definition of e E ( v ∗ j ), v ∗ s / ∈ N S ( v ∗ i ). This leads to a contradiction, because we assumed i < j , and v ∗ s v ∗ i ∈ S ˜ ∩ e S ⊆ S . Hence v ∗ s v ∗ i / ∈ S and v ∗ t v ∗ i / ∈ S .Then necessarily, t = j .If v ∗ s v ∗ j is in S ∗ but not in e S , it implies v ∗ s v ∗ j / ∈ S . Otherwise we have v ∗ s v ∗ j ∈ E G ( v ∗ j ) and v ∗ s ∈ N G ( v ∗ i ),that is, v ∗ s v ∗ j ∈ e E ( v ∗ j ) ⊆ e S . It implies v ∗ s v ∗ j ∈ S ˜ ∩ S ∗ ⊆ S . As before, this leads to a contradiction.Consequently, all edges v ∗ s v ∗ t of S ∗ with s, t ≤ j are also edges of e S . Hence | e S xy ˜ ∩ S ∗ | > | S ˜ ∩ S ∗ | .Lemma 11 guarantees that Proximity Search is applicable in the case of minimal cograph deletions.Therefore, Proximity Search provides an algorithm for the enumeration of minimal cograph deletions inpolynomial delay, and exponential space. Theorem 5.
Minimal cograph deletions (equivalently minimal cograph completions) of a graph G canbe enumerated in polynomial delay, and exponential space. P -free graphs and their complements P -free graphs are disjoint unions of cliques. They form a particular subclass of cographs, and they havea twin construction ordering where false twins are added first, followed by true twins.As proven in the recent paper [4], the enumeration of maximal induced P -free subgraphs and ( K + K )-free subgraphs is possible in polynomial delay and polynomial space, using the framework of [7].We are interested here in enumerating all minimal completions and deletions of a graph into a P -freegraph.Concerning minimal P -free completions of a graph, remark that there is always a unique solution.Indeed, to complete a graph into a disjoint union of cliques, we have no choice but to turn each of itsconnected components into a clique. Of course, there can exist another P -free completion, but in thiscase two or more connected components are merged into a single clique. All edges added between twoconnected components can be removed at the same time, producing the minimal P -free completionobtained earlier. Observation 1.
For every graph G , there exists a unique minimal completion of G into a P -free graph. Enumerating all minimal P -free completions of a graph G is thus easy and can be done in polynomialtime: it suffices to add all the missing edges to turn all connected components of G into cliques. It isequivalent to enumerate all minimal ( K + K )-free deletions of a graph by enumerating the P -freecompletions of its complement graph.The only remaining problem is the enumeration of minimal P -free deletions. This problem is equiv-alent, in the complement, to the search of all minimal completions into a complete multipartite graph.It is also equivalent to the enumeration of all minimal (w.r.t. inclusion) clique covers of a graph. Unlikethe previous problem, it does not have a unique solution in general.We will show in the sequel how to enumerate minimal P -free deletions of a graph in polynomial delay.The idea is to apply again Proximity Search. In particular, as P -free graphs are cographs, ProximitySearch for cographs can be adapted to P -free graphs.15irst, let us provide a polynomial time complete function. As for general cographs, we will use asandwich algorithm.Let G = ( V, E ) and G = ( V, E ) be two graphs such that E ⊆ E . To determine if there existsa P -free graph G = ( V, E ) between G and G , it suffices to determine whether the minimal P -freecompletion of G is a subgraph of G . Indeed, since the minimal P -free completion is unique, every P -free graph which contains G will also contain its minimal P -free completion.The P -free sandwich algorithm can be run in polynomial time. For each connected component of G , check whether its vertices induce a clique in G . If there exists a component for which it is not thecase, return false . Else return true .With the same idea as for cographs, it is then possible to derive a polynomial complete functionfor P -free graphs.Since every P -free graph has a twin construction ordering where false twins are placed first, let usdefine the canonical vertex ordering of a P -free graph as the lexicographically smallest (with respect tothe pre-defined arbitrary ordering) such ordering.The canonical edge ordering and the proximity are then defined the same way as for cographs. Neighbouring function.
Let G be a graph, and let S be a minimal P -free deletion of G . For x and y two vertices of G such that xy ∈ E ( G ) \ E ( S ) , build a new subgraph e S xy of G in which x and y will be in thesame clique. For any vertex s , define two sets E S ( s ) := { st | t ∈ N S ( s ) } and E G ( s ) := { st | t ∈ N G ( s ) } .Now, consider the following sets of edges of G :1. e E ( x ) := ( E S ( x ) ∩ { xw | w ∈ N G ( y ) } ) ∪ { xy } ;2. e E ( y ) := ( E G ( y ) ∩ { yw | w ∈ N S ( x ) } ) ∪ { xy } ;3. for each v ∈ N S ( y ) , e E ( v ) := { vw | w ∈ N S ( y ) \ { y }} ;4. for each v ∈ N S ( x ) ∩ N G ( y ) , e E ( v ) := { vw | w ∈ ( N S ( x ) ∩ N G ( y )) \ { v }} ∪ { vy } ;5. for each v ∈ N S ( x ) \ N G ( y ) , e E ( v ) := { vw | w ∈ ( N S ( x ) \ N G ( y )) \ { v }} ;6. for every other vertex v , e E ( v ) := E S ( v ) .Define e S xy := complete (cid:18) S v ∈ V e E ( v ) (cid:19) , and let neighbours ( S ) := { e S xy | x, y ∈ V } . Each solution hasat most a quadratic number of neighbours. As for cographs, this operation is not symmetrical in x and y . It is illustrated in Figure 9. Note thatthe neighbouring function does not affect the cliques of S which do not contain x nor y : these remainunchanged at least until the completion step. N S ( x ) N S ( y ) x y N S ( y ) x yS (cid:101) S xy N S ( x ) ∩ N G ( y ) N S ( x ) ∩ N G ( y ) Figure 9: Neighbouring function for P -free graphs. The sets N S ( x ) and N S ( y ) are cliques. Dashededges are available in G but not taken in the solution. Lemma 12. If S is a minimal P -free deletion of a graph G , then for all x , y ∈ V such that xy ∈ E ( G ) , e S xy is a minimal P -free deletion of G .Proof. Suppose that S is a minimal P -free deletion of G . Apply the neighbouring function with twovertices x and y such that xy ∈ E ( G ). In the new graph e S = S v ∈ V e E ( v ), all neighbours of x are also16eighbours of y . The vertices x and y belong to the same clique K , which is disconnected from the restof the graph.Moreover, S \ K is an induced subgraph of a P -free graph, thus it is a P -free graph. Consequently, e S is a P -free graph, and applying the complete function produces a minimal P -free deletion e S xy .Now that we are sure that the neighbouring function is well-defined (all neighbours of a solution arealso solutions), it remains to show that the corresponding solution graph is strongly connected. Thisway, it will be possible to reach any solution from any other, increasing proximity at each step. Lemma 13.
Let S and S ∗ be two distinct minimal P -free deletions of a graph G . There exists an edge xy ∈ E ( G ) such that e S xy is a minimal P -free deletion of G , satisfying | e S xy ˜ ∩ S ∗ | > | S ˜ ∩ S ∗ | .Proof. Let v ∗ , . . . , v ∗ n be the canonical vertex ordering of S ∗ . Denote by v ∗ k v ∗ j , j ≤ k , the first edge of thecanonical edge ordering of S ∗ which does not belong to S . We will prove that | e S v ∗ j v ∗ k ˜ ∩ S ∗ | > | S ˜ ∩ S ∗ | .Suppose that S ∗ = S . There exists an edge v ∗ s v ∗ t , t ≤ s , of S \ S ∗ . Let us prove that this edge doesnot appear before v ∗ k v ∗ j in the canonical edge ordering of S ∗ .Necessarily, v ∗ s v ∗ t has been removed by the neighbouring function. There are two cases. • If v ∗ s ∈ N S ( v ∗ k ) ∩ N G ( v ∗ j ) and v ∗ t ∈ N S ( v ∗ k ) \ N G ( v ∗ j ), then in particular v ∗ j v ∗ t / ∈ G hence v ∗ j v ∗ t / ∈ S ∗ .Since v ∗ k v ∗ j is an edge of S ∗ , the vertices v ∗ k and v ∗ j are in the same clique of S ∗ , and v ∗ j v ∗ t / ∈ S ∗ .Then the edge v ∗ s v ∗ t does not belong to S ∗ .If v ∗ t ∈ N S ( v ∗ k ) ∩ N G ( v ∗ j ) and v ∗ s ∈ N S ( v ∗ k ) \ N G ( v ∗ j ), it is the same.Therefore it does not appear in the canonical edge ordering of S ∗ . • Otherwise, the edge v ∗ s v ∗ t is incident to v ∗ k in S .If t = k , then s > k , and the edge v ∗ s v ∗ k , if it appears in S ∗ , will be placed after v ∗ k v ∗ j in the canonicaledge ordering.If s = k , then t = j . In the case where t > j , the edge v ∗ k v ∗ t , if it appears in S ∗ , will be placedafter v ∗ k v ∗ j in the canonical edge ordering. In the case where t < j , since v ∗ k v ∗ j is the first edge ofthe canonical edge ordering of S ∗ which does not belong to S , the edge v ∗ k v ∗ t is in S ∩ S ∗ . But weassumed v ∗ s v ∗ t ∈ S \ S ∗ . Therefore this last case does not occur.Then, v ∗ s v ∗ t does not appear before v ∗ k v ∗ j in the canonical edge ordering of S ∗ .Hence all edges of S ∗ appearing before v ∗ k v ∗ j belong to S , and v ∗ k v ∗ j also belongs to S . Consequently, | e S v ∗ j v ∗ k ˜ ∩ S ∗ | ≥ | S ˜ ∩ S ∗ | + 1.All conditions are gathered to apply Proximity Search on the class of P -free graphs. This gives thefollowing theorem. Theorem 6.
Minimal P -free deletions of a graph G can be enumerated in polynomial delay, and expo-nential space.Equivalently, minimal ( K + K ) -free completions of a graph G can be enumerated in polynomialdelay, and exponential space. Threshold graphs are at the intersection between split graphs and cographs. Therefore, they are char-acterised by forbidden subgraphs as the class of ( P , C , K )-free graphs. This class is quite commonin the literature (see for example the chapter dedicated to threshold graphs in [19]). Like the split andcograph properties, the threshold property is hereditary and closed under complement.As proven in [6], all threshold graphs can be constructed from a single isolated vertex by adding ateach step either an isolated vertex or a universal vertex, i.e. a vertex adjacent to all other vertices ofthe graph. This construction provides an ordering v , . . . , v n on the vertices of a threshold graph G ,such that for all 1 ≤ i ≤ n , either v i is isolated in G [ v , . . . , v i ], or v i is universal in G [ v , . . . , v i ]. Ifseveral orderings are possible, take the lexicographically smallest, according to an arbitrary order on thevertices, to make it canonical. 17inimal threshold deletions can then be enumerated with the help of Proximity Search. Since theclass of threshold graphs is stable under complement, it is equivalent to enumerate minimal thresholdcompletions as well.Consider the edge canonical ordering induced by the vertex canonical ordering. That is to say, asfor cographs, order the edges of a threshold graph S in a sequence (( v j v i ) i Let G be a graph and let S be a minimal threshold deletion of G . For avertex x of G , we will build a graph e S x in which x is universal in the construction ordering. Define E G ( x ) := { xt | t ∈ N G ( x ) } , and consider the following sets of edges of G :1. e E ( x ) := E G ( x ) ;2. for all v ∈ N G ( x ) , e E ( v ) := { vw | w ∈ N S ( v ) } ∪ { vx } ;3. for every other vertex v , e E ( v ) := ∅ .Let e S x := complete (cid:18) S v ∈ V e E ( v ) (cid:19) . Define neighbours ( S ) := { e S x | x ∈ V } . Each solution has a linearnumber of neighbours. Lemma 14. If S is a minimal threshold deletion of a graph G , then for all x ∈ V , e S x is a minimalthreshold deletion of G .Proof. Let x ∈ V . It suffices to show that e S := S v ∈ V e E ( v ) is a threshold graph.In e S , all non-neighbours of x are isolated vertices. Besides, adjacencies between neighbours of x havenot been modified from S . Moreover, since S is a threshold graph, S [ N G ( x )] is also a threshold graph;the adding of x as a universal vertex in S [ N G ( x ) ∪ { x } ] implies that S [ N G ( x ) ∪ { x } ] is also a thresholdgraph. Therefore, as the union of a threshold graph and isolated vertices is a threshold graph, e S is athreshold graph.It is then possible to apply the polynomial complete function to build e S x , which is a minimalthreshold deletion of G .Once we know that all neighbours of a solution are also solutions, let us prove that the solution graphis strongly connected. Lemma 15. Let S and S ∗ be two minimal threshold deletions of a graph G . There exists x ∈ V suchthat | e S x ˜ ∩ S ∗ | > | S ˜ ∩ S ∗ | .Proof. Let v ∗ , . . . , v ∗ n be the threshold construction ordering of S ∗ , and consider the associated edgecanonical ordering.Let v ∗ k v ∗ i be the first edge of S ∗ which does not appear in S .By definition, the neighbours of v ∗ k in e S v ∗ k are all the neighbours of v ∗ k in G . Necessarily, we have theinclusion N S ∗ ( v ∗ k ) ⊆ N e S v ∗ k ( v ∗ k ). Hence all edge incident to v ∗ k in S ∗ is also present in e S v ∗ k .Moreover, if an edge v ∗ j v ∗ i with j < k is present in S ∗ , then it is also present in S by definition of v ∗ k v ∗ i as the first edge of S ∗ which does not appear in S . Since v ∗ k v ∗ i is an edge of S ∗ , it means that v ∗ k isuniversal in S ∗ [ v ∗ , . . . , v ∗ k ]. Therefore every edge v ∗ j v ∗ i with j < k appearing in S ∗ is an edge joining twoneighbours of v ∗ k in G : it is not removed by the transition operation, so it appears in e S v ∗ k .Hence e S v ∗ k satisfies | e S x ˜ ∩ S ∗ | > | S ˜ ∩ S ∗ | . 18rom these two lemmas, we deduce that minimal threshold deletions are Proximity Searchable, hencethe following theorem. Theorem 7. Minimal threshold deletions (resp. completions) of a graph G can be enumerated in poly-nomial delay, and exponential space. In this section we are interested in enumerating all minimal deletions of a given graph G into a triviallyperfect graph, or equivalently all maximal trivially perfect edge subgraphs of G . Trivially perfect graphs [18, 36], also known as quasi-threshold graphs [37] or ( P , C )-free graphs,form another subclass of cographs. In fact, the class of trivially perfect graphs is composed of all thecographs that are also chordal. An equivalent, constructive definition of this class of graphs is given bythe following rules: • an isolated vertex is a trivially perfect graph; • the disjoint union of trivially perfect graphs is a trivially perfect graph; • adding a universal vertex to a trivially perfect graph results in a trivially perfect graph; • any trivially perfect graph can be obtained by successive applications of these rules.The class of trivially perfect graphs contains all stable sets and is stable under disjoint union. There-fore, the vertex set of any minimal trivially perfect deletion of a graph G has to be the whole vertex set V ( G ).As in the previous sections, the idea is to use Proximity Search to provide a polynomial delay algorithmfor the enumeration of minimal trivially perfect deletions of G . The first thing to do is to consider acanonical ordering on the edges of a trivially perfect graph. To this effect, we consider an ordering onthe vertices of a trivially perfect graph, somehow similar to the one used for chordal graphs [9], andaccordingly derive a suitable ordering of the edges.We will need the following characterisation of trivially perfect graphs. Lemma 16 ([36]) . A graph G is trivially perfect if and only if for every subset X ⊆ V , each connectedcomponent of G [ X ] has a universal vertex. From this, one can derive an elimination ordering on the vertices of G , namely removing a vertexwhen it has become universal to its connected component. The ordering we will consider on the verticesis the reverse of this elimination ordering. In particular, denoting v , . . . , v n such an ordering, for each1 ≤ k ≤ n , the vertex v k is universal to its connected component in G [ v , . . . , v k ]. As there can be manysuch orderings, the canonical one will be defined as the lexicographically smallest according to a givenarbitrary ordering of the vertex set.The canonical edge ordering of a trivially perfect graph is derived from the vertex ordering as before(see previous sections).The next step is to determine a polynomial complete function which will turn a trivially perfect edgesubgraph of G into a maximal one. Then it will be possible to define a neighbouring function runningin polynomial time, and the Proximity Search algorithm will output all solutions in polynomial delay.The class is not sandwich monotone: in the example of Figure 10, it is not possible to reach G from G via a sequence of single-edge removals without producing a P . The edges e and e have to be removedat the same time.That is why a greedy complete function cannot be used for minimal trivially perfect deletions. Wewill see that the sandwich problem [20] for trivially perfect graphs can be solved in polynomial time.19 G (cid:48) e e Figure 10: The graphs G and G are trivially perfect. Removing only e or e will transform the graph G into a P , which is not trivially perfect. To reach G , both edges must be removed at the same time. Graph sandwich algorithm for trivially perfect graphs. Let G = ( V, E ) and G = ( V, E ) be two graphs such that E ⊆ E . For each connected component C of G , if there is no vertex v ∈ C such that v is universal in G [ C ], then there cannot be a triviallyperfect graph G = ( V, E ) such that E ⊆ E ⊆ E , otherwise G [ C ] would be a trivially perfect graph,contradicting the assumption by Lemma 16. This leads us to the following lemma. Lemma 17. Let ( G , G ) be an instance of the trivially perfect sandwich problem. If there exists asolution G ⊆ G ⊆ G , then for each connected component C of G , the graph G [ C ] has a universalvertex. Together with this lemma, another property of trivially perfect sandwich is worth noticing. Lemma 18. Let ( G , G ) be an instance of the trivially perfect sandwich problem. Suppose that thereexists a vertex v , whose connected component in G is denoted C , such that v is universal in G [ C ] .Then there exists a solution G to the trivially perfect sandwich problem for ( G , G ) if and only if thereexists a solution G for the instance ( G \ { v } , G \ { v } ) .Proof. Since the class of trivially perfect graphs is hereditary, if G is a solution of the trivially perfectsandwich problem for ( G , G ), then G = G \ { v } is a solution for the instance ( G \ { v } , G \ { v } ).Conversely, let G be a solution for the instance ( G \ { v } , G \ { v } ). Then C \ { v } is a triviallyperfect graph. Taking G = ( V, E ∪ { uv | u ∈ C \ { v }} ) gives the required solution.Combining Lemmas 17 and 18, we obtain a polynomial algorithm to solve the trivially perfect sand-wich problem. We can recursively remove vertices that are universal in G to their connected componentin G until it is no more possible. At this step, if the input graphs have no more vertices, then theanswer is true . Else it is false .Using the sandwich algorithm, we derive a polynomial complete function for trivially perfect edgesubgraphs in the same manner as for cographs.Now, it remains to provide a way for computing all neighbours of a solution, in order to build astrongly connected solution graph. Based on the definition of the canonical ordering we set for triviallyperfect graphs, the idea is to make a vertex universal to its connected component. Neighbouring function. Let G be a graph and let S be a minimal trivially perfect deletion of G . Fora vertex x and a connected component C of S , we will build a graph e S C,x in which x is universal to C in the canonical ordering. Denote by C x the connected component of x in S . Consider the following setsof edges of G :1. e E ( x ) := { xy | y ∈ N S ( x ) } ∪ { xy | y ∈ C ∩ N G ( x ) } ;2. for each v ∈ N S ( x ) , e E ( v ) := { vw | w ∈ N S ( v ) ∩ N S ( x ) } ;3. for each v ∈ C x \ N S ( x ) , e E ( v ) := { vw | w ∈ N S ( v ) \ N S ( x ) } ;4. for each v ∈ C ∩ N G ( x ) , e E ( v ) := { vw | w ∈ N S ( v ) ∩ N G ( x ) } ∪ { vx } ;5. for each v ∈ C \ N G ( x ) , e E ( x ) := { vw | w ∈ N S ( v ) \ N G ( x ) } ; . for every other vertex v , e E ( v ) := { vw | w ∈ N S ( v ) } .Let e S x := complete (cid:18) S v ∈ V e E ( v ) (cid:19) , and neighbours ( S ) := { e S C,x | x ∈ V, C connected component of G } .Each solution has at most a quadratic number of neighbours. Figure 11 illustrates the neighbouringfunction. x xC x \ N [ x ] C \ N [ x ] C x \ N [ x ] C \ N [ x ] S (cid:101) S C,x C Figure 11: Neighbouring function for trivially perfect graphs. Dashed edges are present in G but nottaken in the solution. Lemma 19. If S is a minimal trivially perfect deletion of a graph G , then for every x ∈ V and for everyconnected component C of S , e S C,x is a minimal trivially perfect deletion of G .Proof. Let x ∈ V , and let C be a connected component of G . It suffices to show that e S := S v ∈ V e E ( v ) is atrivially perfect graph.If a vertex is not in the same connected component as x , then its connected component is an inducedsubgraph of S , which does not contain any neighbour of x . It is therefore a trivially perfect graph.Besides, the adjacencies between the neighbours of x in e S are the same as in S . As an induced subgraphof S , e S [ N ( x )] is a trivially perfect graph.Consequently, e S is a trivially perfect graph, and e S C,x is a minimal trivially perfect deletion of G .Hence all neighbours of a solution are also solutions. We will see with the following lemma that thecorresponding solution graph is strongly connected, ensuring that Proximity Search can be applied. Lemma 20. Let S and S ∗ be two minimal trivially perfect deletions of a graph G . There exists x ∈ V and a connected component C of S such that | e S C,x ˜ ∩ S ∗ | > | S ˜ ∩ S ∗ | .Proof. Consider v ∗ j v ∗ k , j > k , the first edge in the canonical ordering of S ∗ which is not an edge of S . Denote by C the connected component of v ∗ k in S . In S ∗ , each edge before v ∗ j v ∗ k has either bothendpoints linked to v ∗ j in G , or none. This way, it will not be removed when building e S C,x , ensuring that | e S C,x ˜ ∩ S ∗ | > | S ˜ ∩ S ∗ | .Combining Lemmas 19 and 20, we deduce that minimal trivially perfect deletions are ProximitySearchable. We are then able to state the following theorem. Theorem 8. Minimal trivially perfect deletions of a graph G can be enumerated in polynomial delaywith Proximity Search. We are interested in one classical method to design some enumeration algorithm, called Binary Partition or sometimes Flashlight [31]. This method relies on what we call the extension problem . Here we focuson the case of the extension problem applied to the enumeration of maximal induced Π-subgraphs: givena graph G , and two disjoint subsets A and B of its vertex set, does there exist a maximal inducedΠ-subgraph of G containing A and avoiding B ? As discussed in the following, solving this problem canlead to a polynomial delay and polynomial space algorithm to enumerate, from a given arbitrary inputgraph G , all maximal induced subgraphs of G satisfying property Π.21ecall that a graph property Π is hereditary if for all G satisfying Π, all induced subgraphs of G alsosatisfy Π. The hereditary property Π is nontrivial if it is verified by infinitely many graphs and has atleast one obstruction, which is a graph J Π / ∈ Π.We define the extension problem for a hereditary graph property Π as follows. Given a graph G (notsatisfying Π in general) and two disjoint subsets A and B of its vertex set V , decide if there exists amaximal induced subgraph H of G satisfying Π, containing A and avoiding B . In other words, we wantthat A ⊆ V ( H ) and B ∩ V ( H ) = ∅ . Note that we cannot remove B from the vertex set before lookingfor a maximal induced Π-subgraph: this operation could lead us to a non-maximal induced Π-subgraphof G , which is not what we are looking for.If it were possible to solve the extension problem for Π in polynomial time, then we would be able toderive a polynomial delay polynomial space algorithm to enumerate all maximal Π-subgraphs of a givengraph G . Indeed, if we denote by v , . . . , v n the vertices of G , we can start by checking the existenceof a solution containing v , and the existence of a solution excluding v . Iterating this process for allvertices of G each time such a solution exists would lead us to find each solution exactly once, withoutconsidering the fail cases. Such a procedure is referred to as Binary Partition or Flashlight.The node-deletion problem consists in determining the minimum number of nodes which must bedeleted from a graph such that the resulting subgraph satisfies property Π. It has been shown by Lewisand Yannakakis in [27] that for all nontrivial hereditary property Π, the node-deletion problem is NP-complete, provided that testing for Π can be performed in polynomial time. We will show here that thesame can be said about the extension problem. Theorem 9. The extension problem for any nontrivial hereditary graph property Π is NP-hard. Ifmoreover Π can be tested in polynomial time, then the extension problem is NP-complete. First of all, the class Π contains all the independent sets or all the cliques. Indeed, because Π isnontrivial there exist graphs in Π that have arbitrarily many vertices. Let k ∈ N . Then by Ramsey’stheorem, every graph in Π that is large enough contains either a clique or an independent set of size k .Since Π is a hereditary property, it implies that this clique or independent set of size k belongs to Π. Upto considering the complement class Π (which remains nontrivial and hereditary), we can assume that Πcontains all the independent sets. Considering the complement of a solution in Π gives a solution in Π.The first step is to define a total order on the set of all graphs, essentially the same as the one givenin [27]. This order will be useful in the proof of Theorem 9, to ensure that the considered graph satisfiesproperty Π.For any connected graph G and any vertex c ∈ V ( G ), let λ c ( G ) be the non-increasing sequence ofthe sizes of the connected components of G − c . If V ( G ) = { c } , then we take λ c ( G ) = (0). Let then λ ( G ) be the minimum for the lexicographic order of the λ c ( G ), that is, λ ( G ) = min lex { λ c ( G ) | c ∈ V ( G ) } .Let c ( G ) ∈ V ( G ) be the vertex which minimises λ c { G } . If the minimum is reached for several vertices,take any of them as c ( G ).For any graph G with connected components G , . . . , G l , let µ ( G ) be the non-increasing sequence ofthe λ ( G i ) according to the lexicographic order. For convenience, the connected components G , . . . , G l of G will now be ordered to have µ ( G ) = ( λ ( G ) , . . . , λ ( G l )). The function µ defines a total and well-founded order (all elements are pairwise comparable, there is no infinite decreasing sequence for µ ) onthe set of all graphs.Figure 12 illustrates this order on three connected graphs G , G , and G , where the vertex c minimising λ is identified (except for G where any vertex can be taken). Proof of Theorem 9. First, if Π can be tested in polynomial time, the extension problem is in NP. Indeed,given a subset S of vertices of the input graph G , one can easily check in polynomial time whether G [ S ]satisfy Π, and whether S contains A and avoids B . Moreover, the maximality of G [ S ] can be tested inpolynomial time because Π is hereditary.As stated earlier, we will assume that the class Π contains all the stable sets. The stable sets areminimal for µ .The order defined by µ is well-founded, so every nonempty subset of the set of all graphs has asmallest element for µ . Hence there exists a graph J Π / ∈ Π which is minimal for µ , that is to say µ ( J Π ) = min lex { µ ( H ) | H / ∈ Π } . The graph J Π has at least two vertices and at least one edge.22 c G G c Figure 12: In this example, we have µ ( G ) = ((2 , , µ ( G ) = ((4)), and µ ( G ) = ((2 , , µ ( G ) ≤ µ ( G ) ≤ µ ( G ), and G is the smallest of the three graphs for µ .Denote by J , . . . , J l the connected components of J Π (such that µ ( J Π ) = ( λ ( J ) , . . . , λ ( J l ))). Let J ∗ be the largest connected component of J − c ( J ), we define J the subgraph of J Π induced by V ( J ∗ ) ∪ { c ( J ) } . Let also J = J Π [ V ( J ) \ V ( J ∗ )]. The graphs J and J are connected, and they alsohave at least one edge. Let then d be any vertex of J different from c ( J ).Before starting the reduction, let us have a look at what happens to the obstruction J Π . An illustrationof this process applied to a graph J Π is given in Figure 13. This graph verifies µ ( J Π ) = ((4 , , (3)). J (cid:48) J cd J J J Π λ ( J ) = (3) λ ( J ) = (4 , 2) = λ c ( J ) Figure 13: An obstruction J Π and its components J and J .Let now G be a graph, and let B be a subset of its vertices. We will build the graph G , using atechnique similar to [27], as follows. For each vertex u of G , attach a copy of J to u by identifying c ( J )with u . Replace every edge of G by a copy of J , identifying c ( J ) with one endpoint and d with theother, in any order. Finally, add J , . . . , J l as new connected components. Call G the graph obtainedthis way. The graph G contains a copy of J Π , therefore it does not verify the hereditary property Π.Figure 14 illustrates the transformation of a graph G into G , using the obstruction J Π of figure 13. Call A the set of all vertices that are in G but were not in G . G G (cid:48) Figure 14: G transforms into G . The set B consists here in the only square vertex, and the set A in thesmaller vertices. The circled vertices form a maximal stable set not intersecting B .We will show that it is equivalent to find a maximal stable set of G avoiding B , or a maximal inducedΠ-subgraph of G which contains A and avoids B . 23he reduction is from the maximal stable set avoiding a set B ⊆ V ( G ), whose NP-completeness isproven in [2, Proposition 2].First, suppose that there exists a maximal stable set S of G which does not intersect B . We willsee that the graph H := G [ S ∪ A ] verifies µ ( H ) < µ ( J Π ). As S is a stable set of G , each edge in G has at least one endpoint in V \ S . Hence removing from G all the vertices of V ( G ) \ S , destroys avertex identified to c ( J ) or d in each copy of J . This way, there are no more copies of J Π inducedin G . Because we removed one vertex in each copy of J , the size of the biggest connected componentdecreased, so µ ( H ) < µ ( J Π ).As J Π is the smallest obstruction for Π, H does not contain any obstruction as an induced subgraphand H ∈ Π. Therefore H is an induced Π-subgraph of G that contains A and does not intersect B . Itis maximal in G : if it were not, it would be possible to add a new vertex v ∈ V ( G ) to S , but S wassupposed to be a maximal stable set of G .Conversely, assume that there exists a maximal induced Π-subgraph H of G containing A and avoiding B . Then J Π is not an induced subgraph of H . But every edge of G induces a copy of J in G , and H must contain all the vertices of A . Hence for all edge uv of G , H does not contain u or does not contain v . Then V ( H ) ∩ V ( G ) is an independent set of G which does not intersect B . This independent set ismaximal in G : indeed, if there exists x ∈ V ( G ) \ A such that ( V ( H ) ∩ V ( G )) ∪ { x } is a stable set of G ,then G [ H ∪ { x } ] is an induced Π-subgraph of G containing A , avoiding B , and strictly containing H .Therefore V ( G ) ∩ V ( H ) is a maximal stable set of G which does not intersect B .Hence using this technique it is not possible to enumerate all maximal induced Π-subgraphs of agraph G in polynomial delay. The extension problem in its edge version is stated as follows: given a graph property Π, a graph G = ( V, E ), and two disjoint subsets A and B of E , does there exist a minimal Π-deletion of G containingall edges of A and no edge of B ? As for the vertex version, it does not suffice in general to look for minimalΠ-deletions of G − B , because the Π-deletions obtained this way may not be maximal Π-subgraphs of G .In the remainder of this section, to draw a parallel between the two versions of the extension problem,minimal completions will be referred to as “maximal Π-subgraphs”.Contrary to the extension problem studied in the previous subsection, this “edge version” of theextension problem is not NP-complete for all nontrivial hereditary Π, as discussed in the following. Thusit would be of interest to determine for which classes of graphs the extension problem is polynomial, andfor which ones it is NP-complete.A graph property Π is said to be monotone if it is closed under edge removal. In other words, Π ismonotone if for any graph G satisfying Π and any edge e of G , G − e also satisfies Π. Forests If Π denotes the class of forests, which is a monotone property, the extension problem asks if there existsa maximal spanning forest of G containing A and avoiding B . Assume first that G is connected. In thisparticular case, if removing B first disconnects G , then the answer is no: all spanning trees of G mustcontain at least one element from B . Else, B can be removed first. The set A , if it induces a forest, canthen be extended in G − B to a spanning tree of G . In the case where G is not connected, a (maximal)spanning forest of G is the union of spanning trees of all connected components of G . Therefore, theextension problem for forests is polynomial.Nevertheless, the extension problem is not polynomial for all classes of graphs. P k -free graphs It is proven in [5], among other results, that the extension problem with A = ∅ is NP-complete in thecase of maximal matchings. Since maximal P -free graphs are exactly maximal matchings in triangle-free24raphs, this result implies that the edge extension problem for P -free graphs is NP-complete, even intriangle-free graphs and with A = ∅ . In the sequel, we extend this result, proving the following theorem. Theorem 10. The edge extension problem for P k -free graphs is NP-hard for all k ≥ . Moreover, it isNP-complete when k equals or .Proof. For k = 3, the result follows from [5] and the previous discussion. Now, let us prove it for k = 4.For G = ( V, E ) a graph, and a set S ⊆ E of edges of G , determining if S is the edge set of a maximal P -free subgraph of G can be done in polynomial time: it suffices to complete S into a maximal solution S (iterating the polynomial sandwich algorithm from [20]) and to check if S = S . The problem is inNP.The reduction is from 3-SAT. Begin with a 3-SAT formula, with clauses C . . . , C m , and variables X , . . . , X n . Consider the graph G built from the formula as follows.For each clause C j , build a vertex c j , and for each variable X i , build two vertices x i and x i corre-sponding to the associated literals, linked by an edge x i x i . Now, add an edge between x i (or x i ) and c j if the corresponding literal appears in clause C j . At this step, each vertex c j is of degree 3. Finally, forall j , add a pending vertex c j to c j . Call the resulting graph G . An illustration of such a constructionis given in Figure 15. c (cid:48) c (cid:48) c (cid:48) . . . c (cid:48) m c c c c m x x x x x n . . . x n . . . BA Figure 15: The graph G obtained from a 3-SAT formula.Define the two edge sets A and B by A = { x i x i | ≤ i ≤ n } and B = { c j c j | ≤ j ≤ m } . These willbe the sets A and B considered for the extension problem.Suppose that there exists a maximal P -free subgraph H of G , containing A and avoiding B . Since H is a maximal P -free subgraph of G , adding to H an edge of B produces an induced P . That is tosay, each vertex c j is the endpoint of an induced P . Thus, there exists i such that c j x i ∈ E ( H ) or c j x i ∈ E ( H ). Without loss of generality, suppose that c j x i ∈ E ( H ) (so c j x i / ∈ E ( H )). In this case, thereis no k such that c k x i ∈ E ( H ), otherwise c j x i x i c k is an induced P in H .For all 1 ≤ i ≤ n , at most one of x i , x i has neighbours among { c , . . . , c m } . Assigning the value 1 tothe corresponding literal satisfies the formula.Conversely, if the formula is satisfiable, there exists a maximal P -free subgraph H of G containing A and avoiding B . It suffices to keep only edges incident to vertices corresponding to literals assignedthe value 1. To avoid creating induced P , keep only one edge incident to each vertex c j . This way, eachvertex c j is the endpoint of an induced P , and no edge of B can be added.Consequently, the edge extension problem for P -free graphs is NP-complete, even in triangle-freegraphs because the graph G we built is triangle-free.It is easy to adapt the previous reduction to show the NP-hardness of the problem for P k -free graphs,with k > 4. It suffices to subdivide each edge x i x i into a path of length k − A . 25 raphs without cycles of length at most k Another class of graphs that is worth studying is the class of graphs without cycles of length at most k ,for a given k ≥ 3, also known as graphs of girth at least k + 1 (the girth of a graph is the length of itsshortest cycle). This is a monotone property. For this class of graph, it has been shown by Yannakakisin [39] that the edge-deletion problem is NP-complete. In this case, the edge-deletion problem consists infinding a set of edges of minimum cardinality whose removal results in a graph without cycles of lengthat most k . In the same fashion, we prove that the edge extension problem for graphs without cycles oflength at most k , that is to say, determining if there exists a maximal edge subgraph without cycles oflength at most k , containing A and avoiding B , is also NP-complete. Theorem 11. The edge extension problem for graphs without cycles of length at most k is NP-completefor all k ≥ .Proof of Theorem 11. First of all, checking if a set of edges induces a subgraph without cycles of lengthat most k can be done in time O ( n k ), where n is the number of vertices of the input graph: it sufficesto test all possible vertex subsets of size at most k . Moreover, as the property is monotone, maximalitycan also be checked in polynomial time.The reduction is from the minimal Vertex Cover extension in triangle-free graphs, whose NP-complete-ness is proven in [2, Proposition 2]. The minimal Vertex Cover extension problem asks, given a graph G and a subset S of its vertex set, whether there exists a minimal Vertex Cover of G containing S . TheNP-completeness statement in [2] does not mention the triangle-free case, but the reduction used in theproof produces only triangle-free input graphs, which proves the NP-completeness we need.First, we shall prove the result for k = 3. Let G = ( V, E ) be a triangle-free graph, let S ⊆ V . Then webuild another graph G + c by adding a universal vertex c to G . Since G is triangle-free, all triangles in G + c must include c . Moreover, for two vertices u, v ∈ V , the three vertices u , v , and c form a trianglein G + c if and only if uv ∈ E . Thus, there is a one-to-one correspondence between the edges of G andthe triangles of G + c . Finally, define A and B two subsets of edges of G + c as follows: A := E ( G ) and B := { cv | v ∈ S } . An illustration of this transformation is presented in Figure 16. G S cS G + c AB Figure 16: Transformation of an instance of Vertex Cover extension into an instance of the triangle-freeedge extension problem. Big vertices are vertices in S , A is the set of green edges, and B is the set ofred edges.We will show that it is equivalent to find a minimal Vertex Cover of G containing S , or to find amaximal triangle-free subgraph of G + c containing A and avoiding B .Let H be a maximal triangle-free subgraph of G + c , containing A and avoiding B and let X = { v ∈ V | cv / ∈ E ( H ) } . Let us prove that X is a minimal Vertex Cover of G containing S . Since H is triangle-free, X is a Vertex Cover of G . Indeed, for each edge e of G there exists v ∈ e such that cv / ∈ E ( H ) (hence v ∈ X ), otherwise e ∪ { c } induces a triangle in H .Moreover, since H does not contain any edge of B , X contains S for otherwise there would be v ∈ S such that cv ∈ E ( H ). 26inally, since H is a maximal triangle-free subgraph of G + c , it is easy to see that the Vertex Cover X is minimal in G : if there were v ∈ X such that X \ { v } is a Vertex Cover of G , then all neighbours of v (except c ) would have to be in X to cover all the edges. So, by definition of X , there is no neighbour u of v such that cu ∈ E ( H ), hence we can add the edge cv to H without creating any triangle. Thiscontradicts the maximality of H .Conversely, if we are given a minimal Vertex Cover of G containing S , then the subgraph of G + c given by ( V ∪ { c } , A ∪ { cv | v / ∈ S } ) is triangle-free, and it is maximal in G + c because the Vertex Coveris minimal in G .This concludes the proof for k = 3.For greater values of k , the proof can easily be adapted by subdividing each edge of G in G + c intoa path of length k − k − A to contain alledges of those paths. Such a transformation is illustrated in Figure 17. Note that for k > 3, the smallestcycle in the subgraph induced by A has length at least 3( k − > k , ensuring that the solutions of theextension problem are not trivially inexistent. cS G + c AB Figure 17: Transformation for k = 5. References [1] David Avis and Komei Fukuda. Reverse search for enumeration. Discrete Applied Mathematics ,65(1-3):21–46, 1996.[2] Endre Boros, Vladimir Gurvich, Khaled Elbassioni, and Leonid Khachiyan. An efficient incremen-tal algorithm for generating all maximal independent sets in hypergraphs of bounded dimension. Parallel Processing Letters , 10(04):253–266, 2000.[3] Tiziana Calamoneri, Mattia Gastaldello, Arnaud Mary, Marie-France Sagot, and Blerina Sinaimeri.On maximal chain subgraphs and covers of bipartite graphs. In Vittorio Bilò and Antonio Caruso,editors, Proceedings of the 17th Italian Conference on Theoretical Computer Science, Lecce, Italy,September 7-9, 2016 , volume 1720 of CEUR Workshop Proceedings , pages 286–291. CEUR-WS.org,2016.[4] Yixin Cao. Enumerating maximal induced subgraphs. arXiv preprint arXiv:2004.09885 , 2020.[5] Katrin Casel, Henning Fernau, Mehdi Khosravian Ghadikolaei, Jérôme Monnot, and Florian Sikora.On the complexity of solution extension of optimization problems. arXiv preprint arXiv:1810.04553 ,2018.[6] Václav Chvátal and Peter L Hammer. Aggregations of inequalities. Studies in Integer Programming,Annals of Discrete Mathematics , 1:145–162, 1977.277] Sara Cohen, Benny Kimelfeld, and Yehoshua Sagiv. Generating all maximal induced subgraphs forhereditary and connected-hereditary graph properties. Journal of Computer and System Sciences ,74(7):1147–1159, 2008.[8] Alessio Conte, Roberto Grossi, Andrea Marino, and Luca Versari. Listing maximal subgraphssatisfying strongly accessible properties. SIAM J. Discrete Math. , 33(2):587–613, 2019.[9] Alessio Conte and Takeaki Uno. New polynomial delay bounds for maximal subgraph enumerationby proximity search. In Proceedings of the 51st Annual ACM SIGACT Symposium on Theory ofComputing, STOC 2019, Phoenix, AZ, USA, June 23-26, 2019. , pages 1179–1190, 2019.[10] Derek G. Corneil, Helmut Lerchs, and L. Stewart Burlingham. Complement reducible graphs. Discrete Applied Mathematics , 3(3):163–174, 1981.[11] Derek G. Corneil, Yehoshua Perl, and Lorna K. Stewart. A linear recognition algorithm for cographs. SIAM Journal on Computing , 14(4):926–934, 1985.[12] Christophe Crespelle, Daniel Lokshtanov, Thi Ha Duong Phan, and Eric Thierry. Faster and en-hanced inclusion-minimal cograph completion. In International Conference on Combinatorial Op-timization and Applications , pages 210–224. Springer, 2017.[13] Peter Damaschke. Parameterized enumeration, transversals, and imperfect phylogeny reconstruc-tion. Theoretical Computer Science , 351(3):337–350, 2006.[14] Thomas Eiter and Georg Gottlob. Identifying the minimal transversals of a hypergraph and relatedproblems. SIAM J. Comput. , 24(6):1278–1304, 1995.[15] Stéphane Foldes and Peter L Hammer. Split graphs . Universität Bonn. Institut für Ökonometrieund Operations Research, 1976.[16] Michael L. Fredman and Leonid Khachiyan. On the complexity of dualization of monotone disjunc-tive normal forms. J. Algorithms , 21(3):618–628, 1996.[17] Harold N. Gabow and Eugene W. Myers. Finding all spanning trees of directed and undirectedgraphs. SIAM J. Comput. , 7(3):280–287, 1978.[18] Martin Charles Golumbic. Trivially perfect graphs. Discrete Mathematics , 24(1):105–107, 1978.[19] Martin Charles Golumbic. Algorithmic graph theory and perfect graphs , volume 57. Elsevier, 2004.[20] Martin Charles Golumbic, Haim Kaplan, and Ron Shamir. Graph sandwich problems. Journal ofAlgorithms , 19(3):449–473, 1995.[21] Joshua A Grochow and Manolis Kellis. Network motif discovery using subgraph enumeration andsymmetry-breaking. In Annual International Conference on Research in Computational MolecularBiology , pages 92–106. Springer, 2007.[22] Pinar Heggernes and Federico Mancini. Minimal split completions. Discrete Applied Mathematics ,157(12):2659–2669, 2009.[23] Pinar Heggernes and Charis Papadopoulos. Single-edge monotonic sequences of graphs and linear-time algorithms for minimal completions and deletions. Theoretical Computer Science , 410(1):1–15,2009.[24] David S Johnson, Mihalis Yannakakis, and Christos H Papadimitriou. On generating all maximalindependent sets. Information Processing Letters , 27(3):119–123, 1988.[25] Leonid Khachiyan, Endre Boros, Khaled Elbassioni, and Vladimir Gurvich. On the dualization ofhypergraphs with bounded edge-intersections and other related classes of hypergraphs. TheoreticalComputer Science , 382(2):139–150, 2007. 2826] Eugene L. Lawler, Jan Karel Lenstra, and AHG Rinnooy Kan. Generating all maximal independentsets: Np-hardness and polynomial-time algorithms. SIAM Journal on Computing , 9(3):558–565,1980.[27] John M. Lewis and Mihalis Yannakakis. The node-deletion problem for hereditary properties isNP-complete. Journal of Computer and System Sciences , 20(2):219–230, 1980.[28] Daniel Lokshtanov, Federico Mancini, and Charis Papadopoulos. Characterizing and computingminimal cograph completions. Discrete Applied Mathematics , 158(7):755–764, 2010.[29] Andrea Marino. Analysis and Enumeration: Algorithms for Biological Graphs , volume 6. Springer,2015.[30] John W Moon and Leo Moser. On cliques in graphs. Israel journal of Mathematics , 3(1):23–28,1965.[31] R. C. Read and R. E. Tarjan. Bounds on backtrack algorithms for listing cycles, paths, and spanningtrees. Networks , 5(3):237–252, 1975.[32] Shuji Tsukiyama, Mikio Ide, Hiromu Ariyoshi, and Isao Shirakawa. A new algorithm for generatingall the maximal independent sets. SIAM Journal on Computing , 6(3):505–517, 1977.[33] Takeaki Uno. Algorithms for enumerating all perfect, maximum and maximal matchings in bipartitegraphs. In Hon Wai Leong, Hiroshi Imai, and Sanjay Jain, editors, Algorithms and Computation,8th International Symposium, ISAAC ’97, Singapore, December 17-19, 1997, Proceedings , volume1350 of Lecture Notes in Computer Science , pages 92–101. Springer, 1997.[34] Takeaki Uno. A fast algorithm for enumerating bipartite perfect matchings. In Peter Eades andTadao Takaoka, editors, ISAAC 2001 , volume 2223 of Lecture Notes in Computer Science , pages367–379. Springer, 2001.[35] Kunihiro Wasa. Enumeration of enumeration algorithms. CoRR , abs/1605.05102, 2016.[36] Elliot S. Wolk. A note on "the comparability graph of a tree". Proceedings of the American Mathe-matical Society , 16(1):17–20, 1965.[37] Jing-Ho Yan, Jer-Jeong Chen, Gerard J Chang, et al. Quasi-threshold graphs. Discrete appliedmathematics , 69(3):247–255, 1996.[38] Xifeng Yan, Philip S Yu, and Jiawei Han. Substructure similarity search in graph databases. In Proceedings of the 2005 ACM SIGMOD international conference on Management of data , pages766–777, 2005.[39] Mihalis Yannakakis. Edge-deletion problems.