Locally connected spanning trees in cographs, complements of bipartite graphs and doubly chordal graphs

Locally connected spanning trees in cographs, complements of bipartite graphs and doubly chordal graphs

Information Processing Letters 110 (2010) 1067–1073 Contents lists available at ScienceDirect Information Processing Letters www.elsevier.com/locate...

181KB Sizes 1 Downloads 66 Views

Information Processing Letters 110 (2010) 1067–1073

Contents lists available at ScienceDirect

Information Processing Letters www.elsevier.com/locate/ipl

Locally connected spanning trees in cographs, complements of bipartite graphs and doubly chordal graphs B.S. Panda ∗ , D. Pradhan 1 Computer Science and Application Group, Department of Mathematics, Indian Institute of Technology Delhi, Hauz Khas, New Delhi 110 016, India

a r t i c l e

i n f o

a b s t r a c t

Article history: Received 7 March 2010 Received in revised form 19 August 2010 Accepted 18 September 2010 Available online 22 September 2010 Communicated by M. Yamashita Keywords: Algorithms Graph algorithms Locally connected spanning tree NP-complete

A spanning tree T of a graph G = ( V , E ) is called a locally connected spanning tree if the set of all neighbors of v in T induces a connected subgraph of G for all v ∈ V . The problem of recognizing whether a graph admits a locally connected spanning tree is known to be NPcomplete even when the input graphs are restricted to chordal graphs. In this paper, we propose linear time algorithms for finding locally connected spanning trees in cographs, complements of bipartite graphs and doubly chordal graphs, respectively. © 2010 Elsevier B.V. All rights reserved.

1. Introduction A communication network can be modeled as a graph G = ( V , E ) in which vertices correspond to sites in the network and an edge exists between two vertices if there is a communication link between these vertices. A network is immune to a set of failures if and only if all operative sites remain connected. Two communication link failures are isolated if the inoperative links are not incident to a common site. Two site failures are isolated if the two down sites are not neighbors. A link failure and a site failure are isolated if the inoperative link is not incident to a down site or to a neighbor of that site. A set of failures are isolated if they are pairwise isolated. A network is isolated failure immune (IFI) if and only if the communication between operative sites can be completed as long as network failures are isolated. This concept of networks immune to isolated failures was introduced by Farley [2].

*

Corresponding author. E-mail addresses: [email protected] (B.S. Panda), [email protected] (D. Pradhan). 1 This author was supported by Council of Scientific & Industrial Research (CSIR), India. 0020-0190/$ – see front matter doi:10.1016/j.ipl.2010.09.008

© 2010

Elsevier B.V. All rights reserved.

A spanning tree T of a graph G = ( V , E ) is called a locally connected spanning tree if the set of all neighbors of v in T induces a connected subgraph of G for every v ∈ V (G ). The notion of locally connected spanning tree was introduced by Cai [9] and is closely related to IFI networks. In fact, a network containing a locally connected spanning tree is an IFI network (see [2,8,10]). The locally connected spanning tree recognition problem is to recognize whether a given graph G admits a locally connected spanning tree. The locally connected spanning tree construction problem is to construct a locally connected spanning tree of a given graph that is known to admit a locally connected spanning tree. Cai [10] proved that the locally connected spanning tree recognition problem is NP-complete for planar graphs and split graphs. Since split graphs are chordal, the locally connected spanning tree recognition problem is NP-complete for chordal graphs. A graph admits a locally connected spanning tree only if it is 2-connected [10]. Cai [10] proved that a directed path graph admits a locally connected spanning tree if and only if it is 2-connected by proposing a linear time algorithm to construct a locally connected spanning tree of a 2-connected directed path graph. The locally connected spanning tree recognition and construction problems for the class of strongly chordal graphs, a superclass of di-

1068

B.S. Panda, D. Pradhan / Information Processing Letters 110 (2010) 1067–1073

rected path graphs, were left open by Cai [10] and was subsequently solved by Lin et al. [3]. In fact Lin et al. [3] proposed a linear time algorithm to construct a locally connected spanning tree of a 2-connected strongly chordal graph. This implies that a strongly chordal graph admits a locally connected spanning tree if and only if it is 2-connected. Cai [10] also proposed a linear time algorithm for adding fewest edges to a graph to make a given spanning tree of the graph a locally spanning tree of the augmented graph. Lin et al. [3] proposed a linear time algorithm to construct a locally connected spanning tree of a 2-connected proper circular-arc graphs. In this paper, we solve the locally connected spanning tree recognition and construction problems for doubly chordal graphs in linear time. As doubly chordal graphs include strongly chordal graphs, our result extends the result of Lin et al. [3]. We also solve the locally connected spanning tree recognition and construction problems for cographs and complements of bipartite graphs in linear time. The rest of the paper is organized as follows. Section 2 introduces some pertinent definitions and some known results. The locally connected spanning tree recognition and construction problems for cographs, complements of bipartite graphs, and doubly chordal graphs are presented in Sections 3, 4, and 5, respectively. Finally, Section 6 concludes the paper. 2. Preliminaries For a graph G = ( V , E ), the sets N G ( v ) = {u ∈ V (G ) | uv ∈ E } and N G [ v ] = N G ( v ) ∪ { v } denote the neighborhood and the closed neighborhood of a vertex v, respectively. The degree of a vertex v is | N G ( v )| and is denoted by d G ( v ). Let d G (u , v ) denote the length of the shortest path between u and v and is called as the distance between u and v in G. The diameter of a graph G is the maximum value of d G (u , v ) over all u , v ∈ V (G ). Let n and m denote the number of vertices, and number edges of G, respectively. Let G [ S ] denote the subgraph induced by G on S, S ⊂ V . A graph G = ( V , E ) is said to be bipartite if V (G ) can be partitioned into two disjoint sets X and Y such that every edge joins a vertex in X to another vertex in Y . A partition ( X , Y ) of V is called a bipartition. A bipartite graph with partition ( X , Y ) of V is denoted by G = ( X , Y , E ). Let P r and K r denote a path and the complete graph on r vertices, respectively. A vertex v is called a dominating vertex of graph G = ( V , E ) if N G [ v ] = V . An edge xy is called a dominating edge if N G [x] ∪ N G [ y ] = V . A set S ⊆ V is called a separating set of a connected graph G = ( V , E ) if G − S is disconnected. A vertex v of G is a cut-vertex if { v } is a separating set of G. A graph is k-connected if it contains no separating set of size less than k. A tree T having n vertices is called a star if it has a vertex v of degree n − 1. In this case, v is called the star center of T . If T has exactly two vertices, say x and y, of degree more than one, then T is called a bistar and x and y are called bistar centers of T .

The following lemma gives a necessary condition for a graph to have a locally connected spanning tree. Lemma 2.1. (See [10].) If G has a locally connected spanning tree T and S is a separating set of G, then G [ S ] contains at least one edge of T . Consequently, a graph having a locally connected spanning tree is 2-connected. The following lemma whose proof is easy and is omitted characterizes graphs admitting a star as a locally connected spanning tree. Lemma 2.2. A graph G admits a locally connected spanning tree which is a star if and only if G contains a dominating vertex and G is 2-connected. A vertex v is called a simplicial vertex in G if G [ N G ( v )] is a complete subgraph of G. For a graph G with a simplicial vertex v, the relation between the spanning trees of G and G − v can be found from the following lemma. Lemma 2.3. (See [10].) Let v be a simplicial vertex of G. Then G admits a locally connected spanning tree if and only if G − v admits a locally connected spanning tree which has an edge connecting some two vertices in N G ( v ). Let G 1 = ( V 1 , E 1 ) and G 2 = ( V 2 , E 2 ) be two graphs. Then, G 1 ∪ G 2 , the union of G 1 and G 2 is defined as G 1 ∪ G 2 = ( V 1 ∪ V 2 , E 1 ∪ E 2 ). If V 1 ∩ V 2 = ∅, then G 1 ∪ G 2 is called the disjoint union of G 1 and G 2 . Suppose V 1 ∩ V 2 = ∅. The join, G 1 + G 2 , of G 1 and G 2 is defined as G 1 + G 2 = ( V 1 ∪ V 2 , E 1 ∪ E 2 ∪ {xy | x ∈ V 1 , y ∈ V 2 }). A graph is chordal if every induced cycle of length at least four has a chord. Recall that a vertex v is a simplicial vertex in G if G [ N G ( v )] is a complete subgraph of G. An ordering σ = ( v 1 , v 2 , . . . , v n ) of V is called a perfect elimination ordering (PEO) of G if v i is a simplicial vertex in G i = G [{ v i , v i +1 , . . . , v n }] for each i, 1  i  n. It is known that a graph G is chordal if and only if it admits a perfect elimination ordering (PEO) [6]. For an ordering σ = ( v 1 , v 2 , . . . , v n ), let σ −1 (x) = i if x = v i , 1  i  n. From Lemma 2.1, the graph which contains a locally connected spanning tree must be 2-connected. The following lemma gives a necessary and sufficient condition for a chordal graph to be k-connected. Lemma 2.4. (See [3].) Suppose σ = ( v 1 , v 2 , . . . , v n ) is a perfect elimination ordering of a chordal graph G and k < n is a positive integer. Then G is k-connected if and only if | N G i ( v i )|  k for all i, 1  i  n − k. 3. Locally connected spanning trees in cographs Cographs (also known as complement reducible graphs) are defined as follows:

• K 1 , the complete graph on a single vertex, is a cograph.

• If G 1 and G 2 are cographs, then the disjoint union G 1 ∪ G 2 is a cograph.

B.S. Panda, D. Pradhan / Information Processing Letters 110 (2010) 1067–1073

• If G is a cograph, then G c is a cograph. • No graph other than the graphs obtained from the above rules is a cograph. Cographs were introduced by Lerchs [7] who studied their structural and algorithmic properties. Lerchs has shown, among other properties, the following two very nice algorithmic properties: (i) cographs are exactly P 4 -free graphs [5], and (ii) cographs admit a unique tree representation, upto isomorphism, called cotree [4,5]. A cograph can be represented by a rooted binary tree CO( T ) known as cotree [4,5]. The leaf nodes of CO( T ) represent the vertices of G. Each internal vertex of CO( T ) is labeled either with + or with ∪. The cograph corresponding to a +-labeled (respectively ∪-labeled) node in CO( T ) is obtained from the cographs corresponding to its children in CO( T ) by means of a join (respectively disjoint union) operation. A cotree CO( T ) of a cograph G = ( V , E ) can be constructed in linear time [4,5]. Let G be a connected cograph and CO( T ) be its cotree. It is clear from the definition of cographs that G = G 1 + G 2 for some cographs G 1 and G 2 . The following theorem characterizes the cographs having a locally connected spanning tree. Theorem 3.1. Let G = ( V , E ) be a connected cograph such that G = G 1 + G 2 and | V (G 1 )|  | V (G 2 )|. G admits a locally connected spanning tree T if and only if the following conditions are true. (i) If | V (G 1 )|  2, then either at least one of G 1 and G 2 is connected or each of G 1 and G 2 has an edge. (ii) If | V (G 1 )| = 1, then G 2 is connected. Proof. Necessity: Suppose | V (G 1 )|  2. If possible, assume that both G 1 and G 2 are disconnected. Now V (G 1 ) as well as V (G 2 ) are separating sets of G. So by Lemma 2.1, T has at least one edge from G 1 and one from G 2 . Hence each of G 1 and G 2 has an edge. Next assume that | V (G 1 )| = 1. As G admits a locally connected spanning tree, by Lemma 2.1, G has no cut vertex. So G 2 = G − V (G 1 ) is connected. Sufficiency: Case I. | V (G 1 )|  2, E (G 1 ) = ∅ and E (G 2 ) = ∅. Let xa ∈ E (G 1 ) and yb ∈ E (G 2 ). Construct the spanning tree T = ( V , E ) of G such that E = {xa, xy , yb} ∪ {xu | u ∈ V (G 2 ) \ { y , b}} ∪ { yv | v ∈ V (G 1 ) \ {x, a}}. It is easy to see that T is a locally connected spanning tree of G. Case II. | V (G 1 )|  2 and exactly one of E (G 1 ) and E (G 2 ) is empty. Without loss of generality assume that E (G 2 ) = ∅. Clearly G 1 is connected by the assumptions of the theorem. Let a be a non-cut vertex of G 1 . Let xa ∈ E (G 1 ). Construct the spanning tree T = ( V , E ) of G such that E = {xa, xy } ∪ {xu | u ∈ V (G 2 ) \ { y }} ∪ { yv | v ∈ V (G 1 ) \ {x, a}}. It is easy to see that T is a locally connected spanning tree of G.

1069

Case III. | V (G 1 )| = 1 and G 2 is connected. Construct the spanning tree T = ( V , E ) of G such that E = {xv | v ∈ V (G 2 )}, where V (G 1 ) = {x}. It is easy to see that T is a locally connected spanning tree of G. Hence we have the lemma. 2 Given a cograph G, the cotree CO( T ) of G can be constructed in linear time [4,5]. Note that each internal node of CO( T ) is labeled either with + or with ∪ and each leaf node of CO( T ) is labeled with a unique vertex of G. Let r be the root of CO( T ). Let T 1 and T 2 be the two connected components of CO( T ) − r and let V 1 and V 2 be the sets of the leaf vertices of the trees T 1 and T 2 , respectively. Let G 1 = G [ V 1 ] and G 2 = G [ V 2 ]. Clearly G = G 1 + G 2 . Without loss of generality assume that | V (G 1 )|  | V (G 2 )|. Given the cotree CO( T ) of G, it is easy to see that G 1 and G 2 can be computed in linear time. We can check whether each of G 1 and G 2 is connected and can find the number of edges of G 1 and G 2 in linear time. So all the conditions of Theorem 3.1 can be checked in linear time. If all the conditions of Theorem 3.1 are satisfied, then a locally connected spanning tree T of G as constructed in the proof of the sufficiency part of Theorem 3.1 can be constructed in linear time. So we have the following theorem. Theorem 3.2. It can be recognized in linear time whether a given connected cograph admits a locally connected spanning tree. A locally connected spanning tree T of a connected cograph G can be constructed in linear time if G admits a locally connected spanning tree. 4. Locally connected spanning trees in complements of bipartite graphs The proof of the following lemma follows from the definition of a locally connected spanning tree and hence is omitted. Lemma 4.1. Let G = ( X , Y , E ) be a bipartite graph. Let T be a locally connected spanning tree of G c . If xy , xz ∈ E ( T ) be such that x, z ∈ X and y ∈ Y , then there exist a ∈ X and b ∈ Y such that ax, bx ∈ E ( T ) and ab ∈ E (G c ). An edge xy of the complement G c of a bipartite graph G = ( X , Y , E ) is called a cross edge if x ∈ X and y ∈ Y . A path P = a, x, y , b of length three consisting of cross edges of G c is called a zigzag path of G c . The following lemma follows from Lemma 4.1. Lemma 4.2. Let G = ( X , Y , E ) be a bipartite graph. Let T be a locally connected spanning tree of G c . If xy , ax, by ∈ E ( T ) be such that x, a ∈ X and y , b ∈ Y , then G c contains a zigzag path. Lemma 4.3. Let G = ( X , Y , E ) be a bipartite graph such that | X |  |Y | and G c does not admit a star as a locally connected

spanning tree. Then G c admits a bistar as a locally connected spanning tree if and only if either G c contains a zigzag path or Y contains exactly two vertices, say y 1 and y 2 such that | S i |  2 for i = 1, 2, and S 1 ∩ S 2 = ∅, where S i = {x ∈ X | xy i ∈ E (G c )}.

1070

B.S. Panda, D. Pradhan / Information Processing Letters 110 (2010) 1067–1073

Proof. Necessity: Suppose that G c has a locally connected spanning tree which is a bistar. Case I. G c has a locally connected spanning bistar having bistar centers x and y such that x ∈ X and y ∈ Y . Let X 1 = {a ∈ X | ax ∈ E ( T )}, X 2 = {a ∈ X | ay ∈ E ( T )}, Y 1 = {b ∈ Y | by ∈ E ( T )}, and Y 2 = {b ∈ Y | bx ∈ E ( T )}. If X 2 = ∅ and Y 2 = ∅, then b, x, y , a is a required zigzag path for b ∈ Y 2 and a ∈ X 2 . So, without loss of generality, assume that X 2 = ∅. Let a ∈ X 1 . By Lemma 4.1, there exist a1 ∈ X 1 and a2 ∈ Y such that a2 x ∈ E ( T ) and a1 a2 ∈ E (G c ). If a2 = y, then a1 , a2 , x, y is a required zigzag path. So assume that a2 = y. As X 2 = ∅ and T is a bistar, Y 1 = ∅. Let b ∈ Y 1 . By Lemma 4.1, there exists b1 ∈ Y 1 such that b1 x ∈ E (G c ). Now b1 , x, y , a1 is a zigzag path in G c . Case II. G c has no locally connected spanning bistar having bistar centers x and y such that x ∈ X and y ∈ Y . Let T be a locally connected bistar of G c having bistar centers x and y. Without loss of generality assume that x, y ∈ X . Let Y 1 = {b ∈ Y | bx ∈ E ( T )} and Y 2 = {b ∈ Y | by ∈ E ( T )}. We show that neither Y 1 = ∅ nor Y 2 = ∅. Without loss of generality assume that Y 1 = ∅ for a contradiction. As Y 1 = ∅, ya ∈ E ( T ) for all a ∈ Y . Since yb ∈ E (G c ) for all b ∈ X \ { y }, d G c ( y ) = n − 1. As G c is connected, T = ( V , E ) is a locally connected star in G c , where E = { ya | a ∈ V \ { y }}. This is a contradiction to the fact that G c does not admit a star as a locally connected spanning tree. So neither Y 1 = ∅ nor Y 2 = ∅. Let y 1 ∈ Y 1 and y 2 ∈ Y 2 . If y 1 y ∈ E (G c ) or y 2 x ∈ E (G c ), then we get a zigzag path. By Lemma 4.1, there exist b1 , b2 ∈ X such that b1 y 1 ∈ E (G c ) and b2 y 2 ∈ E (G c ). If possible, let y 3 ∈ (Y \ { y 1 , y 2 }). Without loss of generality, y 3 x ∈ E ( T ). Then b1 , y 1 , x, y 3 is a zigzag path. So Y = { y 1 , y 2 } and | S i | = |{a ∈ X | ay i ∈ E (G c )}|  2 for i = 1, 2. If S 1 ∩ S 2 = ∅, then y 1 , p, y 2 , y or y 2 , p, y 1 , x is a zigzag path, where p ∈ S 1 ∩ S 2 . Hence the necessity is proved. Sufficiency: If G c contains a zigzag path a, x, y, b such that a, y ∈ Y and b, x ∈ X , then T = ( X ∪ Y , E ), where E = {xy } ∪ {cx | c ∈ X \ {x}} ∪ {dy | d ∈ Y \ { y }}, is a bistar which is a locally connected spanning tree of G c . Suppose Y contains exactly two vertices, say y 1 and y 2 such that | S i |  2 for i = 1, 2, and S 1 ∩ S 2 = ∅, where S i = {x ∈ X | xy i ∈ E (G c )}. Let ai , b i ∈ S i , 1  i  2. Consider the bistar T = ( V , E ), where E = { y 1 a1 , a1 b1 , y 2 a2 , a2 b2 , a1 a2 } ∪ {a1 x | x ∈ X \ {a1 , a2 , b1 , b2 }}. Clearly T is a locally connected spanning tree of G c . 2 The following lemma gives an important structural property of cross edges present in a locally connected spanning tree of diameter at least 4 of G c . Lemma 4.4. Let G = ( X , Y , E ) be a bipartite graph such that G c contains neither a star nor a bistar as a locally connected spanning tree. If G c admits a locally connected spanning tree, then there is a locally connected spanning tree T of G c such that every cross edge in T is a pendant edge. Furthermore, there is a locally connected spanning tree T ∗ of G c such that for any two

cross edges xy and x y with pendant vertices y and y , either

{ y , y } ⊆ X or { y , y } ⊆ Y .

Proof. Let T be a locally connected spanning tree of G c . By the assumptions of the theorem, G c does not contain a zigzag path and diameter of T is at least four. Let xy be a cross edge of G c present in T . If possible, assume that xy is not a pendant edge in T . So there exist a and b such that ax, by ∈ E ( T ). As G c does not contain a zigzag path, a, b ∈ X or a, b ∈ Y by Lemma 4.2. Without loss of generality assume that a, b ∈ X . Let N T ( y ) = {b, b1 , b2 , . . . , bk }. As G c is / E ( T ) for all c ∈ Y , bd ∈ / E (G c ) free from zigzag path, yc ∈ c for all d ∈ Y \ { y }, b i d ∈ / E (G ) for all i, 1  i  k, and for / E (G c ) for all e ∈ Y \ { y }. Consider all d ∈ Y \ { y }, and xe ∈ T = T − { yb, yb1 , yb2 , . . . , ybk } ∪ {xb, xb1 , xb2 , . . . , xbk }. So T is a locally connected spanning tree of G c such that xy is a pendant edge in T . This process can be applied to each cross edge present in T to make the cross edge pendant. So G c admits a locally connected spanning tree T ∗ such that each cross edge present in T ∗ is a pendant edge. Let xy and x y be two such cross edges such that y and y are pendant vertices. If y ∈ Y and y ∈ X , then the path from y to y in T ∗ would contain a cross edge which will not be a pendant edge. Hence for any two cross edges xy and x y with pendant vertices y and y , either { y , y } ⊆ X or { y , y } ⊆ Y . 2 Theorem 4.5. Let G = ( X , Y , E ) be a bipartite graph such that G c does not admit a star or a bistar as a locally connected spanning tree and | X |  |Y |. Then G c admits a locally connected spanning tree if and only if (i) for each y ∈ Y , |( N G c ( y ) ∩ X )|  2, (ii) ( N G c ( y ) ∩ X ) ∩ ( N G c ( y ) ∩ X ) = ∅ for all y , y ∈ Y with y = y , and (iii) | X |  3. Proof. Necessity: By Lemma 4.4, G c admits a locally connected spanning tree T such that each y ∈ Y is a pendant vertex in T . Let Y = { y 1 , y 2 , . . . , yk } and N T ( y i ) = {xi }, 1  i  k. As G c is free from zigzag path, by Lemma 4.1, for each y i ∈ Y there exists ai ∈ X such that y i ai ∈ E (G c ) and ai = xi . So |( N G c ( y ) ∩ X )|  2 for each y ∈ Y and hence (i) is true. If ( N G c ( y ) ∩ X ) ∩ ( N G c ( y ) ∩ X ) = ∅ for some y , y ∈ Y with y = y , then x , y, x, y is a zigzag path in G c , where x ∈ ( N G c ( y ) ∩ X ) ∩ ( N G c ( y ) ∩ X ) and x ∈ ( N G c ( y ) ∩ X ) \ {x}. So (ii) is true. Since G c does not admit a bistar as a locally connected spanning tree, by Lemma 4.3, (iii) is true. Sufficiency: Suppose G c satisfies the conditions of the theorem. Let Y = { y 1 , y 2 , . . . , yk }. Let S i = N G c ( y i ) ∩ X , 1  i  k. Since | S i |  2, let ai , b i ∈ S i , 1  i  k. Consider the spanning tree T = ( X ∪ Y , E ) of G c , where E = {ai b i , y i ai | 1  i  k} ∪ {a1 a j | 2  j  k} ∪ {a1 x | x ∈ X \ {a1 , a2 , . . . , ak , b1 , b2 , . . . , bk }}. It is easy to check that T is a locally connected spanning tree of G c . 2 Note that the locally connected spanning tree constructed in the proof of the above theorem is of diameter four. So we have the following corollary.

B.S. Panda, D. Pradhan / Information Processing Letters 110 (2010) 1067–1073

Corollary 4.6. Let G = ( X , Y , E ) be a bipartite graph. If G c admits a locally connected spanning tree, then G c has a locally connected spanning tree of diameter at most four. Next we discuss how to recognize whether G c admits a locally connected spanning tree. First check whether G c is 2-connected. If G c is not 2-connected, then by Lemma 2.1, G c does not admit a locally connected spanning tree. Next check whether G c contains a dominating vertex. If G c contains a dominating vertex, say x, then T = ( V , E ), where E = {xa | a ∈ V \ {x}} is a star which is a locally connected spanning tree of G c . Suppose that G c does not contain a dominating vertex. Next check whether G c contains a zigzag path. To do this first construct the graph G 1 = ( X , Y , E 1 ), where E 1 = {xy | xy ∈ E (G c ) and x ∈ X , y ∈ Y }. Check whether G 1 has a path of length three. This can be done using breadth first search (BFS). If G 1 has a path P of length three, then P is a zigzag path in G c . In this case, T = ( X ∪ Y , E ), where E = {xy } ∪ {cx | c ∈ X \ {x}} ∪ {dy | d ∈ Y \ { y }}, is a bistar which is a locally connected spanning tree of G c . Suppose that G c does not contain a zigzag path. Without loss of generality assume that | X |  |Y |. Let Y = { y 1 , y 2 , . . . , yk }. Find S i = {x ∈ X | xy i ∈ E (G 1 )} for 1  i  k. If | S i | = 1 for some i , 1  i  k, then G c does not admit a locally connected spanning tree. Suppose that | S i |  2 for all i, 1  i  k. Choose two vertices ai , b i from S i , 1  i  k. Construct the spanning tree T = ( V , E ), where E = {ai b i , ai y i | 1  i  k} ∪ {a1 a j | 2  j  k} ∪ {a1 x | x ∈ X \ {a1 , a2 , . . . , ak , b1 , b2 , . . . , bk }}. Clearly T is a locally connected spanning tree of G c . All these steps can be done in O (n + m) time given G = ( X , Y , E ) and G c = ( V , E c ), where m is the number of edges in G c . So we have the following theorem. Theorem 4.7. Given a bipartite graph G = ( X , Y , E ) and its complement G c , it can be checked in O (n + m) time whether G c admits a locally connected spanning tree, where m is the number of edges of G c . Furthermore, a locally connected spanning tree of G c can be constructed in O (n + m) time if G c admits a locally connected spanning tree. 5. Locally connected spanning trees in doubly chordal graphs A vertex u ∈ N G [ v ] is a maximum neighbor of v in G if N G [ w ] ⊆ N G [u ] for all w ∈ N G [ v ]. A vertex v is called doubly simplicial in G if it is simplicial and has a maximum neighbor in G. An ordering σ = ( v 1 , v 2 , . . . , v n ) of V (G ) is called a doubly perfect elimination ordering (dpeo) of G if v i is a doubly simplicial vertex in G i = G [{ v i , v i +1 , . . . , v n }] for each i, 1  i  n. A graph is doubly chordal if it admits a doubly perfect elimination ordering (dpeo) [1]. If a vertex has more than one maximum neighbors, a unique maximum neighbor can be assigned to a vertex by using a suitable rule to break the tie. One such rule is to choose the maximum neighbor with the largest index. A dpeo σ = ( v 1 , v 2 , . . . , v n ) is called a canonical doubly perfect elimination ordering if the neighbor of v i in G i = G [{ v i , v i +1 , . . . , v n }] having the largest index is the maximum neighbor. Let ρ ( v i ) denote the maximum neighbor of v i in G i . Every doubly chordal graph has a canonical

1071

doubly perfect elimination ordering and such an ordering of a doubly chordal graph can be computed in linear time [11]. Let G be a doubly chordal graph and let σ = ( v 1 , v 2 , . . . , v n ) be a canonical doubly perfect elimination ordering of G. Let G i = G [{ v i , v i +1 , . . . , v n }], 1  i  n. For v j ∈ N G ( v i ) with j > i, let ( v i , v j ) = p be the minimum index such that v p ∈ N G [ v i ] ∩ N G [ v j ]. Note that if every common neighbor of v i and v j has a larger index than i, then ( v i , v j ) = i. The closest neighbor of a vertex v i with respect to σ is the vertex v i ∗ ∈ N G i ( v i ) such that (i) ( v i , v i ∗ )  ( v i , v j ) for all v j ∈ N G i ( v i ), and (ii) if ( v i , v i ∗ ) = ( v i , v j ) and i ∗ = j, then i ∗ > j. Note that condition (ii) of the definition of the closest neighbor of v i is for breaking the tie if more than one vertices satisfy the condition (i). We have broken the tie using maximum indexed neighbor. We now give a characterization of doubly chordal graph admitting a locally connected spanning tree. Theorem 5.1. A doubly chordal graph G admits a locally connected spanning tree if and only if G is 2-connected. Proof. Necessity: Necessity follows from Lemma 2.1. Sufficiency: Let G be a 2-connected doubly chordal graph. Let σ = ( v 1 , v 2 , . . . , v n ) be a canonical doubly perfect elimination ordering of G. Since G is 2-connected, by Lemma 2.4, d G i ( v i )  2 for all i, 1  i  n − 2. Consider the spanning tree T = ( V , E ) of G, where E = { v n v n−1 } ∪ { v n−2 v (n−2)∗ , v n−3 v (n−3)∗ , . . . , v 1 v 1∗ }. Claim. T is a locally connected spanning tree of G. Proof. Let T i = ( V i , E i ), where V i = { v n , v n−1 , . . . , v n−1−i } and E i = { v n v n−1 } ∪ { v n−2 v (n−2)∗ , v n−3 v (n−3)∗ , . . . , v n−i −1 v (n−i −1)∗ }, 0  i  n − 2. Note that T n−2 = T and T 0 has exactly one edge v n v n−1 . First we prove by induction on i, 1  i  n − 2, that (i) T i −1 contains an edge connecting the closest neighbor v (n−i −1)∗ of v n−i −1 with a vertex in N G n−i−1 ( v n−i −1 ), and (ii) T i is a locally connected spanning tree of G n−i −1 = G [{ v n−i −1 , v n−i , . . . , v n }]. For the base case when i = 1, we need to prove that (a) T 0 contains an edge connecting the closest neighbor v (n−2)∗ of v n−2 with a vertex in N G n−2 ( v n−2 ), and (b) T 1 is a locally connected spanning tree of G n−2 . Note that N G n−2 ( v n−2 ) = { v n , v n−1 } as d G i ( v i )  2 for all i, 1  i  n − 2, and hence v n−2 is adjacent to v n and v n−1 in G. Note that v (n−2)∗ is either v n−1 or v n . So T 0 contains an edge connecting the closest neighbor v (n−2)∗ of v n−2 and a vertex in N G n−2 ( v n−2 ). As T 1 is a tree with two edges and G n−2 is a complete graph with three vertices, T 1 is a locally connected spanning tree of G n−2 . So the base case of the induction is true. Assume that the induction hypothesis is true for i = k, where 2  k  n − 3. So T k−1 contains an edge connecting the closest neighbor v (n−k−1)∗ of v n−k−1 with a vertex

1072

B.S. Panda, D. Pradhan / Information Processing Letters 110 (2010) 1067–1073

in N G n−k−1 ( v n−k−1 ), and T k is a locally connected spanning tree of G n−k−1 . Consider the vertex v n−k−2 . By Lemma 2.4, we have d G n−k−2 ( v n−k−2 )  2. Recall that v (n−k−2)∗ is the closest neighbor of v n−k−2 . So (n − k − 2) < (n − k − 2)∗ . Recall also that ρ ( v n−k−2 ) is the maximum neighbor of v n−k−2 in G n−k−2 . Depending on whether v (n−k−2)∗ is equal to ρ ( v n−k−2 ) or not, we need to consider the following two cases. Case I. v (n−k−2)∗ = ρ ( v n−k−2 ). Let v j be the largest indexed neighbor of v n−k−2 in G n−k−2 such that j < (n − k − 2)∗ . Since v n−k−2 is a common neighbor of v j and v (n−k−2)∗ , ( v j , v (n−k−2)∗ )  (n − k − 2). Again, since v n−k−2 is a simplicial vertex in G n−k−2 and v j and v (n−k−2)∗ are neighbors of v n−k−2 in G n−k−2 , v j v (n−k−2)∗ ∈ E. Next we prove that v j ∗ = v (n−k−2)∗ . If possible assume that v j ∗ = v (n−k−2)∗ to get a contradiction. As v j is the largest indexed neighbor of v n−k−2 such that j < (n − k − 2)∗ , v j ∗ v n−k−2 ∈ / E. As v n−k−2 is a common neighbor of v j and v (n−k−2)∗ , ( v j , v j ∗ )  ( v j , v (n−k−2)∗ )  n − k − 2 by the definition of v j ∗ . Let l = ( v j , v j ∗ ). If v j ∗ = ρ ( v l ), then v n−k−2 ∈ N G l [ v j ] ⊆ N G l [ρ ( v l )] = N G l [ v j∗ ]. This is a contradiction to the fact that v j ∗ v n−k−2 ∈ / E. We will again obtain a contradiction for v j ∗ = ρ ( v l ). As N G l [ v j ] ⊆ N G l [ρ ( v l )], ( v j , ρ ( v l ))  l. Now l = ( v j , v j ∗ )  ( v j , ρ ( v l )). So ( v j , ρ ( v l )) = l and j ∗ < σ −1 (ρ ( v l )). This is a contradiction to the definition of v j ∗ . So v j ∗ = v (n−k−2)∗ . Now v j v (n−k−2)∗ = v j v j ∗ . Since j > n − k − 2, by definition of T k , v j v j ∗ is an edge in T k . So T k contains the edge v (n−k−2)∗ v j connecting the closest neighbor v (n−k−2)∗ with the vertex v j in N G n−k−2 ( v n−k−2 ). As T k is a locally connected spanning tree of G n−k−1 by induction hypothesis, by Lemma 2.3, T k+1 is a locally connected spanning tree of G n−k−2 . Case II. v (n−k−2)∗ = ρ ( v n−k−2 ). Recall that v ((n−k−2)∗ )∗ is the closest neighbor of v (n−k−2)∗ . Let l = ( v (n−k−2)∗ , v ((n−k−2)∗ )∗ ). Next we prove that v ((n−k−2)∗ )∗ = ρ ( v l ). Assume that v ((n−k−2)∗ )∗ = ρ ( v l ) for a contradiction. Now N G l [ v (n−k−2)∗ ] ⊆ N G l [ρ ( v l )] and hence ( v (n−k−2)∗ , ρ ( v l ))  l. Again l = ( v (n−k−2)∗ , v ((n−k−2)∗ )∗ )  ( v (n−k−2)∗ , ρ ( v l )). So ( v (n−k−2)∗ , ρ ( v l )) = l and ((n − k − 2)∗ )∗ < σ −1 (ρ ( v l )) by definition of v ((n−k−2)∗ )∗ . This is a contradiction to the definition of v ((n−k−2)∗ )∗ . Hence v ((n−k−2)∗ )∗ = ρ ( v l ). This implies that v n−k−2 ∈ N G l [ v (n−k−2)∗ ] ⊆ N G l [ρ ( v l )], and hence v (n−k−2)∗ v ((n−k−2)∗ )∗ is an edge in T k . So T k contains the edge v (n−k−2)∗ v ((n−k−2)∗ )∗ connecting the closest neighbor v (n−k−2)∗ of v n−k−2 with a vertex v ((n−k−2)∗ )∗ in G n−k−2 ( v n−k−2 ). As T k is a locally connected spanning tree of G n−k−1 , by Lemma 2.3, T k+1 is a locally connected spanning tree of G n−k−2 . So, by induction principle, the statements (i) and (ii) are true for all i, 1  i  n − 2. As T = T n−2 , the claim is proved. 2 Thus G admits a locally connected spanning tree.

2

The following algorithm finds the closest neighbor of v i with respect to a canonical doubly perfect elimination ordering σ = ( v 1 , v 2 , . . . , v n ) for all i, 1  i  n − 2. Algorithm 1: Closestneighbor(G , σ ). 1 for i = 1 to n do Sort N G ( v i ) into v i 1 , v i 2 , . . . , v id 2

G (v i )

with i 1 < i 2 < · · · < idG ( v i ) ;

and let i p i is the minimum index which is larger than i. 3 4 5 6 7 8

end for i = 1 to n do v i ∗ = 0; end for j = 1 to n do if ( v j ∗ == 0) then v j ∗ = v jd ( v ) ; 9 G j

10 11 12

end for k = p j to d G ( v j ) − 1 do if ( v ( jk )∗ == 0) then v ( jk )∗ = v jd ( v ) ;

13

G

14

j

end

15

end

16 end

Note that if v ir v i s ∈ / E (G ) for every v i s ∈ N G i ( v i ) and i r < i, then the closest neighbor v i ∗ of v i is the neighbor of v i with maximum index which is larger than i. This has been taken care of in lines 8–9. For the other case, v i ∗ is computed by finding a minimum index j such that i = jk , i.e. v i ∈ N G j ( v j ), and i ∗ = jdG ( v j ) for some k with p j  k  d G ( v j ) − 1. This has also been taken care of in lines 11–15. Sorting the neighbors of each v i can be done by adding v i into adjacent list of each neighbor of v i from i = 1 to n. So lines 1–3 take O (n + m) time. n Lines 4–6 take O (n) time. Rest of the procedure takes i =1 d G ( v i ) = O (n + m) time. Hence we have the following lemma. Lemma 5.2. Algorithm 1 takes linear time to compute the closest neighbors of all the vertices if a canonical dpeo is provided. The following algorithm constructs a locally connected spanning tree of a 2-connected doubly chordal graph. Algorithm 2: LCSTdoublychordal(G ). 1 2 3 4 5 6

Compute a canonical dpeo σ = ( v 1 , v 2 , . . . , v n ) of G; Closestneighbor(G , σ ); T = { v n v n−1 }; for i = n − 2 to 1 do find the closest neighbor v i ∗ of v i ; T = T ∪ { v i v i∗ }

7 end 8 Return T .

The proof of correctness of the above algorithm follows from the proof of the sufficiency part of Theorem 5.1. It can be tested in linear time whether a graph is 2-connected using depth first search. A canonical dpeo of a doubly chordal graph can be computed in linear time [11]. The closest neighbor of v i for all 1  i  n − 1 can be computed in O (n + m) time by Lemma 5.2. So we have the following theorem.

B.S. Panda, D. Pradhan / Information Processing Letters 110 (2010) 1067–1073

Theorem 5.3. It can be tested in linear time whether a doubly chordal graph admits a locally connected spanning tree. Moreover, a locally connected spanning tree of a doubly chordal graph can be constructed in linear time if the graph admits a locally connected spanning tree. 6. Conclusion In this paper we proposed linear time algorithms for the locally connected spanning tree recognition and construction problems for cographs, complements of bipartite graphs, and doubly chordal graphs, respectively. Our recognition algorithms are supported by structural characterizations. Acknowledgements The authors would like to thank the anonymous referees for their helpful comments leading to improvements in the presentation of the paper.

1073

References [1] A. Brandstädt, F. Dragan, V. Chepoi, V. Voloshin, Dually chordal graphs, SIAM J. Discrete Math. 11 (3) (1998) 437–455. [2] A.M. Farley, Networks immune to isolated failures, Networks 11 (1981) 255–268. [3] C.C. Lin, G.J. Chang, G.H. Chen, Locally connected spanning trees in strongly chordal graphs and proper circular-arc graphs, Discrete Math. 307 (2007) 208–215. [4] D.G. Corneil, Y. Perl, L.K. Stewart, A linear time recognition algorithm for cographs, SIAM J. Comput. 14 (1985) 926–984. [5] D.G. Corneil, Y. Perl, L.K. Stewart, Complement reducible graphs, Discrete Appl. Math. 3 (1981) 163–174. [6] D.R. Fulkerson, O.S. Gross, Incidence matrices and interval graphs, Pacific J. Math. 15 (1965) 835–855. [7] H. Lerchs, On cliques and kernels, Tech. Report, Dept. of Comp. Sci., Univ. of Toronto, 1971. [8] J.A. Wald, C.J. Colbourn, Steiner trees, partial 2-trees and minimum IFI networks, Networks 13 (1983) 159–167. [9] L. Cai, On spanning 2-trees in a graph, Discrete Appl. Math. 74 (3) (1997) 203–216. [10] L. Cai, The complexity of the locally connected spanning tree problem, Discrete Appl. Math. 131 (1) (2003) 63–75. [11] M. Lee, C. Kim, Computation of a (canonical) doubly perfect elimination ordering of a doubly chordal graph, Korean J. Comput. Appl. Math. 5 (2) (1998) 287–294.