The Vertex-Disjoint Triangles Problem - Semantic Scholar

3 downloads 0 Views 189KB Size Report
problem (3DM), which given a set of n boys, n girls and n houses and their mutual affinities, asks for the existence of a perfect marriage in which each boy.
The Vertex-Disjoint Triangles Problem Venkatesan Guruswami1 ? , C. Pandu Rangan1 ?? , M. S. Chang2 G. J. Chang3 , and C. K. Wong4

???

,

1

Dept. of Computer Science & Engg., Indian Institute of Technology, Madras-600 036, INDIA. 2 Dept. of Comp. Sci. and Information Engg., National Chung Cheng University, Ming-Hsiun, Chiayi 621, Taiwan, Republic of China. 3 Dept. of Computer Sci., National Chio-Tung University, Taiwan, Republic of China. 4 Dept. of Computer Sci. and Engg, Chinese University of Hong Kong, Hong Kong.

Abstract. The vertex-disjoint triangles (VDT) problem asks for a set of maximum number of pairwise vertex-disjoint triangles in a given graph G. The triangle cover problem asks for the existence of a perfect triangle packing in a graph G. It is known that the triangle cover problem is NPcomplete on general graphs with clique number 3 [6]. The VDT problem is MAX SNP-hard on graphs with maximum degree four, while it can be approximated within 3/2 + , for any  > 0, in polynomial time [11]. We prove that the VDT problem is NP-complete even when the input √ graphs are chordal, planar, line or total graphs. We present an O(m n) algorithm for the VDT problem on split graphs and an O(n3 ) algorithm for the VDT problem on cographs. A linear algorithm for the triangle cover problem on strongly chordal graphs is also presented. Finally, the notion of packing-hardness, which may be crucial to the understanding of the difficulty of generalized matching problems, is defined.

1

Introduction

The triangle cover problem is defined as follows: Given a graph G = (V, E) with |V | = 3n, are there n vertex-disjoint triangles in G ? This problem is known to be NP-complete on general graphs [6]: another related problem called the Vertexdisjoint Triangles (VDT) problem asks for a set of maximum number of vertexdisjoint triangles in a given graph G. This problem is also NP-hard (since the more restricted triangle cover problem is NP-complete), but can be approximated within 3/2+ for any  > 0 [11]. The problem is MAX SNP-hard even on degreebounded graphs [12], but admits a polynomial time approximation scheme on planar graphs [1] and λ-precision unit disk graphs [10]. There are, however, apparently no hardness results or exact algorithms known for this problem on natural restricted families of graphs, and it is the purpose of this paper to initiate an investigation of such issues. ? ?? ???

Current Email: [email protected] Email: [email protected] Email: [email protected]

J. Hromkoviˇ c, O. S´ ykora (Eds.): WG’98, LNCS 1517, pp. 26–37, 1998. c Springer-Verlag Berlin Heidelberg 1998

The Vertex-Disjoint Triangles Problem

27

We are attempting to solve a specific instance of a generalized matching problem, namely tripartite matching. The classical matching problem asks for a set of maximum number of independent edges in a given graph. The notion of a matching in a graph not only has a beautiful mathematical theory associated with it, but also has numerous applications in such diverse fields as transversal theory, assignment problems, network flows, multiprocessor scheduling, and the Chinese postman and traveling salesman problems. Generalization of the classical matching problem is motivated by both theoretical and practical constraints and has also motivated a lot of research though most of them have only negative NP-completeness results [9,13]. As mentioned in [13], the problem seems to be especially relevant in the context of examination scheduling, where in addition to assignment of courses to examinations without any first-order conflicts (essentially a graph coloring problem), there is the additional objective of minimizing second-order conflicts (or inconveniences) like a student writing two examinations on the same day. It is well known that a maximum matching of a general graph can be found in polynomial time [5,14], however the generalized matching problem seems to be very difficult [13]. Thus, research in this direction also helps in narrowing down the perceived gap between the classes P and NP with respect to graph packing problems. One other possible application for the Km -packing problem (for a fixed m), mentioned in [3] as the orgy problem, is that: Given a group of people and the affinities and dislikes between them, is it possible to divide them into groups of m members each such that the persons in each group are all mutually compatible (if such a partition is not possible, find one that leaves the least number of isolated persons). Note that a special case of the K3 -packing (or VDT) problem which we are dealing with in this paper, is the classical 3-dimensional matching problem (3DM), which given a set of n boys, n girls and n houses and their mutual affinities, asks for the existence of a perfect marriage in which each boy lives with a distinct girl in a house acceptable to both of them. We consider the VDT problem on some interesting classes of graphs. We prove that the vertex-disjoint triangles problem is NP-complete on chordal graphs, planar graphs, line graphs and total graphs. A linear algorithm for the triangle cover problem is presented for the class of strongly chordal graphs. We also provide a polynomial time algorithm for the VDT problem when the input graph is restricted to split graphs and cographs. The algorithm for cographs is based on dynamic programming and runs in O(n3 ) time. We now review some definitions relating to special classes of graphs. A graph is chordal if it contains no induced cycle of length greater than three. A graph is strongly chordal if it is chordal and every even cycle of length greater than 4 has an odd chord. A strongly chordal graph G = (V, E) has an associated strong elimination ordering of vertices as v1 , v2 , . . . , vn that satisfies, for each i, (1 ≤ i ≤ n), Ni [vj ] ⊆ Ni [vk ] whenever vj , vk ∈ Ni [vi ] and j < k. ( Ni [v] stands for the closed neighborhood of v in the subgraph Gi of G induced by {vi , vi+1 , . . . , vn } ). A cograph is a graph that has no induced P4 . A graph is said

28

V. Guruswami et al.

to be split if its vertex set can be partitioned into a clique and an independent set. For a comprehensive treatment of these classes of graphs, see [7]. The line graph of an undirected simple graph G, denoted L(G), has vertex set equal to the edge set of G and two vertices in L(G) are adjacent if their corresponding edges in G are incident upon a common vertex of G. The total graph of a graph G = (V, E), denoted T (G), has vertex set V ∪ E and two vertices of T (G) are adjacent if the corresponding vertices and edges of G are adjacent. Note that T (G) will have both G and L(G) as induced subgraphs. For all graph-theoretic terms not defined explicitly here, refer [8]. Let us fix some notation that will be used throughout this paper. For a graph G, we use α(G), ω(G) and γ(G) to stand for the size of the largest independent set in G, clique number of G and the size of a minimum vertex-cover of G respectively. Also the parameter that is our main concern in this paper, namely the maximum number of pairwise vertex-disjoint triangles in G, will be denoted by t(G).

2

NP-completeness Results

2.1

Chordal Graphs

In the following, we will prove that the VDT problem is NP-hard on chordal graphs1 . We prove this result by reducing the 3-satisfiability problem to the VDT problem on chordal graphs. Problem. The 3-satisfiability problem (3SAT). Instance: Collection C = {c1 , c2 , · · · , cm } of clauses on a finite set U of variables such that |ci | = 3 for 1 ≤ i ≤ m. Question: Is there a truth assignment for U that satisfies all the clauses in C? We will first show how to construct a chordal graph from a 3SAT instance. Given an instance of 3SAT where C = {c1 , c2 , · · · , cm } and U = {u1 , u2 , · · · , un }, we will construct a chordal graph. – For each variable ui , we construct ¯ j] : 1 ≤ j ≤ m}, Wi = {w[i, j], w[i, Xi = {x[i, j], x ¯[i, j] : 1 ≤ j ≤ m}, Si = {s[i, j] : 1 ≤ j ≤ m}, and Ti = {t[i, j] : 1 ≤ j ≤ m}. Let W = ∪ni=1 Wi , X = ∪ni=1 Xi , S = ∪ni=1 Si , and T = ∪ni=1 Ti . – For each clause cj , we construct a vertex y[j]. Let Y = {y[j] : 1 ≤ j ≤ m}. We will construct a chordal graph GC = (X ∪W ∪K, KK ∪W K ∪XW ∪XY ) where K = S ∪ T ∪ Y is a clique, both W and X are independent sets, KK is the set of all edges connecting two vertices of K, XW is the set of edges connecting a vertex in X and a vertex in W and so on. We have shown how to construct S, T , and K. Totally, vertex set K has 2mn + m vertices and both vertex sets W 1

After presentation of this paper, we found out about reference [4] where the VDT problem on chordal graphs is mentioned as an open question.

The Vertex-Disjoint Triangles Problem

29

and X have 2mn vertices each. Next, we show how to construct XW , XY , and W K. – Each vertex w[i, j] (resp. w[i, ¯ j]) is connected to a vertex x[i, j] (resp. x ¯[i, j]). Let XW = {(x[i, j], w[i, j]), (¯ x[i, j], w[i, ¯ j]) : 1 ≤ i ≤ n, 1 ≤ j ≤ m}. – Each vertex w[i, j] is connected to vertex s[i, j + 1] if 1 ≤ j < m and each vertex w[i, m] is connected to vertex s[i, 1]. Each vertex w[i, ¯ j] is connected to vertex s[i, j]. Each vertex t[i, j] is connected to vertices w[i, j] and w[i, ¯ j]. That is, for each variable ui , we construct the following two sets of edges: ¯ j], s[i, j]) : 1 ≤ j < m} ∪ W Si = {(w[i, j], s[i, j + 1]), (w[i, {(w[i, m], s[i, 1]), (w[i, ¯ m], s[i, m])} and, ¯ j]) : 1 ≤ j ≤ m}. W Ti = {(t[i, j], w[i, j]), (t[i, j], w[i, Let W S = ∪ni=1 W Si and W T = ∪ni=1 W T i. ¯i ∈ cj ), y[j] is connected to w[i, j] and x[i, j] (resp. – For each ui ∈ cj (resp. u w[i, ¯ j] and x ¯[i, j]). ¯ j], y[j]) : u ¯i ∈ cj }, and W Y = {(w[i, j], y[j]) : ui ∈ cj } ∪ {(w[i, x[i, j], y[j]) : u ¯i ∈ cj }. XY = {(x[i, j], y[j]) : ui ∈ cj } ∪ {(¯ – Let W K = W S ∪ W T ∪ W Y . It is straightforward to verify that GC = (X ∪W ∪K, KK ∪W K ∪XY ∪XW ) is a chordal graph and can be constructed in polynomial time. Totally, there are 4mn+m(2n+1) vertices in GC . We now state the following lemma and sketch its proof (the complete details of the proof may be found in the full version of the paper). Lemma 1. The 3SAT instance has a truth assignment for U that satisfies all clauses in C if and only if GC has m(n + 1) vertex-disjoint triangles. Proof: (Sketch :) We outline the proof of the “if” part, the other part follows similarly. Suppose GC has a set T of m(n + 1) vertex-disjoint triangles. It can be shown that each triangle in T contains a vertex y ∈ Y or two vertices in K with one in S and the other in T . Consider the subgraph GC [i] induced by Wi ∪ Si ∪ Ti . The set of triangles Ti in GC [i] can be partitioned into two sets: ¯ j], s[i, j], t[i, j]} : 1 ≤ j ≤ m} and, Tit = {{w[i, Tif = {{w[i, j], s[i, j + 1], t[i, j]} : 1 ≤ j < m} ∪ {{w[i, m], s[i, 1], t[i, m]}}. It can also be shown that T will have to include exactly m triangles from Ti , either all triangles in Tit or all triangles in Tif . Thus, in general T specifies a truth assignment for U , with the variable ui being set true if and only if T ∩ Ti = Tit . It is easy to see that owing to the existence of m triangles in T with one vertex each from Y , W and X, this truth assignment will indeed satisfy all clauses in C. Using lemma 1 and the fact that GC can be constructed in polynomial time from the 3SAT instance, we immediately have: Theorem 1. The vertex-disjoint triangle problem is NP-complete on chordal graphs.

30

2.2

V. Guruswami et al.

Planar Graphs

Theorem 2. The vertex-disjoint triangle problem is NP-complete on planar graphs. Proof : The reduction is from the the independent set problem on planar cubic graphs [6]. Let H = (V, E) be an arbitrary planar cubic graph. We reduce the problem of determining α(H) to the problem of finding t(G), for a suitably constructed planar graph G. Let |V | = n and |E| = m. First form H 0 = (V 0 , E 0 ) (H 0 will not be simple) from H as follows: For 1 ≤ i ≤ m, insert two new vertices ui and wi in the edge ei of H and add one more edge between ui and wi . More precisely, if V = {1, 2, · · · , n} and E = {e1 , e2 , · · · , em } where ei = (f (i), g(i)) for 1 ≤ i ≤ m Define V 0 = V ∪ {ui , wi |1 ≤ i ≤ m} and Ei = {(f (i), ui ), (wi , g(i)), pi , qi } where pi , qi are the two edges between ui and wi in H 0 . Now set E 0 = ∪m i=1 Ei . Clearly H 0 has no triangle, is planar and is 3-regular. Though, line graph are defined in the strict sense only for simple graphs, we can speak of the line graph of H 0 – L(H 0 ) whose vertices correspond to edges of H 0 and two vertices in L(H 0 ) are adjacent iff the corresponding edges share at least one vertex in common. We set G = L(H 0 ). It is not difficult to see that G will also be planar and ∆(G) = 4. Since H 0 is triangle-free and 3-regular, it is easy to see that t(G) = α(H 0 ). From our construction of H 0 , it is possible to verify that α(H 0 ) = α(H) + m. Hence we have: t(G) = α(H) + m. The conclusion now follows since G is planar with ∆ = 4 and can be constructed from H in polynomial time. 2.3

Line Graphs

We now prove that the VDT problem is NP-complete on line graphs ( Note that line graphs are defined only for simple graphs). Lemma 2. If G is a triangle-free 3-regular simple graph and L(G) is its line graph, then t(L(G)) = α(G). Theorem 3. The independent set problem is NP-complete on triangle-free 3regular graphs. Proof (Sketch :) The reduction is once again from the independent set problem on planar cubic graphs [6]. Let H = (V 0 , E 0 ) be an arbitrary planar cubic graph. We reduce the problem of determining α(H) to the problem of finding α(G) for a suitably constructed triangle-free cubic graph G. Let V 0 = {1, 2, · · · , n} and E 0 = {e1 , e2 , · · · , em } and ei = (f (i), g(i)) for 1 ≤ i ≤ m. Define G = (V, E) as follows: For 1 ≤ i ≤ m, set Ui = {uij |1 ≤ j ≤ 8} and Ei = {(f (i), ui1 ), (g(i), ui8 )} ∪ {(uij , ui,j+1 )|1 ≤ j < 8} ∪ {(ui8 , ui1 )} ∪ {(uij , ui,j+3 )|j = 2, 3, 4}

The Vertex-Disjoint Triangles Problem

31

Sm 0 Now define: E = ∪m i=1 Ei and V = V ∪ ( i=1 Ui ). Note that |V | = 8m + n and |E| = 13m. Informally, in G we attach a 8-cycle with certain specific diagonals instead of each edge of H. From the construction it is clear that G is 3-regular and has no triangle. By our construction of G, it can be shown that α(G) = α(H) + 4m and the result follows since G can clearly be obtained in polynomial time from H. Theorem 4. The vertex-disjoint triangle problem is NP-complete on line graphs. Proof : Follows from lemma 2 and theorem 3. 2.4

Total Graphs

Recall that the total graph of G = (V, E) is given by T (G) = (V ∪ E, E 00 ) where: E 00 = E ∪ {(e1 , e2 )|e1 , e2 ∈ E and e1 , e2 are adjacent in G } ∪{(v, e)|v ∈ V, e ∈ E and v is one of the ends of e in G} Theorem 5. The vertex-disjoint triangles problem is NP-complete even when restricted to total graphs. Proof: The problem is clearly in NP. To prove NP-completeness, we employ a reduction from the independent set problem on a 3-regular triangle-free graph H = (V, E) which is NP-complete due to theorem 3. Let V = {v1 , v2 , . . . , vn }. From H obtain a graph H 0 by attaching a new pendant vertex to each vertex of H. More formally, H 0 = (V 0 , E 0 ) where: V 0 = V ∪ {ui |1 ≤ i ≤ n} and, E 0 = E ∪ {qi = (ui , vi )|1 ≤ i ≤ n}. Now, let G = T (H 0 ) be the total graph of H 0 . Let P be a set of maximum number of pairwise vertex-disjoint triangles of G. By the nature of the graph H 0 , it is easy to see that P may be modified without reducing its cardinality to include Sn all the triangles Ti of the form (ui , qi , vi ) of G for 1 ≤ i ≤ n. Since V 0 ⊂ i=1 Ti , clearly the optimum way to find the remaining triangles for P , is to find a set of maximum number of vertex-disjoint triangles of L(H). Thus, we have: t(T (H 0 )) = n + t(L(H)) and using lemma 2, t(T (H 0 )) = n + α(H). The result now follows since determining α(H) is NP-complete and G = T (H 0 ) can be constructed in polynomial time from H.

3

Triangle Cover on Strongly Chordal Graphs

In this section we present a linear algorithm for the triangle cover problem on strongly chordal graphs given the strong elimination ordering2 . Let v1 , v2 , · · · , vn 2

We found out, after presentation of this paper, that this result also appears in [4] – in fact a more general algorithm that works for all chordal graphs is presented there.

32

V. Guruswami et al.

be the strong elimination ordering of a strongly chordal graph G = (V, E), |V | = n, |E| = m. Let N (v1 ) = {vi1 , · · · , vik } with 1 < i1 < · · · < ik . The following lemma forms the basis of our algorithm: Lemma 3. If G has a triangle cover, then G has a triangle cover comprising the triangle (v1 , vi1 , vi2 ). Proof : Since G has a triangle cover T , we must have k ≥ 2 (k = |N (v1 )|), let (v1 , vip , viq ) belong to the triangle cover (p < q). Then by strong elimination ordering , N (vi1 ) ⊆ N (vip ), N (vi2 ) ⊆ N (viq ). So vip and viq can be substituted for vi1 and vi2 respectively in the triangles in which they occur in T to give another triangle cover T 0 such that (v1 , vi1 , vi2 ) ∈ T 0 . Using the above lemma, we devise the following algorithm to find a triangle cover of a strongly chordal graph G if one exists: Algorithm TC-SCG : Input : A strongly chordal graph G = (V, E) along with its strong elimination ordering v1 , v2 , · · · , vn . Output : Whether or not G has a triangle cover. 1. Initially all vi ∈ V are unmarked. 2. While there exists an unmarked vertex in V (a) Choose the smallest such vertex, say vk ∈ V (b) If vk has more than one neighbor vi with i > k then – Let vp ,vq be the smallest such neighbors – Mark vk , vp , vq and continue else output that G has no triangle cover. 3. Output that G has a triangle cover. The proof of correctness follows from lemma 3. It is straightforward to modify the algorithm so that it outputs a triangle cover if one exists. The complexity is clearly linear once the ordering of vertices is available. Hence, we get, Theorem 6. For a strongly chordal graph, a triangle cover, if one exists, can be obtained in linear time once the strong elimination ordering of vertices is available.

4

Vertex-Disjoint Triangles of Split Graphs

We now prove that if the input graph is restricted to split graphs, the vertexdisjoint triangles problem can be solved in polynomial time. Suppose G = (V, E) is a split graph where V is the disjoint union of an independent set S and a clique K. Clearly it is enough to find the maximum number of vertex-disjoint triangles in G such that each triangle has one vertex from S and two from K (the optimal way to find some more triangles all of whose vertices are in K to form the optimal triangle packing is obvious) and so we will consider this problem from now on. Henceforth, we shall denote by tS(G) the maximum number of vertex-disjoint triangles in G each of which has one vertex from S. Since K induces a clique, the following lemma is obvious (recall that t(G) denotes the maximum number of vertex-disjoint triangles in G):

The Vertex-Disjoint Triangles Problem

33

Lemma 4. If G = (V, E) is a split graph, then:   |K| − 2 × tS(G) t(G) = tS(G) + 3 We now proceed to map the vertex-disjoint problem on a split graph G = (V, E) with V = S ∪ K as above, to the maximum matching problem on a suitably defined graph H. The construction of the graph H is described below: For each u ∈ S ⊆ V , add a new vertex u0 that is adjacent to all and only vertices to which u is adjacent in G. Also “join” u and u0 by an edge. Also make K an independent set in H. Let H be the resulting graph. More formally, H = (V 0 , E 0 ) where: V 0 = V ∪ {u0 |u ∈ S ⊆ V } and, E 0 = {(u, u0 )|u ∈ S} ∪ {(u, v), (u0 , v)|u ∈ S, v ∈ K and (u, v) ∈ E}. Lemma 5. If m(H) denotes the matching number of H, then tS(G) = m(H) − |S|. Proof: Let M be a maximum matching of H, so that |M | = m(H). A matching M is said to saturate a vertex v, if v is one of the ends of some edge in M . If for some u ∈ S ⊆ V , M saturates u without saturating u0 or saturates u0 without saturating u, then clearly the matching M may be modified (without changing its cardinality) so that it includes the edge (u, u0 ). Thus repeating this process we will obtain a matching M 0 in which for each pair of vertices {u, u0 } where u ∈ S, either the edge (u, u0 ) is used by M 0 or both u, u0 are saturated by different edges of M 0 . By our construction, the neighborhoods of u, u0 coincide in H, it therefore follows that tS(G) equals the number of pairs (u, u0 ) such that u and u0 are saturated by different edges of M 0 and this can be easily seen to be |M 0 | − |S| = |M | − |S| = m(H) − |S| √ Theorem 7. The vertex-disjoint triangles problem can be solved in O(m n) time on split graphs. Proof: Clearly it suffices to consider connected split graphs G = (V, E). Based on the proof of lemma 5, we find that a maximum number of pairwise vertexdisjoint triangles in G may be obtained from any maximum matching M of H = (V 0 , E 0 ) as follows: 1. For each u ∈ S such that u and u0 are both saturated by different edges (u, v1 ) and (u0 , v2 ) of M where v1 , v2 are distinct vertices in K, add the triangle (u, v1 , v2 ) to the triangle-packing. 2. Pack as many triangles, all of whose three vertices will lie in K, using the vertices of K left unused by step 1. Clearly the process can be done in linear time, if for each vertex v ∈ V (H), 0 | = its neighbor if any in M is stored and presented along with M . Since |V √ 0 O(n) and |E | = O(m + n), the entire process may be implemented in O(m n) time [14].

34

5

V. Guruswami et al.

Cographs

In this section, we devise a polynomial algorithm for the VDT cover problem on cographs based on dynamic programming. Cographs (or Complement reducible graphs) are graphs with no induced P4 . The class of cographs may also be defined recursively as follows: – K1 is a cograph. – If G1 ,G2 are cographs, then so is G1 ∪ G2 and G1 × G2 ((Gc1 ∪ Gc2 )c ). Lemma 6. Let G = G1 × G2 , G1 = (V1 , E1 ), G2 = (V2 , E2 ) and let T be a set of p vertex-disjoint Km s in G (m ≥ 2). Then there exists T 0 , a set of p vertexdisjoint Km s such that T 0 covers the same vertices as does T and T 0 does not contain two Km s C1 ,C2 such that C1 ∩ V1 = φ and C2 ∩ V2 = φ. Lemma 7. If m = 2 in lemma 6 above and |V1 | ≤ |V2 |, then T 0 can be chosen so that every edge in T 0 intersects V2 . Let G = (V, E), |V | = n. Define f (G, p) for 0 ≤ p ≤ n as follows:   −1 if G does not have p vertex-disjoint triangles f (G, p) = q if G has pvertex-disjoint triangles and a matching of size q disjoint  with the p triangles (q ≥ 0) and q is the largest such number 5.1

Recurrence equations for f (G, p)

We now give recurrence equations for f (G, p) for the two cases G = G1 ∪ G2 and G = G1 × G2 , Gi = (Vi , Ei ), |Vi | = ni for i = 1, 2. Case 1: G = G1 ∪ G2 Since p triangles in G have to be chosen as i triangles from G1 and p − i triangles from G2 for some 0 ≤ i ≤ p, we clearly have f (G, p) = max (f (G1 , i) + f (G2 , p − i)) 0≤i≤p

Case 2: G = G1 × G2 This case is more tricky as triangles can have 0, 1 or 2 vertices from V1 and V2 . However by lemma 6, we may assume that in choosing the p triangles either no triangle with all three vertices in V1 is chosen or no triangle with all three vertices in V2 is chosen, hence following sub-cases arise : Case 2.1: No triangle with all three vertices in V1 is chosen. Let s, r, t denote the number of triangles with 2,1 and 0 vertices in V1 respectively that are chosen with s + r + t = p , s, r, t ≥ 0. Denote by α(s, r, t) the maximum number of independent edges disjoint with p triangles with s, r, t number of them (the triangles) having 2,1 and 0 vertices from V1 respectively.Let k1 and k2 be the number of vertices in V1 ,V2 respectively that are “free” for choosing edges disjoint with the p triangles. Then, k1 = n1 − r − 2s and k2 = n2 − s − 2r − 3t.

The Vertex-Disjoint Triangles Problem

35

By lemma 6 and lemma 7, we may assume that the chosen maximum number of edges comprise exactly min{k1 , k2 } edges from V1 ×V2 . It follows that α(s, r, t) is given as follows: – k1 < 0 or k2 < 0 or f (G2 , t) < r or f (G1 , 0) < s : α(s, r, t) = −1 – f (G2 , t) ≥ r, f (G1 , 0) ≥ s, 0 ≤ k1 ≤ k2  k1 + f (G2 , t) − r if 2(f (G2 , t) − r) ≤ k2 − k1 α(s, r, t) = 1 k1 + b k2 −k otherwise 2 c – f (G2 , t) ≥ r, f (G1 , 0) ≥ s, 0 ≤ k2 < k1  k2 + f (G1 , 0) − s if 2(f (G1 , 0) − s) ≤ k1 − k2 α(s, r, t) = 2 k2 + b k1 −k otherwise 2 c In order that α(s, r, t) ≥ 0, the value of r should satisfy the following constraints: k1 ≥ 0, k2 ≥ 0, f (G2 , t) ≥ r, and f (G1 , 0) ≥ s = p − t − r. In other words, since k1 = n1 − r − 2s = n1 − r − 2(p − t − r) = (n1 − 2p + 2t) + r and k2 = n2 − s − 2r − 3t = n2 − (p − t − r) − 2r − 3t = (n2 − p − 2t) − r, we must have: min{n2 − p − 2t, f (G2 , t)} ≥ r ≥ max{−(n1 − 2p + 2t), p − t − f (G1 , 0)}. Now it is a straight-forward computation to show that (k2 −k1 )−2(f (G2 , t)− 1 r), (k1 − k2 ) − 2(f (G1 , 0) − s), k1 + f (G2 , t) − r, k2 + f (G1 , 0) − s, k1 + b k2 −k 2 c k1 −k2 and k2 + b 2 c are all independent of the value of r (as well as s) and depend only on n1 , n2 , p, t, f (G1 , 0) and f (G2 , t). Define αp0 to be the maximum number of independent edges that can be chosen such that they are vertex-disjoint with p triangles none of which has all three vertices in V1 . Clearly, we have: αp0 = max{α(s, r, t)|0 ≤ s, r, t ≤ n, s + r + t = p}. For a fixed triple (s, r, t), it is clear that α(s, r, t) can be computed in O(1) time, and hence from the above discussions, it is easy to see that αp0 can be computed in O(n) time. Case 2.2: No triangle with all three vertices in V2 is chosen. In this one can define β(s, r, t) and βp0 in a manner similar to case 2.1 and set up similar equations. It follows also that βp0 can be computed in O(n) time as well. Clearly we have, for the case of join operation, f (G, p) = max{αp0 , βp0 }. 5.2

Complexity Analysis

Using the results of section 5.1, the fact that the parse tree associated with a cograph G can be obtained in linear time [2] and the fact t(G) = max{p : f (G, p) ≥ 0}, the following results may be shown: Lemma 8. If G = G1 ∪ G2 or G = G1 × G2 , then given f (G1 , p) and f (G2 , p) for 0 ≤ p ≤ n, computation of f (G, p) for 0 ≤ p ≤ n can be done in O(n2 ) time. Theorem 8. The maximum number of vertex-disjoint triangles of a cograph can be computed in O(n3 ) time.

36

6

V. Guruswami et al.

Conclusions and Open Questions

We have established that though matching is polynomial-time solvable even on general graphs, tripartite matching or the vertex-disjoint triangle problem is NPcomplete even when restricted to chordal, planar, line and total graphs. Thus, for most natural classes of graphs, packing a graph H (i.e finding vertex-disjoint induced copies of H) in a graph G of that class becomes difficult when H has three vertices. This motivates the definition of the notion of packing-hardness number of a class C of graphs as follows: The packing-hardness number of a class C of graphs, denoted P H(C), is the smallest integer n such that there exists a n–vertex graph H such that packing H in graphs of the class C becomes NP-complete. Since matching is polynomial-time solvable, it follows that P H(C) ≥ 3 for all classes C of graphs. The packing-hardness number is thus an excellent measure of the difficulty of generalized matching problems on any given class of graphs. It is proved in [13] that packing any connected graph with more than two vertices is NP-complete on general graphs and consequently the packing-hardness number of general graphs equals three. Also, it follows from our definition that, if the VDT problem is NP-complete on a class C of graphs, then P H(C) = 3. Thus, this paper proves that the packing-hardness number of chordal, planar, line and total graphs is each equal to three. This paper is thus the stepping stone for further research on the complexity of generalized matching problems on special classes of graphs. The determination of the packing-hardness number for several other classes of graphs will be presented as part of a separate document. The VDT problem itself remains open on several other interesting classes of graphs like permutation, distance-hereditary and comparability graphs. It is easy to prove that the VDT problem is solvable in linear time on complements of bipartite graphs. It however remains open on the super-class of cocomparability graphs.

References 1. B.S.Baker. Approximation algorithms for NP-complete problems on planar graphs. Journal of the ACM, 41(1994), 153-180. 2. D.G.Corneil, Y.Perl and L.K.Stewart. A Linear recognition algorithm for cographs. SIAM Jl. on Computing, 14(1985), pp 926-934. 3. G.Cornuejols, D.Hartvigsen and W.Pulleyblank. Packing Subgraphs in a Graph. Operations Research Letters, 1(1982), pp 139-143. 4. E.Dahlhaus and M.Karpinski. Matching and Multidimensional Matching in Chordal and Strongly Chordal Graphs, Discerete Applied Math., (84)1998, pp 79-91. 5. J.Edmonds. Paths, trees and flowers. Canadian J. Math., 17(1965), pp 449-469. 6. M.R.Garey and D.S.Johnson. Computers and Intractability: A guide to the theory of NP-completeness. Freeman, San Francisco, 1979. 7. M.C.Golumbic. Algorithmic graph theory and Perfect graphs. Academic Press, New York, 1980. 8. F.Harary. Graph Theory. Addison-Wesley, Reading, MA, 1969.

The Vertex-Disjoint Triangles Problem

37

9. P.Hell and D.G.Kirkpatrick. On generalized matching problems. Info. Proc. Letters, 12(1981), pp 33-35. 10. H.B.Hunt III, M.V.Marathe, V.Radhakrishnan, S.S.Ravi, D.J.Rosenkrantz and R.E.Stearns. A unified approach to approximation schemes for NP- and PSPACEhard problems for geometric graphs. Proc. 2nd Ann. European Symp. on Algorithms (1994), Lecture Notes in Comput. Sci. 855, Springer-Verlag, 424-435. 11. C.A.J.Hurkens and A.Schrijver. On the size of systems of sets every t of which have an SDR, with an application to the worst-case ratio of heuristics for packing problems. SIAM J. Discrete Mathematics, 2 (1989), 68-72. 12. V.Kann. Maximum bounded 3-dimensional matching is MAX SNP-complete. Information Processing Letters, 37(1991), pp 27-35. 13. D.G.Kirkpatrick and P.Hell. On the complexity of general graph factor problems. SIAM Jl. on Computing, 12(1983),p pp 601-609. 14. S.Micali and V.V.Vazirani. An O( |V ||E|) algorithm for finding maximum matching in general graphs. Proc. 21st Annual Symposium on the foundation of Comp. Sci., (1980), pp 17-27.