Information Processing Letters 81 (2002) 7–11
On maximum induced matchings in bipartite graphs V.V. Lozin RUTCOR, Rutgers University, 640 Bartholomew Road, Piscataway, NJ 08854-8003, USA Received 17 October 2000; received in revised form 7 March 2001 Communicated by K. Iwama
Abstract The problem of finding a maximum induced matching is known to be NP-hard in general bipartite graphs. We strengthen this result by reducing the problem to some special classes of bipartite graphs such as bipartite graphs with maximum degree 3 or C4 -free bipartite graphs. On the other hand, we describe a new polynomially solvable case for the problem in bipartite graphs which deals with a generalization of bi-complement reducible graphs. 2002 Elsevier Science B.V. All rights reserved. Keywords: Graph algorithms; Computational complexity; Maximum induced matching; Bipartite graphs
1. Introduction A matching in a graph G = (V , E) is a subset of edges M ⊆ E no two of which have a vertex in common. A matching is called induced if the subgraph of G induced by the endpoints of edges in M is 1regular. We study the problem of finding in G an induced matching of maximum cardinality, denoted iµ(G). This problem has been introduced in [1], where the author has proved its NP-hardness in the class of bipartite graphs. In the present paper we strengthen this result in the following way. Let C be a class of graphs defined by a finite set of forbidden induced subgraphs F . In Section 2, we characterize a condition for the set F under which the maximum induced matching problem is NP-hard for bipartite graphs in class C. In particular, due to this condition the problem is NP-hard in classes of K1,4 -free or C4 -free bipartite graphs. Note that K1,4 E-mail address:
[email protected] (V.V. Lozin).
free bipartite graphs are exactly bipartite graphs with maximum degree 3. A similar result has been obtained in [6], where the authors have proved the NP-hardness for the problem under consideration in the class of planar graphs with maximum degree 3. In spite of general NP-hardness, there are known several classes of graphs where the problem can be solved in polynomial time: chordal and interval graphs [1], trees [2], circular-arc graphs [4], trapezoid graphs, k-interval-dimension graphs and cocomparability graphs [5]. In the present paper we show the polynomial solvability of the problem in a subclass of bipartite graphs which generalizes bi-complement reducible graphs (bi-cographs for short) introduced in [3] as the bipartite analog of cographs. For a graph G, we denote by VG and EG the vertex set and the edge set of G, respectively. The neighbourhood of a vertex x ∈ VG is denoted N(x). The degree of x ∈ VG is the number of vertices in N(x). Given a subset of vertices U ⊆ VG, we denote
0020-0190/02/$ – see front matter 2002 Elsevier Science B.V. All rights reserved. PII: S 0 0 2 0 - 0 1 9 0 ( 0 1 ) 0 0 1 8 5 - 5
8
V.V. Lozin / Information Processing Letters 81 (2002) 7–11
Fig. 1. Graph Hn .
by G[U ] the subgraph of G induced by U , and G − U = G[VG − U ]. As usual, Pn and Cn denote the chordless path and the chordless cycle with n vertices, respectively, and Kn,m is the complete bipartite graph with parts of cardinality n and m. By Hn we denote the graph which can be obtained from two copies of P3 by joining their central vertices by a chordless path of length n (Fig. 1). Given two graphs G and H , we say that G is H free if G does not contain H as an induced subgraph. We use special notations for some particular classes of graphs: Xk , the class of (C3 , C4 , . . . , Ck )-free graphs, Yl , the class of (H1 , H2 , . . . , Hl )-free graphs, Z3 , the class of graphs with maximum degree 3, B, the class of bipartite graphs.
2. NP-hardness Let G be a graph and x be a vertex in G. We define a graph transformation illustrated in Fig. 2 as follows: (1) partition the neighbourhood N(x) of vertex x into two subsets Y and Z in arbitrary way; (2) delete vertex x from the graph together with incident edges; (3) add a P4 = (y, a, b, z) to the rest of the graph; (4) connect vertex y of the P4 to each vertex in Y , and connect z to each vertex in Z. We denote the transformed graph by G and say that G is obtained from graph G by vertex stretching with respect to x. Lemma 1. iµ(G ) = iµ(G) + 1. Proof. At first, let us consider an induced matching M in G and show that graph G contains an induced matching M of cardinality |M| + 1. If x is not covered by an edge in M, then M = M ∪ {(a, b)} is the
Fig. 2. Stretching operation.
required matching. If M contains an edge (x, c), we may assume, without loss of generality, that c ∈ Y . Then, clearly, no vertex in Z is covered by an edge of M, and hence M = (M − {(x, c)}) ∪ {(y, c), (b, z)} is the matching we are looking for. Thus, iµ(G ) iµ(G) + 1. Conversely, let M be an induced matching in G with at least one edge. Our purpose now is to find in G an induced matching M of cardinality |M | − 1. If M contains edge (a, b), then obviously M = M − {(a, b)} meets the purpose. Assume next (a, y) ∈ M . If M does not cover vertex z, then M = M − {(a, y)} is what we need. If (z, c) ∈ M with some c ∈ Z, then the desired matching M can be obtained as follows: M = M − {(a, y), (z, c)} ∪ (x, c) . Similarly if (b, z) ∈ M . Now let M do not contain edges of the P4 = (y, a, b, z). If M covers neither y nor z, then for any e ∈ M , M = M − {e} is the sought for matching. Assume y is covered by an edge (c, y). If M does not cover vertex z, then M = M − {(c, y)} satisfies our purpose. If (z, d) ∈ M with some d ∈ Z, then we may be complied with matching M = (M − {(c, y), (z, d)}) ∪ {(x, d)}. Therefore, iµ(G) iµ(G ) − 1. ✷ Lemma 2. Any graph G can be transformed by a sequence of stretching operations into a graph in class Xk ∩ Yl ∩ Z3 ∩ B with any integer k 3 and l 1. Proof. Assume first that graph G has a vertex x of degree at least four. For vertex stretching with respect to x, let us choose as Y any two vertices adjacent to x, and let Z contain all the remaining vertices in the neighbourhood of x. Under the vertex stretching we obtain a graph with four new vertices y, a, b, z, where y is of degree three, a and b are of degree two, and z is
V.V. Lozin / Information Processing Letters 81 (2002) 7–11
of degree exactly one less than that of x. If the degree of z is still greater than three, we can decrease it in a similar way by application of vertex stretching with respect to z. Thus, repeatedly applying the stretching operation we can obtain a graph in which every vertex has degree at most three, i.e., a graph in Z3 . Now let us consider another variant of vertex stretching for which set Y consists of a single vertex. In this case, the stretching operation is equivalent to a triple subdivision of an edge in the graph. In other words, the edge is replaced by a chordless path of length four. Application of this operation to each edge of the graph is called the total stretching of G. Under the total stretching the length of every induced cycle increases four times, and therefore, the resulting graph contains no cycles of odd length, i.e., it is bipartite. Moreover, applying the total stretching a necessary number of times, we get rid of induced cycles Ci with i k and induced graphs of form Hi with i l. ✷ It is not hard to see that the transformation described in Lemma 2 can be carried out in time bounded by a polynomial in the size of the input graph. In conjunction with Lemma 1 and the result in [1] this implies Corollary 1. For any integers k 3 and l 1, the maximum induced matching problem is NP-hard in the class of graphs Xk ∩ Yl ∩ Z3 ∩ B. Proof. To prove the corollary we only have to show that the maximum induced matching problem is polynomially equivalent to the problem of determining iµ(G). This is a consequence of the following simple observation. Let (x, y) be an edge in a graph G. If iµ(G − x) = iµ(G) or iµ(G − y) = iµ(G), then clearly there is a maximum induced matching in G which is contained in G − x or G − y, respectively. And if iµ(G − x) = iµ(G − y) = iµ(G) − 1, then every maximum induced matching M in G is of form M = {(x, y)} ∪ M , where M is a maximum induced matching in graph G − ({x, y} ∪ N(x) ∪ N(y)). Thus, one can determine a maximum induced matching in G by computing iµ(H ) for induced subgraphs H of G at most |VG| times. ✷ Denote by T (l1 , l2 , l3 ) the graph in Fig. 3, where l1 , l2 , and l3 are nonnegative integers. In particular,
9
Fig. 3. T (l1 , l2 , l3 ).
T (1, 1, 1) = K1,3 and T (l1 , l2 , 0) = Pl1 +l2 +1 . And let T be the class of graphs whose every connected component is isomorphic to a graph of form T (l1 , l2 , l3 ). Theorem 1. Let C be a class of graphs defined by a finite set F of forbidden induced subgraphs. If F ∩ T = ∅, then the maximum induced matching problem is NP-hard in the class C ∩ B. Proof. Let k be an integer greater than the number of vertices in a largest graph in F . And suppose that a graph G ∈ Xk ∩ Yk ∩ Z3 ∩ B does not belong to C ∩ B. Then G must contain a graph A ∈ F as an induced subgraph. Since G ∈ Xk , graph A contains no induced cycles Cj of length j k. Moreover, A can not contain a cycle Cj with j > k, because |VA| < k due to the choice of k. Therefore, A contains no cycles, i.e., A is a forest. Analogously, since G ∈ Yk and |VA| < k, A contains no induced subgraphs of form Hi , i.e., every connected component of A has at most one vertex of degree at least three. And furthermore, since G ∈ Z3 , the maximum degree of A is at most three. But then A is in T that contradicts the hypothesis of the theorem. We thus have proved that Xk ∩ Yk ∩ Z3 ∩ B ⊆ C ∩ B. Now the conclusion of the theorem follows from Corollary 1. ✷ As an immediate consequence from the theorem, we obtain the NP-hardness of the maximum induced matching problem in a large family of subclasses of bipartite graphs such as K1,4 -free bipartite graphs or C4 -free bipartite graphs. On the other hand, this theorem characterizes graph classes which have the potential for accepting polynomial algorithms. In the next section we consider one of such classes and prove that the maximum induced matching problem can be solved in polynomial time in this class.
10
V.V. Lozin / Information Processing Letters 81 (2002) 7–11
3. A polynomially solvable case All graphs in this section will be bipartite. A bipartite graph G = (V1 , V2 , E) consists of set of vertices V1 ∪ V2 and set of edges E ⊆ V1 × V2 . For a the bipartite graph G = (V1 , V2 , E), we denote by G bipartite complement to G, i.e., = V1 , V2 , (V1 × V2 ) − E . G By mK2 we denote the regular graph of degree 1 with 2m vertices. Clearly, mK2 is a bipartite graph. 2 = 2K2 . Furthermore, for m = 2 we have 2K Let us call two vertices of a bipartite graph similar if they have the same neighbourhood. Clearly the similarity is an equivalence relation. A bipartite graph whose every class of similarity is of size 1 will be called prime. It is not hard to see that any bipartite graph G has a unique (up to isomorphism) maximal prime induced subgraph that can be obtained by choosing exactly one vertex in each similarity class of G. Throughout the section we denote by C the class of bipartite graphs containing no induced subgraphs depicted in Fig. 4. Let us note that class C is an extension of bicomplement reducible graphs (bi-cographs) introduced recently in [3]. Bi-cographs are exactly those graphs in C that are P7 -free. By definition, a bipartite graph is a bi-cograph if any its induced subgraph with at least two vertices is either disconnected or the bipartite complement to a disconnected graph. The structure of graphs in class C has been characterized in [7] as follows. Theorem 2. Let G = (V1 , V2 , E) be a prime bipartite (Star1,2,3 , Sun4 )-free graph. If G is connected and G is K1,3 -free. is connected, then either G or G
Fig. 4. Forbidden graphs for class C.
Now we use this characterization in order to prove the polynomial solvability of the maximum induced matching problem in class C. To this end, the following simple lemmas will be useful. Lemma 3. If G1 , . . . , Gk are connected components of a graph G, then iµ(G) = ki=1 iµ(Gi ). Lemma 4. If H is a maximal prime induced subgraph of a graph G, then iµ(H ) = iµ(G). Proof. Lemma 3 is obvious. To prove Lemma 4, let us note that any induced matching M in G covers at most one vertex in each similarity class of G, otherwise the matching is not induced. Without loss of generality we may assume that vertices covered by M belong to H . Hence, iµ(H ) iµ(G). The converse inequality is trivial. ✷ Due to Lemmas 3 and 4, we assume from now on that a bipartite graph G is connected and prime. Moreover, we assume that G contains an induced 2K2 , otherwise iµ(G) 1 and the problem is trivial. Let us partition the vertex set of G into subsets U1 , . . . , Uk in such a way that each Ui induces a connected component in the bipartite complement to G. We denote Hi = G[Ui ] and call Hi co-component of G. Lemma 5. If H1 , . . . , Hk are co-components of a graph G = (V1 , V2 , E) that contains an induced 2K2 , then iµ(G) = max{2, iµ(H1), . . . , iµ(Hk )}. Proof. Let M be a maximum induced matching in G, and (a, b) be an edge in M with a ∈ Ui ∩ V1 and b ∈ Uj ∩ V2 , where Ui = VH i (i = 1, . . . , k). Assume first that i = j . Since G contains an induced 2K2 , there must be another edge in M, say (c, d) with c ∈ V1 and d ∈ V2 . Then c ∈ Uj , otherwise c is adjacent to b, and similarly d ∈ Ui . But now any / Uj ) or vertex f in V1 is adjacent either to b (if f ∈ to d (if f ∈ / Ui ). Hence (a, b) and (c, d) are the only edges in M, i.e., iµ(G) = 2. Now let i = j . In that case, every vertex outside of Ui is adjacent either to a or to b. Therefore, all the remaining edges of M belong to G[Ui ], i.e., iµ(G) = iµ(Hi ). ✷ Lemmas 3, 4, 5 together with Theorem 2 allow us to reduce the problem under consideration from class
V.V. Lozin / Information Processing Letters 81 (2002) 7–11
C to K1,3 -free bipartite graphs or their complements. Clearly any connected K1,3 -free bipartite graph is either an even cycle or a path. Denoting by [p] the integral part of a real number p, we get the following immediate conclusion for these graphs. Lemma 6. iµ(Ck ) = [k/3], iµ(Pk ) = [(k + 1)/3]. If a graph G ∈ C is the bipartite complement to a cycle Ck or to a path Pk , then we may be restricted to case k 7, otherwise G is P7 -free (a bi-cograph), and therefore is disconnected due to results in [3]. k ) = iµ(Pk ) = 2. Lemma 7. Let k 7, then iµ(C Proof. To prove the lemma, let us note that the bipartite complement to a 3K2 is a C6 . Clearly Ck and k and Pk with k Pk with k 7 are C6 -free. Hence C k ) 2 and iµ(Pk ) 2. On 7 are 3K2 -free, i.e., iµ(C the other hand, both Ck and Pk with k 7 contain an 2 = 2K2 . Therefore, induced 2K2 , and moreover, 2K k ) = iµ(Pk ) = 2. ✷ iµ(C Summarizing the above arguments, we conclude the following. The maximum induced matching problem is trivial for a graph G ∈ C if (1) G is 2K2 -free (iµ(G) 1) or are connected and prime (Lemmas 6 (2) both G and G and 7). The problem for a general graph G in C can be reduced to the trivial cases as follows. We first find a maximal prime induced subgraph H of G (Lemma 4),
11
and then partition H into disjoint induced subgraphs by recursively applying decomposition into connected components (Lemma 3) or co-components (Lemma 5). The first stage can be trivially implemented in time O(|VG|2 ). In the second stage, we decompose H as long as we get subgraphs satisfying (1) or (2). In the worst case, we have to apply verification of 2K2 -freeness or decomposition operations |VG| times. Each of the operations can be carried out in O(|VG|2 ) steps. Hence we have proved Theorem 3. Given a graph G ∈ C with n vertices, one can find a maximum induced matching in G in O(n3 ) time.
References [1] K. Cameron, Induced matchings, Discrete Appl. Math. 24 (1989) 97–102. [2] G. Fricke, R. Laskar, Strong matchings on trees, Congr. Numer. 89 (1992) 239–243. [3] V. Giakoumakis, J.-M. Vanherpe, Bi-complement reducible graphs, Adv. Appl. Math. 18 (1997) 389–402. [4] M.C. Golumbic, R.C. Laskar, Irredundancy in circular arc graphs, Discrete Appl. Math. 44 (1993) 79–89. [5] M.C. Golumbic, M. Lewenstein, New results on induced matchings, Discrete Appl. Math. 101 (2000) 157–165. [6] C.W. Ko, F.B. Shepherd, Adding an identity to a totally unimodular matrix, LSE Operations Research Working Paper LSE. 94.14, 1994. [7] V.V. Lozin, On a generalization of bi-complement reducible graphs, Lecture Notes in Comput. Sci. 1893 (2000) 528–538.