8
Theoretical Computer Science 460 (2012) 26–33 Contents lists available at SciVerse ScienceDirect Theoretical Computer Science journal homepage: www.elsevier.com/locate/tcs Maximum regular induced subgraphs in 2P 3 -free graphs Vadim V. Lozin a , Raffaele Mosca b,a DIMAP and Mathematics Institute, University of Warwick, Coventry CV4 7AL, UK b Dipartimento di Economia, Universitá degli Studi ‘‘G. d’Annunzio’’, I-65127 Pescara, Italy article info Article history: Received 2 April 2012 Accepted 14 June 2012 Communicated by P. Widmayer Keywords: Independent set Clique Induced matching Regular induced subgraph Polynomial-time algorithm 2P 3 -free graphs abstract Finding maximum regular induced subgraphs is a family of algorithmic graph problems containing several important representatives such as maximum independent set, maximum clique, and maximum induced matching. These problems are generally NP- hard. On the other hand, each of them may become polynomially solvable when restricted to graphs in special classes. However, polynomial-time solutions are available only for very few monogenic classes, i.e. classes defined by a single forbidden induced subgraph. Only three such results are available for the maximum independent set and maximum clique problems and only two for the maximum induced matching problem. In the present paper, we extend this restricted list of results by exploring the complexity of the problems in the class of 2P 3 -free graphs, which recently attracted considerable attention in the literature. By elaborating a polynomial-time solution to the maximum independent set problem in the class of 2K 2 -free graphs proposed by Farber in [16], we show that both maximum independent set (0-regular induced subgraph) and maximum induced matching(1-regular induced subgraph) are solvable in polynomial time for 2P 3 - free graphs. We also conjecture that the same is true for finding maximum k-regular induced subgraphs for each value of k. On the other hand, we conjecture that finding a maximum subset of vertices inducing the complement of a k-regular induced subgraph is NP-hard for 2P 3 -free graphs and verify the conjecture for k = 0 (maximum clique), k = 1 (maximum induced co-matching), and k = 2. © 2012 Published by Elsevier B.V. 1. Introduction In a graph, an independent set (also known as a stable set) is a subset of vertices no two of which are adjacent. The maximum independent set problem is that of finding in a graph an independent set of maximum cardinality. A clique in a graph G is a subset of pairwise adjacent vertices, and the maximum clique problem asks to find in G a clique of maximum cardinality. Thus, finding a maximum clique in G is equivalent to finding a maximum independent set in the complement of G. These problems are important both from a theoretical and a practical point of view. The theoretical importance of the problems is partially due to the fact that both of them are computationally difficult, i.e. NP-hard [22]. Moreover, maximum independent sets and maximum cliques are difficult to approximate [26] and both problems are difficult from the parametrised point of view, namely, both of them are W[1]-hard. Also, both problems remain difficult for graphs in restricted families. The practical importance of the problems comes from the fact that they find numerous applications in various areas, such as computer vision and pattern recognition [3,39], bioinformatics [19,27,28], etc. For more information about the maximum clique (maximum independent set) problem, including application, complexity issues, etc., we refer the reader to [4]. Corresponding author. Tel.: +39 085 4537696. E-mail address: [email protected] (R. Mosca). 0304-3975/$ – see front matter © 2012 Published by Elsevier B.V. doi:10.1016/j.tcs.2012.06.014

Maximum regular induced subgraphs in -free graphs

Embed Size (px)

Citation preview

Theoretical Computer Science 460 (2012) 26–33

Contents lists available at SciVerse ScienceDirect

Theoretical Computer Science

journal homepage: www.elsevier.com/locate/tcs

Maximum regular induced subgraphs in 2P3-free graphsVadim V. Lozin a, Raffaele Mosca b,∗

a DIMAP and Mathematics Institute, University of Warwick, Coventry CV4 7AL, UKb Dipartimento di Economia, Universitá degli Studi ‘‘G. d’Annunzio’’, I-65127 Pescara, Italy

a r t i c l e i n f o

Article history:Received 2 April 2012Accepted 14 June 2012Communicated by P. Widmayer

Keywords:Independent setCliqueInduced matchingRegular induced subgraphPolynomial-time algorithm2P3-free graphs

a b s t r a c t

Finding maximum regular induced subgraphs is a family of algorithmic graph problemscontaining several important representatives such as maximum independent set,maximum clique, and maximum induced matching. These problems are generally NP-hard. On the other hand, each of themmay become polynomially solvable when restrictedto graphs in special classes. However, polynomial-time solutions are available only forvery few monogenic classes, i.e. classes defined by a single forbidden induced subgraph.Only three such results are available for the maximum independent set and maximumclique problems and only two for the maximum induced matching problem. In thepresent paper, we extend this restricted list of results by exploring the complexityof the problems in the class of 2P3-free graphs, which recently attracted considerableattention in the literature. By elaborating a polynomial-time solution to the maximumindependent set problem in the class of 2K2-free graphs proposed by Farber in [16], weshow that both maximum independent set (0-regular induced subgraph) and maximuminduced matching(1-regular induced subgraph) are solvable in polynomial time for 2P3-free graphs. We also conjecture that the same is true for finding maximum k-regularinduced subgraphs for each value of k. On the other hand, we conjecture that finding amaximum subset of vertices inducing the complement of a k-regular induced subgraph isNP-hard for 2P3-free graphs and verify the conjecture for k = 0 (maximum clique), k = 1(maximum induced co-matching), and k = 2.

© 2012 Published by Elsevier B.V.

1. Introduction

In a graph, an independent set (also knownas a stable set) is a subset of vertices no twoofwhich are adjacent. Themaximumindependent set problem is that of finding in a graph an independent set of maximum cardinality. A clique in a graph G isa subset of pairwise adjacent vertices, and the maximum clique problem asks to find in G a clique of maximum cardinality.Thus, finding a maximum clique in G is equivalent to finding a maximum independent set in the complement of G. Theseproblems are important both from a theoretical and a practical point of view. The theoretical importance of the problems ispartially due to the fact that both of them are computationally difficult, i.e. NP-hard [22]. Moreover, maximum independentsets and maximum cliques are difficult to approximate [26] and both problems are difficult from the parametrised pointof view, namely, both of them are W[1]-hard. Also, both problems remain difficult for graphs in restricted families. Thepractical importance of the problems comes from the fact that they find numerous applications in various areas, such ascomputer vision and pattern recognition [3,39], bioinformatics [19,27,28], etc. For more information about the maximumclique (maximum independent set) problem, including application, complexity issues, etc., we refer the reader to [4].

∗ Corresponding author. Tel.: +39 085 4537696.E-mail address: [email protected] (R. Mosca).

0304-3975/$ – see front matter© 2012 Published by Elsevier B.V.doi:10.1016/j.tcs.2012.06.014

V.V. Lozin, R. Mosca / Theoretical Computer Science 460 (2012) 26–33 27

An induced matching in a graph is a subset of vertices of degree 1. The problem of finding a maximum induced matchingalso finds many applications (secure communication, VLSI design, etc. [23]). This problem is also NP-hard [9], W[1]-hard[35] and is difficult to approximate [15]. The complexity of the problem in some restricted graph families has been studiedin [6,10,11,13,29,30,44].

The common point between all three problems mentioned above, i.e.maximum independent set,maximum clique, andmaximum induced matching, is that each of them finds in a graph a subset of vertices inducing a regular graph, i.e. a graphin which all vertices have the same degree. We call graphs of a fixed degree sparse regular graphs. Independent sets andinduced matchings give examples of sparse regular graphs. In cliques, the degree is not fixed to any constant, but it is fixedin their complements. We call the complements of sparse regular graphs dense regular graphs.

Finding maximum regular induced subgraphs has recently attracted much attention in the algorithmic community. Inparticular, in [12] it was shown that for each fixed k the problem of finding a maximum k-regular induced subgraph is NP-hard. In [36], it was proved that this problem is also difficult from a parametrised point of view. Fast exponential algorithmsfor this problem have been developed in [25].

In the present paper, we study the complexity of finding maximum regular induced subgraphs in the class of 2P3-freegraphs. This class was studied in the literature both from a combinatorial [14] and an algorithmic [8,38,45] point of view.In particular, in [45] it was shown that the problem of finding a maximal (with respect to set inclusion) independent set ofminimum cardinality is NP-hard in this class. Moreover, an optimal solution for this problem in the class of 2P3-free graphsis even hard to approximate [38]. To some surprise, we show that finding a maximum independent set for graphs in thisclass can be done in polynomial time. We make a similar conclusion about finding a maximum 1-regular induced subgraph(maximum induced matching) and conjecture that the same is true for finding any sparse regular graph. On the contrary,we conjecture that finding maximum dense regular graphs in the class of 2P3-free graphs is an NP-hard problem and verifythe conjecture for maximum cliques, the complements of 1-regular induced subgraphs, and the complements of 2-regularinduced subgraphs.

Our results for the maximum independent set and maximum induced matching problems are of particular interest,because these problems are known to be polynomial-time solvable only in a very few classes defined by a single forbiddeninduced subgraph. Currently, only three such results are known for themaximum independent set problem and two for themaximum induced matching problem. We mention these results in Section 2, where we also introduce basic terminologyand notation used in the paper.

2. Preliminaries

All graphs in this paper are finite, undirected, without loops andmultiple edges. The vertex set and the edge set of a graphG are denoted by V (G) and E(G), respectively. Given a vertex v ∈ V (G), we denote by N(v) the neighbourhood of v, i.e. theset of vertices adjacent to v. The degree of v is the number of its neighbours, i.e. |NG(v)|. A graph G is k-regular if all verticesof G have the same degree. A graph is regular if it is k-regular for some k. If N(v) contains a subset U ⊂ V (G), we say that vdominates U . Also, given a subset U ⊂ V (G), we denote by AG(U) the antineighbourhood of U in G, i.e. the set of vertices ofG outside U , none of which has a neighbour in U . As usual, Kn, Pn and Cn stand for a complete graph, a chordless path and achordless cycle on n vertices, respectively. Given two graphs G and F , we denote by G + F the disjoint union of G and F . Inparticular,mG = G + G + · · · + G is the disjoint union ofm copies of G.

The subgraph of G induced by a subset U ⊆ V (G) is denoted G[U]. If a graph H is isomorphic to an induced subgraphof G, we say that G contains H as an induced subgraph. Otherwise, we say that G is H-free and call H a forbidden inducedsubgraph for G. It is well-known (and not difficult to see) that a graph G is P3-free if and only if every connected componentof G is a clique.

Throughout the paper, we use the termmaximalwith respect to set inclusion and the termmaximumwith respect to size.As we mentioned in the introduction, the maximum independent set problem is NP-hard in general and in many

restricted graph families. In particular, it is NP-hard for triangle-free graphs [40], andmore generally for (C3, C4, . . . , Ck)-freegraphs for any fixed k [34], cubic graphs [21] andmore generally for k-regular graphs for any fixed k [18], planar graphs [20],etc. On the other hand, polynomial-time solutions have been developed for perfect graphs [24], asteroidal triple-free graphs[7], apple-free graphs [5], claw-free graphs [33,37,42], etc. The latter class is of particular interest for several reasons. First,this class generalises the class of line graphs, where the maximum independent set problem coincides with the maximummatching problem. Second, this class is defined by a single forbidden induced subgraph, while the other mentioned classeswith the polynomial-time solvablemaximum independent set problem are all defined by infinitelymany forbidden inducedsubgraphs. We call a class of graphs defined by a single forbidden induced subgraphmonogenic.

The maximum independent set problem has been shown to be polynomial-time solvable only in a very few monogenicclasses. In particular, the solution for claw-free graphs has been recently generalised in two different ways: to fork-freegraphs [2,31] and to (claw+K2)-free graphs [32]. One more solvable case deals withmK2-free graphs for any fixedm. This isan infinite chain of graph classes, butwe refer to it as a single case, because for each class in this chain the solution is based onthe same ideawhich combines two facts:mK2-free graphs have polynomiallymanymaximal independent sets [1,17,41] andall of them can be found in polynomial time [43]. The case of m = 2, i.e. the case of 2K2-free graphs, was separately solvedby Farber in [16]. By elaborating this idea, we generalise the solution for 2K2-free graphs to 2P3-free graphs. To emphasisethe importance of this generalisation, let us observe that in the class of 2K2-free graphs the complexity of (and the technique

28 V.V. Lozin, R. Mosca / Theoretical Computer Science 460 (2012) 26–33

to solve) themaximum independent set problem coincides with the related problem of finding a maximal independent setof minimum cardinality, while in the class of 2P3-free graphs these problems are computationally different: the first one ispolynomially solvable, as we show in this paper, and the second one is NP-hard [45].

By further elaborating our solution for the maximum independent set problem we also obtain a polynomial-timealgorithm for the maximum induced matching problem in the class of 2P3-free graphs. Speaking of the complexity ofthis problem in monogenic classes, let us observe that whenever H is not a linear forest (i.e. not a graph every connectedcomponent of which is a path) the maximum induced matching problem is NP-hard for H-free graphs. This is becausethe problem is NP-hard for (C3, C4, . . . , Ck)-free graphs for any fixed k [30] and for claw-free graphs [29]. If H is a linearforest and every connected component of H has exactly two vertices, i.e. if H = mK2 for some m, the problem is triviallypolynomial-time solvable because the size of a maximum induced matching is bounded by 2m− 2 formK2-free graphs. Theproblem is also solvable for P4-free graphs, since the clique-width of these graphs is at most 2 and the problem can be solvedin polynomial-time for graphs of bounded clique-width [29]. Our result for 2P3-free graphs provides the third solvable caseof this problem in monogenic classes.

Both solutions, for themaximum independent set andmaximum inducedmatchingproblems, are presented in Section 3.Moreover, in both cases our algorithms can be used to solve the weighted versions of the problems. In Section 4, we turn tofinding maximum dense regular graphs, i.e. complements of k-regular graphs, and show that this problem is NP-hard in theclass of 2P3-free graphs for k = 0, 1, 2.

3. Sparse regular induced subgraphs in 2P3-free graphs

Let us repeat that graphs are sparse regular if they are k-regular for a constant k. The problem of finding a maximuminduced k-regular graph for k = 0 is known as the maximum independent set problem and for k = 1 as the maximuminduced matching problem. We also repeat that both problems are generally NP-hard. In this section, we show that bothof them are solvable in polynomial time for 2P3-free graphs.

3.1. Maximum independent sets

We solve the maximum independent set problem in 2P3-free graphs in two major steps. In the first step, we generate afamily S of vertex subsets of the input graph G. The generated family satisfies the following properties:

• each inclusionwise maximal independent set of G is a subset of one of the members of the family S,• the number of generated subsets is bounded by a polynomial in |V (G)| and all of them can be found in polynomial time,• the structure of each subset in S is simple (each of them is a disjoint union of cliques), which allows us to solve the

maximum independent set problem in each subset in polynomial time.

In the second step, an optimal solution in G is found by solving the problem in each subset of the generated family.The first step of the procedure is described in Algorithm Beta below. In this algorithm, we use the following notation:

given a graphGwith vertex setV (G) = {v1, v2, . . . , vn}, we denote byGi the subgraph ofG induced by vertices v1, v2, . . . , vi.Initially, the family S contains a uniquememberwhich is the empty set. Then at each loop, the algorithmeither extends somemembers of S by adding to them a new vertex (Step 1) or creates a new member H ⊂ V (G) and adds it to S (Step 2).

Algorithm Beta

Input: a 2P3-free graph Gwith vertex set V (G) = {v1, v2, . . . , vn}.Output: a family S of subsets of V (G).

S := {∅}

For i = 1, . . . , n, dobegin1. [Extension of some members of S]

For each H ∈ S,If H ∪ {vi} induces a P3-free graph,then H := H ∪ {vi}.

2. [Addition of new members to S]2.1. For each triple vi, u, w of vertices inducing in Gi a P3 with edges viu, uw,

H := {vi, w} ∪ AGi(vi, u, w),S := S ∪ {H}.

2.2. For each triple vi, u, w of vertices inducing in Gi a P3 with edges uvi, viw,H := {vi} ∪ AGi(vi, u, w),S := S ∪ {H}.

endLet us now prove that the family S produced by Algorithm Beta satisfies the three properties stated at the beginning of

the section.

V.V. Lozin, R. Mosca / Theoretical Computer Science 460 (2012) 26–33 29

Lemma 1. Let G be a 2P3-free graph and S be the family of subsets of V (G) produced by Algorithm Beta. Then:

(i) each member of S induces a P3-free subgraph of G;(ii) each maximal independent set of G is contained in some member of S.

Proof. Amember of S is created either by the initialisation step as the empty set or in Step 2 of some loop. By the definitionof Step 2, since G is 2P3-free, each member created in Step 2 induces a P3-free subgraph of G. Then, by definition of Step 1, amember of S is extended only if this extension preserves its P3-freeness. This proves the first part of the lemma.

To prove the second part, let us denote by Si the content of the family S after i loops of the algorithm. We will show thatfor anymaximal independent set I of Gi, there is amemberH ∈ Si such that I ⊆ H . The proof is by induction on i = 1, . . . , n.For i = 1, the family Si consists of the single set {v1}, and this is obviously the only maximal independent set in the graphG1. Now let us assume that the statement holds for i − 1 and prove that it holds for i.

Let I be a maximal independent set in Gi. If vi ∈ I , then by the induction assumption I is contained in some member ofSi−1 and thus of Si, since each member of Si−1 is contained (properly or not) in some member of Si.

Assume now that vi ∈ I . Then by the induction assumption I \ {vi} is contained in some member H of Si−1. We know (bypart (i) of the lemma) that H induces a P3-free graph in G. We split the rest of the proof into two cases depending whetheror not H ∪ {vi} induces a P3-free graph.

Case 1: H ∪ {vi} induces a P3-free graph. Then I is contained in H ∪ {vi} which is a member of Si obtained by extending theset H in Step 1 of the algorithm at loop i.

Case 2: H ∪ {vi} does not induce a P3-free graph. Then an induced P3 can appear in G[H ∪ {vi}] in one of the following twoways.

2.1: vi has a neighbouru in a component (clique)K ofG[H]but does not dominateK . Then, sinceG[H] is P3-free, I is containedin one of the subsets of the family {{vi, w} ∪ AGi(vi, u, w) : u ∈ N(vi) ∩ K , w ∈ K \ N(vi)}. Each subset of this family isgenerated in Step 2.1 of the algorithm at loop i and hence each of them belongs to Si.

2.2: vi dominates at least two components (cliques) K , K ′ of G[H]. Then, since G[H] is P3-free, I is contained in one of thesubsets of the family {{vi} ∪ AGi(u, vi, w) : u ∈ K , w ∈ K ′

}. Each subset of this family is generated in Step 2.2 of thealgorithm at loop i and hence each of them belongs to Si.

The lemma is proved. �

Lemma 2. Let G be a 2P3-free graph with n vertices and m edges and let S be the family of subsets of V (G) produced by AlgorithmBeta. Then S contains O(n3) subsets and this family can be computed in timemax{O(n4),O(mn3)}, which is also the time boundof Algorithm Beta.

Proof. New members of the family S are created in Step 2 of the algorithm. This step inspects triples of vertices, and eachtriple can create at most 3 different induced P3’s. Therefore, S contains O(n3) members.

Each newmember of S can be computed in Step 2 in O(n) time. Therefore, the total complexity of Step 2 (i.e. complexitycomputed over all iterations of the algorithm) is O(n4). Steps 1, collectively, can be executed in O(m|S|) time, i.e., in O(mn3)time by the above. Therefore, S can be computed in time max{O(n4),O(mn3)}, which is also the time bound of AlgorithmBeta. �

We now summarise the above discussion in a polynomial-time algorithm that solves the maximum independent setproblem for 2P3-free graphs. We also observe that with no extra work this algorithm applies to vertex-weighted graphs andfinds an independent set of maximum total weight.

AlgorithmWIS

Input: a vertex-weighted 2P3-free graph G.Output: a maximum weight independent set in G.

(A) Apply Algorithm Beta to G to obtain a family S of subsets of V (G).(B) For eachH ∈ S, compute amaximumweight independent set in G[H]. Then choose a best solution, i.e., one ofmaximum

weight.

Theorem 1. Algorithm WIS finds in a 2P3-free graph G with n vertices and m edges a maximum weight independent set in timemax{O(n4),O(mn3)}.

Proof. The correctness of AlgorithmWIS follows from Lemmas 1 and 2. Now let us analyse its time complexity.By Lemma 2, we know that Step (A) can be executed in timemax{O(n4),O(mn3)}. To estimate the complexity of Step (B),

let us repeat that a P3-free graph is a graph every connected component of which is a clique. Therefore, finding a maximumweight independent set in a P3-free graph can be done in O(n) time (by choosing a vertex of maximum weight in eachconnected component). Since S hasO(n3)members, by Lemma2we conclude that Step (B) can be executed inO(n4) time. �

30 V.V. Lozin, R. Mosca / Theoretical Computer Science 460 (2012) 26–33

Fig. 1. Graphs used in Step 2 of Algorithm Gamma.

3.2. Maximum induced matchings

In this section, we develop a polynomial-time algorithm for finding a maximum 1-regular induced subgraph in a 2P3-free graph G. The idea of the solution is similar to that of finding a maximum 0-regular induced subgraph, i.e. a maximumindependent set. First, we generate a family of polynomially many subsets of V (G) of simple structure such that eachinclusionwise maximal 1-regular induced subgraph of G is contained in one of the subsets of the family. Then by solvingthe problem in each subset of the family we find a solution for G.

The first step is implemented in Algorithm Gamma below. In this algorithmwe use the following notion. As before, by Giwe denote the subgraph of G induced by vertices v1, v2, . . . , vi. Also, in the description of the algorithmwe use four specificgraphs represented in Fig. 1. These graphs are known in graph theory literature as paw, diamond, co-banner and cricket (listedfrom left to right).

Algorithm Gamma

Input: a 2P3-free graph Gwith vertex set V (G) = {v1, v2, . . . , vn}.Output: a family S of subsets of V (G).

S := {∅}

For i = 1, . . . , n, denote a := vi and dobegin1. [Extension of some members of S]

For each H ∈ S,For each j = 1, . . . , i − 1,

If vj is adjacent to a and H ∪ {a, vj} induces a P3-free graph,then H := H ∪ {a, vj}.

2. [Addition of new members to S]2.1. For each induced P3 in Gi containing vertex a and for each edge ab of this P3,

H := {a, b} ∪ AGi(V (P3)),S := S ∪ {H}.

2.2. For each induced paw in Gi containing vertex a as shown in Fig. 1,H := {a, b} ∪ AGi(a, b, c, d),S := S ∪ {H}.

2.3. For each induced diamond in Gi containing vertex a as shown in Fig. 1,H := {a, b} ∪ AGi(a, b, c, d),S := S ∪ {H}.

2.4. For each induced co-banner in Gi containing vertex a as shown in Fig. 1,H := {a, b} ∪ {d, e} ∪ AGi(a, b, c, d, e),S := S ∪ {H}.

2.5. For each induced cricket in Gi containing vertex a as shown in Fig. 1,H := {a, b} ∪ {d, e} ∪ AGi(a, b, c, d, e),S := S ∪ {H}.

end

Lemma 3. Let G be a 2P3-free graph and S the family of subsets of V (G) produced by Algorithm Gamma. Then:

(i) each member of S induces a P3-free subgraph of G;(ii) each maximal induced matching of G is contained in some member of S.

Proof. Amember of S is created either by the initialisation step as the empty set or in Step 2 of some loop. By the definitionof Step 2, since G is 2P3-free, each member created in Step 2 induces a P3-free subgraph of G. Then, by definition of Step 1, amember of S is extended only if this extension preserves its P3-freeness. This proves the first part of the lemma.

To prove the second part, let us denote by Si the content of the family S after i loops of the algorithm. We will showthat for any maximal induced matching I of Gi (i.e. a maximal subset of vertices inducing in Gi a 1-regular graph), there isa member H ∈ Si such that I ⊆ H . The proof is by induction on i = 1, . . . , n. For i = 1, the statement is trivial. Now weassume that the statement holds for i − 1 and prove that it holds for i.

V.V. Lozin, R. Mosca / Theoretical Computer Science 460 (2012) 26–33 31

Let I be a maximal induced matching of Gi. If vi ∈ I , then by the induction assumption I is contained in some member ofSi−1 and thus of Si, since each member of Si−1 is contained (properly or not) in some member of Si.

From now on, we assume that vi ∈ I . To simplify the notation, we denote vertex vi by a. Let b = vl (l < i) be the uniqueneighbour of vi in I . By the induction assumption I \ {a, b} is contained in some member H of Si−1. If both a and b belong tothe extension of H produced in Step 1, then clearly I is also contained in this extension and we are done.

From now on, we assume that at least one of a and b does not belong to the extension of H produced in Step 1. Withoutloss of generality we assume that H denotes the content of this extension obtained after the first l − 1 steps of the j-loop ofStep 1, and that a does not belong to H . We split the rest of the proof into two cases depending whether or not b belongsto H .

Case 1: let b ∈ H and denote by K the connected component of H containing b. Since H is P3-free, K is a clique.

1.1: if a has a non-neighbour c in K , then, since G[H] is P3-free, I is contained in the set {a, b} ∪ AGi(a, b, c), which is amember of Si generated in Step 2.1 of the algorithm at loop i.

1.2: if a dominates K , then, since the graph induced by H ∪ {a, b} contains a P3, vertex a must have a neighbour c in acomponent (clique) K ′ of G[H] different from K .1.2.1: |K ′

∩ AGi(a, b)| ≥ 2. Then I is contained in some member of the family {{a, b} ∪ {d, e} ∪ AGi(a, b, c, d, e) : d, e ∈

K ′∩ AGi(a, b)}. This family is contained in Si, since it is generated in Step 2.4 of the algorithm at loop i.

1.2.2: |K ′∩ AGi(a, b)| ≤ 1. Then I is contained in the set {a, b} ∪ AGi(a, b, c), which is a member of Si generated in

Step 2.1 of the algorithm at loop i.

Case 2: assume now that b ∈ H . If b has no neighbours inH , thenH∪{b} induces a P3-free graph, inwhich case the statementcan be proved by analogy with Case 1. Therefore, we assume that b has a neighbour c in a component (clique) K of G[H].

2.1: |K ∩ AGi(a, b)| ≥ 2. Then I is contained in one of the sets of the family {{a, b} ∪ {d, e} ∪ AGi(a, b, c, d, e) : d, e ∈

K ∩AGi(a, b)}. This family is contained in Si, since it is generated either in Step 2.4 (if a is nonadjacent to c) or in Step 2.5(if a is adjacent to c) of the algorithm at loop i.

2.2: |K ∩ AGi(a, b)| ≤ 1. This case is further split into two subcases as follows.2.2.1: K ∪ {a, b} is not a clique.

2.2.1.1: If N(a) ∩ K = N(b) ∩ K we consider a vertex d ∈ K non-adjacent both to a and b. Then I is contained in{a, b} ∪ AGi(a, b, c, d), which is a member of Si generated in Step 2.2 of the algorithm at loop i.

2.2.1.2: If N(a) ∩ K = N(b) ∩ K we consider a vertex d ∈ K adjacent to exactly one of a, b. Then I is containedin {a, b} ∪ AGi(a, b, d), which is a member of Si generated in Step 2.1 of the algorithm at loop i.

2.2.2: K ∪ {a, b} is a clique. If b has no neighbours in H outside K , then H ∪ {b} induces a P3-free graph, in which casethe statement can be proved by analogy with Case 1. Therefore, we can assume that b has a neighbour d in acomponent (clique) K ′ of G[H] different from K .2.2.2.1: |K ′

∩ AGi(a, b)| ≥ 2. This case can be settled similarly to Case 2.1.2.2.2.2: |K ′

∩ AGi(a, b)| ≤ 1. Then I is contained either in {a, b} ∪ AGi(a, b, c, d) (if a is adjacent to d) or in{a, b} ∪ AGi(a, b, d) (if a is nonadjacent to d). Both these sets belong to Si, since they are generatedrespectively in Step 2.3 and in Step 2.1 of the algorithm at iteration i.

The lemma is proved. �

Lemma 4. Let G be a 2P3-free graph with n vertices and m edges and let S be the family of subsets of V (G) produced by AlgorithmGamma. Then S contains O(n5) subsets and this family can be computed in time max{O(n6),O(mn5)}, which is also the timebound of Algorithm Gamma.

Proof. New members of the family S are created in Step 2 of the algorithm. This step inspects subsets of vertices of size atmost 5, and each of these subsets can induce finitely many graphs analysed in Step 2. Therefore, S contains O(n5) members.

Each newmember of S can be computed in Step 2 in O(n) time. Therefore, the total complexity of Step 2 (i.e. complexitycomputed over all iterations of the algorithm) is O(n6). Steps 1, collectively, can be executed in O(m|S|) time, i.e., in O(mn5)time by the above. Therefore, S can be computed in time max{O(n6),O(mn5)}, which is also the time bound of AlgorithmGamma. �

We now summarise the above discussion in a polynomial-time algorithm that solves the maximum induced matchingproblem for 2P3-free graphs. We also observe that with no extra work this algorithm applies to totally weighted graphs (i.e.graphs in which both vertices and edges are assigned weights) and finds a induced matching of maximum total weight.

AlgorithmWIM

Input: a totally weighted 2P3-free graph G.Output: an induced matching of maximum total weight in G.

(A) Apply Algorithm Gamma to G to obtain a family S of subsets of V (G).(B) For each H ∈ S, find an induced matching of maximum total weight in G[H]. Then choose a best solution, i.e., one of

maximum weight.

32 V.V. Lozin, R. Mosca / Theoretical Computer Science 460 (2012) 26–33

Theorem 2. Algorithm WIM finds in a totally weighted 2P3-free graphs G with n vertices and m edges an induced matching ofmaximum total weight in timemax{O(n6),O(mn5)}.

Proof. The correctness of AlgorithmWIM follows from Lemmas 3 and 4. Now let us analyse its time complexity.By Lemma 3, we know that Step (A) can be executed in time max{O(n6),O(mn5)}. Finding a maximum weight induced

matching in a P3-free graph can be done in O(m) time by choosing in each connected component of the graph an edge xyof maximum total weight ω(x) + ω(y) + ω(xy), where ω(x) and ω(y) stand for the weights of vertices x and y, while ω(xy)stands for the weight of edge xy. Since S has O(n5) members, by Lemma 4 we conclude that Step (B) can be executed inO(mn5) time. This completes the proof of the theorem. �

4. Dense regular induced subgraphs in 2P3-free graphs

We repeat that graphs are dense regular if their complements are k-regular for a constant k. In particular, for k = 0 theproblem of finding a maximum dense regular graph is known as the maximum clique problem.

For each fixed k, finding amaximumdense regular graph is generally NP-hard. In this section,we show that for k = 0, 1, 2the NP-hardness of the problem can be strengthened to the class of 2K2-free graphs, which is a subclass of 2P3-free graphs.

Theorem 3. For k = 0, 1, 2, the problem of finding a maximum subset of vertices inducing the complement of a k-regular graphis NP-hard in the class 2K2-free graphs.

Proof. It is more convenient to prove the complementary version of the theorem, i.e. we will prove that for k = 0, 1, 2, theproblem of finding a maximum subset of vertices inducing a k-regular graph is NP-hard in the class of C4-free graphs.

For k = 0, the NP-hardness of the problem in C4-free graphs follows from a stronger result stating that the problem isNP-hard for (C3, C4, . . . , Ck)-free graphs for any fixed k [34]. A similar result was proved in [30] for the maximum inducedmatching problem, i.e. for k = 1.

For k = 2, we proceed as follows. Given an arbitrary graph G we subdivide each edge of G by a new vertex and denotethe resulting graph by G′. Clearly, the size of a smallest chordless cycle in G′ is at least 6, i.e. G′ is (C3, C4, C5)-free. Denotingthe size of a maximum subset of vertices inducing a k-regular graph by αk, we can state the following.

Claim 4.1. 2α2(G) = α2(G′).

Proof. Let us call the original vertices of G black and the new vertices white. Consider an arbitrary subset W of vertices ofG inducing a maximum cardinality 2-regular subgraph H in G. Obviously, every connected component of H is a cycle andhence the number of its vertices equals the number of its edges. LetW ′ be the set of white vertices subdividing the edges ofH , thenW ∪ W ′ is a 2-regular induced subgraph in G′. Therefore, 2α2(G) ≤ α2(G′).

Conversely, let W ′ be a subset of vertices of G′ inducing a maximum cardinality 2-regular subgraph H ′ in G′. Since notwo vertices of the same color are adjacent in G′ and every white vertex has degree two, in each connected component ofH ′ (which must be a cycle of length at least 6) the vertices strictly alternate (in terms of their colors). Therefore, the set ofblack vertices ofW ′ induces in G a 2-regular graph. Therefore, 2α2(G) ≥ α2(G′). �

Since the problem of finding amaximum cardinality subset of vertices inducing a 2-regular graph is generally NP-hard, fromthe above claim we conclude that this problem is also NP-hard for (C3, C4, C5)-free graphs. �

5. Conclusion

In this paper, we studied computational complexity of several algorithmic problems restricted to the class of 2P3-freegraphs. In particular, we showed that in this class

• the problem of finding a maximum cardinality subset of vertices inducing a k-regular graph is polynomial-time solvablefor k = 0, 1;

• the problemof finding amaximumcardinality subset of vertices inducing the complement of a k-regular graph is NP-hardfor k = 0, 1, 2.

Determining the complexity of these problems in the class of 2P3-free graphs for larger values of k is a challenging researchproblem.We conjecture that for any fixed value of k, findingmaximum sparse regular induced subgraphs is polynomial-timesolvable for 2P3-free graphs, while findingmaximum dense regular induced subgraphs is NP-hard in this class. We leave thisconjecture as an open problem for future research.

Acknowledgement

The first author gratefully acknowledges support fromDIMAP— the Center for DiscreteMathematics and its Applicationsat the University of Warwick, and from EPSRC grant EP/I01795X/1.

V.V. Lozin, R. Mosca / Theoretical Computer Science 460 (2012) 26–33 33

References

[1] V.E. Alekseev, On the number of maximal independent sets in graphs from hereditary classes, in: Combinatorial-algebraic Methods in DiscreteOptimization, Gorkiy University Press, Gorkiy, 1991, pp. 5–8 (in Russian).

[2] V.E. Alekseev, A polynomial algorithm for finding largest independent sets in fork-free graphs, Discrete Applied Mathematics 135 (2004) 3–16.[3] H.G. Barrow, R.M. Burstal, Subgraph isomorphism,matching relational structures, andmaximal cliques, Information Processing Letters 4 (1976) 83–84.[4] I.M. Bomze, M. Budinich, P.M. Pardalos, M. Pelillo, The maximum clique problem, in: D.-Z. Du, P.M. Pardalos (Eds.), Handbook of Combinatorial

Optimization - Suppl. Vol. A, Kluwer Academic Publishers, Boston, MA, 1999, pp. 1–74.[5] A. Brandstädt, V.V. Lozin, R. Mosca, Independent sets of maximum weight in apple-free graphs, SIAM Journal on Discrete Mathematics 24 (2010)

239–254.[6] A. Brandstädt, R. Mosca, On distance-3 matchings and induced matchings, Discrete Applied Mathematics 159 (2011) 509–520.[7] H. Broersma, T. Kloks, D. Kratsch, H. Müller, Independent sets in asteroidal triple-free graphs, SIAM Journal on Discrete Mathematics 12 (1999)

276–287.[8] H.J. Broersma, P.A. Golovach, D. Paulusma, J. Song, Determining the chromatic number of triangle-free 2P3-free graphs in polynomial time, Theoretical

Computer Science 423 (2012) 1–10.[9] K. Cameron, Induced matchings, Discrete Applied Mathematics 24 (1989) 97–102.

[10] K. Cameron, Induced matchings in intersection graphs, Discrete Mathematics 278 (2004) 1–9.[11] K. Cameron, R. Sritharan, Y. Tang, Finding a maximum induced matching in weakly chordal graphs, Discrete Mathematics 278 (2004) 1–9.[12] D.M. Cardoso, M. Kaminski, V. Lozin, Maximum k-regular induced subgraphs, Journal of Combinatorial Optimization 14 (2007) 455–463.[13] J.-M. Chang, Induced matchings in asteroidal triple-free graphs, Discrete Applied Mathematics 132 (2004) 67–78.[14] M.S. Chung, D.B. West, Large 2P3-free graphs with bounded degree, Discrete Mathematics 150 (1996) 69–79.[15] W. Duckworth, D.F. Manlove, M. Zito, On the approximability of the maximum induced matching problem, Journal of Discrete Algorithms 3 (2005)

79–91.[16] M. Farber, On diameters and radii of bridged graphs, Discrete Mathematics 73 (1989) 249–260.[17] M. Farber, M. Hujter, Zs. Tuza, An upper bound on the number of cliques in a graph, Networks 23 (1993) 75–83.[18] G.H. Fricke, S.T. Hedetniemi, D.P. Jacobs, Independence and irredundance in k-regular graphs, Ars Combinatoria 49 (1998) 271–279.[19] E.J. Gardiner, P.J. Artymiuk, P.Willett, Clique-detection algorithms formatching three-dimensionalmolecular structures, Journal ofMolecular Graphics

and Modelling 15 (1997) 245–253.[20] M.R. Garey, D.S. Johnson, L. Stockmeyer, Some simplified NP-complete graph problems, Theoretical Computer Science 1 (1976) 237–267.[21] M.R. Garey, D.S. Johnson, The rectilinear Steiner tree problem is NP-complete, SIAM Journal on Applied Mathematics 32 (1977) 826–834.[22] M.R. Garey, D.S. Johnson, Computers and Intractability: A Guide to the Theory of NP-completeness, Freeman, San Francisco, CA, 1979.[23] M.C. Golumbic, M. Lewenstein, New results on induced matchings, Discrete Applied Mathematics 101 (2000) 157–165.[24] M. Grötschel, L. Lovász, A. Schrijver, Polynomial algorithms for perfect graphs, Annals of Discrete Mathematics 21 (1984) 325–356.[25] S. Gupta, V. Raman, S. Saurabh, Fast exponential algorithms for maximum r-regular induced subgraph problems, Lecture Notes in Computer Science

4337 (2006) 139–151.[26] J. Håstad, Clique is hard to approximate within n1−ϵ , Acta Mathematica 182 (1999) 105–142.[27] Yongmei Ji, Xing Xu, Gary D. Stormo, A graph theoretical approach for predicting common RNA secondary structure motifs including pseudoknots in

unaligned sequences, Bioinformatics 20 (2004) 1591–1602.[28] D. Joseph, J. Meidanis, P. Tiwari, Determining DNA sequence similarity using maximum independent set algorithms for interval graphs, Lecture Notes

in Computer Science 621 (1992) 326–337.[29] D. Kobler, U. Rotics, Finding maximum induced matchings in subclasses of claw-free and P5-free graphs, and in graphs with matching and induced

matching of equal maximum size, Algorithmica 37 (2003) 327–346.[30] V.V. Lozin, On maximum induced matchings in bipartite graphs, Information Processing Letters 81 (2002) 7–11.[31] V.V. Lozin, M. Milanič, A polynomial algorithm to find an independent set of maximum weight in a fork-free graph, Journal of Discrete Algorithms 6

(2008) 595–604.[32] V.V. Lozin, R. Mosca, Independent sets in extensions of 2K2-free graphs, Discrete Applied Mathematics 146 (2005) 74–80.[33] G.J. Minty, On maximal independent sets of vertices in claw-free graphs, Journal of Combinatorial Theory, Series B 28 (1980) 284–304.[34] O.J. Murphy, Computing independent sets in graphs with large girth, Discrete Applied Mathematics 35 (1992) 167–170.[35] H. Moser, S. Sikdar, The parameterized complexity of the induced matching problem, Discrete Applied Mathematics 157 (2009) 715–727.[36] H. Moser, D.M. Thilikos, Parameterized complexity of finding regular induced subgraphs, Journal of Discrete Algorithms 7 (2009) 181–190.[37] D. Nakamura, A. Tamura, A revision of Minty’s algorithm for finding a maximum weight stable set in a claw-free graph, Journal of the Operations

Research Society of Japan 44 (2001) 194–204.[38] Y.L. Orlovich, V.S. Gordon, D. de Werra, On the inapproximability of independent domination in 2P3-free graphs, Theoretical Computer Science 410

(2009) 977–982.[39] M. Pelillo, K. Siddiqi, S.W. Zucker, Matching hierarchical structures using association graphs, IEEE Transactions on Pattern Analysis and Machine

Intelligence 21 (1999) 1105–1120.[40] S. Poljak, A note on stable sets and colorings of graphs, Commentationes Mathematicae Universitatis Carolinae 15 (1974) 307–309.[41] E. Prisner, Graphs with few cliques, in: Graph Theory, Kalamazoo, MI, 1992, in: Combinatorics and Algorithms, vol. 1, 2,Wiley-Interscience Publishers,

Wiley, New York, 1995, pp. 945–956.[42] N. Sbihi, Algorithme de recherche d’un independent de cardinalité maximum dans un graphe sans étoile, Discrete Mathematics 29 (1980) 53–76.[43] S. Tsukiyama, M. Ide, H. Ariyoshi, I. Shirakawa, A new algorithm for generating all maximal independent sets, SIAM Journal on Computing 6 (1977)

505–517.[44] M. Zito, Maximum induced matchings in regular graphs and trees, in: Proceedings of WG ’99: the 25th International Workshop on Graph-Theoretic

Concepts in Computer Science, LNCS 1665, 1999, pp. 89–100.[45] I.E. Zverovich, Satgraphs and independent domination. Part 1, Theoretical Computer Science 352 (2006) 47–56.