7
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 article info abstract 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 NP- complete 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 net- work 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 iso- lated if they are pairwise isolated. A network is isolated failure immune (IFI) if and only if the communication be- tween 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 Re- search (CSIR), India. 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 net- works. In fact, a network containing a locally connected spanning tree is an IFI network (see [2,8,10]). The locally connected spanning tree recognition prob- lem is to recognize whether a given graph G admits a lo- cally connected spanning tree. The locally connected span- ning 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 prob- lem is NP-complete for planar graphs and split graphs. Since split graphs are chordal, the locally connected span- ning 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 di- rected 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- 0020-0190/$ – see front matter © 2010 Elsevier B.V. All rights reserved. doi:10.1016/j.ipl.2010.09.008

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

Embed Size (px)

Citation preview

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 bipartitegraphs 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 2010Received in revised form 19 August 2010Accepted 18 September 2010Available online 22 September 2010Communicated by M. Yamashita

Keywords:AlgorithmsGraph algorithmsLocally connected spanning treeNP-complete

A spanning tree T of a graph G = (V , E) is called a locally connected spanning tree if the setof all neighbors of v in T induces a connected subgraph of G for all v ∈ V . The problem ofrecognizing whether a graph admits a locally connected spanning tree is known to be NP-complete even when the input graphs are restricted to chordal graphs. In this paper, wepropose 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 graphG = (V , E) in which vertices correspond to sites in the net-work and an edge exists between two vertices if there isa communication link between these vertices. A networkis immune to a set of failures if and only if all operativesites remain connected. Two communication link failuresare isolated if the inoperative links are not incident to acommon site. Two site failures are isolated if the two downsites are not neighbors. A link failure and a site failure areisolated if the inoperative link is not incident to a downsite or to a neighbor of that site. A set of failures are iso-lated if they are pairwise isolated. A network is isolatedfailure immune (IFI) if and only if the communication be-tween operative sites can be completed as long as networkfailures are isolated. This concept of networks immune toisolated 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 Re-

search (CSIR), India.

0020-0190/$ – see front matter © 2010 Elsevier B.V. All rights reserved.doi:10.1016/j.ipl.2010.09.008

A spanning tree T of a graph G = (V , E) is called alocally connected spanning tree if the set of all neighborsof v in T induces a connected subgraph of G for everyv ∈ V (G). The notion of locally connected spanning treewas introduced by Cai [9] and is closely related to IFI net-works. In fact, a network containing a locally connectedspanning tree is an IFI network (see [2,8,10]).

The locally connected spanning tree recognition prob-lem is to recognize whether a given graph G admits a lo-cally connected spanning tree. The locally connected span-ning tree construction problem is to construct a locallyconnected spanning tree of a given graph that is known toadmit a locally connected spanning tree. Cai [10] provedthat the locally connected spanning tree recognition prob-lem is NP-complete for planar graphs and split graphs.Since split graphs are chordal, the locally connected span-ning tree recognition problem is NP-complete for chordalgraphs. A graph admits a locally connected spanning treeonly if it is 2-connected [10]. Cai [10] proved that a di-rected path graph admits a locally connected spanning treeif and only if it is 2-connected by proposing a linear timealgorithm to construct a locally connected spanning tree ofa 2-connected directed path graph. The locally connectedspanning tree recognition and construction problems forthe 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 wassubsequently solved by Lin et al. [3]. In fact Lin et al.[3] proposed a linear time algorithm to construct a lo-cally connected spanning tree of a 2-connected stronglychordal graph. This implies that a strongly chordal graphadmits a locally connected spanning tree if and only if itis 2-connected. Cai [10] also proposed a linear time algo-rithm for adding fewest edges to a graph to make a givenspanning tree of the graph a locally spanning tree of theaugmented graph. Lin et al. [3] proposed a linear time al-gorithm to construct a locally connected spanning tree ofa 2-connected proper circular-arc graphs.

In this paper, we solve the locally connected span-ning tree recognition and construction problems for doublychordal graphs in linear time. As doubly chordal graphsinclude strongly chordal graphs, our result extends the re-sult of Lin et al. [3]. We also solve the locally connectedspanning tree recognition and construction problems forcographs and complements of bipartite graphs in lineartime.

The rest of the paper is organized as follows. Section 2introduces some pertinent definitions and some known re-sults. The locally connected spanning tree recognition andconstruction problems for cographs, complements of bipar-tite graphs, and doubly chordal graphs are presented inSections 3, 4, and 5, respectively. Finally, Section 6 con-cludes the paper.

2. Preliminaries

For a graph G = (V , E), the sets NG(v) = {u ∈ V (G) |uv ∈ E} and NG [v] = NG(v) ∪ {v} denote the neighborhoodand the closed neighborhood of a vertex v , respectively. Thedegree of a vertex v is |NG(v)| and is denoted by dG(v). LetdG(u, v) denote the length of the shortest path betweenu and v and is called as the distance between u and vin G . The diameter of a graph G is the maximum valueof dG(u, v) over all u, v ∈ V (G). Let n and m denote thenumber 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 bepartitioned into two disjoint sets X and Y such that everyedge joins a vertex in X to another vertex in Y . A parti-tion (X, Y ) of V is called a bipartition. A bipartite graphwith partition (X, Y ) of V is denoted by G = (X, Y , E). LetPr and Kr denote a path and the complete graph on r ver-tices, respectively.

A vertex v is called a dominating vertex of graph G =(V , E) if NG [v] = V . An edge xy is called a dominating edgeif NG [x] ∪ NG [y] = V . A set S ⊆ V is called a separating setof 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 ofG . A graph is k-connected if it contains no separating set ofsize less than k. A tree T having n vertices is called a starif it has a vertex v of degree n − 1. In this case, v is calledthe star center of T . If T has exactly two vertices, say xand y, of degree more than one, then T is called a bistarand x and y are called bistar centers of T .

The following lemma gives a necessary condition for agraph to have a locally connected spanning tree.

Lemma 2.1. (See [10].) If G has a locally connected spanningtree T and S is a separating set of G, then G[S] contains at leastone edge of T . Consequently, a graph having a locally connectedspanning tree is 2-connected.

The following lemma whose proof is easy and is omit-ted characterizes graphs admitting a star as a locally con-nected spanning tree.

Lemma 2.2. A graph G admits a locally connected spanning treewhich is a star if and only if G contains a dominating vertex andG is 2-connected.

A vertex v is called a simplicial vertex in G if G[NG(v)]is a complete subgraph of G . For a graph G with a simpli-cial vertex v , the relation between the spanning trees of Gand G − v can be found from the following lemma.

Lemma 2.3. (See [10].) Let v be a simplicial vertex of G. ThenG admits a locally connected spanning tree if and only if G − vadmits a locally connected spanning tree which has an edge con-necting some two vertices in NG(v).

Let G1 = (V 1, E1) and G2 = (V 2, E2) be two graphs.Then, G1 ∪ G2, the union of G1 and G2 is defined asG1 ∪ G2 = (V 1 ∪ V 2, E1 ∪ E2). If V 1 ∩ V 2 = ∅, then G1 ∪G2 is called the disjoint union of G1 and G2. SupposeV 1 ∩ V 2 = ∅. The join, G1 + G2, of G1 and G2 is definedas G1 + G2 = (V 1 ∪ V 2, E1 ∪ E2 ∪ {xy | x ∈ V 1, y ∈ V 2}).A graph is chordal if every induced cycle of length atleast four has a chord. Recall that a vertex v is a simpli-cial vertex in G if G[NG(v)] is a complete subgraph of G .An ordering σ = (v1, v2, . . . , vn) of V is called a perfectelimination ordering (PEO) of G if vi is a simplicial vertexin Gi = G[{vi, vi+1, . . . , vn}] for each i, 1 � i � n. It isknown that a graph G is chordal if and only if it admitsa perfect elimination ordering (PEO) [6]. For an orderingσ = (v1, v2, . . . , vn), let σ−1(x) = i if x = vi , 1 � i � n.

From Lemma 2.1, the graph which contains a locallyconnected spanning tree must be 2-connected. The follow-ing lemma gives a necessary and sufficient condition for achordal graph to be k-connected.

Lemma 2.4. (See [3].) Suppose σ = (v1, v2, . . . , vn) is a perfectelimination ordering of a chordal graph G and k < n is a positiveinteger. Then G is k-connected if and only if |NGi (vi)| � k for alli, 1 � i � n − k.

3. Locally connected spanning trees in cographs

Cographs (also known as complement reducible graphs)are defined as follows:

• K1, the complete graph on a single vertex, is a co-graph.

• If G1 and G2 are cographs, then the disjoint unionG1 ∪ G2 is a cograph.

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

• If G is a cograph, then Gc is a cograph.• No graph other than the graphs obtained from the

above rules is a cograph.

Cographs were introduced by Lerchs [7] who stud-ied their structural and algorithmic properties. Lerchs hasshown, among other properties, the following two verynice algorithmic properties:

(i) cographs are exactly P4-free graphs [5], and(ii) cographs admit a unique tree representation, upto iso-

morphism, called cotree [4,5].

A cograph can be represented by a rooted binary treeCO(T ) known as cotree [4,5]. The leaf nodes of CO(T ) rep-resent the vertices of G . Each internal vertex of CO(T ) islabeled either with + or with ∪. The cograph correspond-ing to a +-labeled (respectively ∪-labeled) node in CO(T )

is obtained from the cographs corresponding to its childrenin CO(T ) by means of a join (respectively disjoint union)operation. A cotree CO(T ) of a cograph G = (V , E) can beconstructed 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 = G1 + G2for some cographs G1 and G2.

The following theorem characterizes the cographs hav-ing a locally connected spanning tree.

Theorem 3.1. Let G = (V , E) be a connected cograph such thatG = G1 + G2 and |V (G1)| � |V (G2)|. G admits a locally con-nected spanning tree T if and only if the following conditionsare true.

(i) If |V (G1)| � 2, then either at least one of G1 and G2 isconnected or each of G1 and G2 has an edge.

(ii) If |V (G1)| = 1, then G2 is connected.

Proof. Necessity: Suppose |V (G1)| � 2. If possible, assumethat both G1 and G2 are disconnected. Now V (G1) as wellas V (G2) are separating sets of G . So by Lemma 2.1, T hasat least one edge from G1 and one from G2. Hence each ofG1 and G2 has an edge.

Next assume that |V (G1)| = 1. As G admits a locallyconnected spanning tree, by Lemma 2.1, G has no cut ver-tex. So G2 = G − V (G1) is connected.

Sufficiency: Case I. |V (G1)| � 2, E(G1) = ∅ and E(G2) = ∅.Let xa ∈ E(G1) and yb ∈ E(G2). Construct the spanning

tree T = (V , E ′) of G such that E ′ = {xa, xy, yb} ∪ {xu | u ∈V (G2) \ {y,b}} ∪ {yv | v ∈ V (G1) \ {x,a}}. It is easy to seethat T is a locally connected spanning tree of G .

Case II. |V (G1)| � 2 and exactly one of E(G1) and E(G2) isempty.

Without loss of generality assume that E(G2) = ∅.Clearly G1 is connected by the assumptions of the theo-rem. Let a be a non-cut vertex of G1. Let xa ∈ E(G1). Con-struct the spanning tree T = (V , E ′) of G such that E ′ ={xa, xy}∪ {xu | u ∈ V (G2) \ {y}}∪ {yv | v ∈ V (G1) \ {x,a}}. Itis easy to see that T is a locally connected spanning treeof G .

Case III. |V (G1)| = 1 and G2 is connected.Construct the spanning tree T = (V , E ′) of G such that

E ′ = {xv | v ∈ V (G2)}, where V (G1) = {x}. It is easy to seethat T is a locally connected spanning tree of G .

Hence we have the lemma. �Given a cograph G , the cotree CO(T ) of G can be con-

structed in linear time [4,5]. Note that each internal nodeof CO(T ) is labeled either with + or with ∪ and each leafnode of CO(T ) is labeled with a unique vertex of G . Let rbe the root of CO(T ). Let T1 and T2 be the two connectedcomponents of CO(T ) − r and let V 1 and V 2 be the setsof the leaf vertices of the trees T1 and T2, respectively. LetG1 = G[V 1] and G2 = G[V 2]. Clearly G = G1 + G2. Withoutloss of generality assume that |V (G1)| � |V (G2)|. Given thecotree CO(T ) of G , it is easy to see that G1 and G2 canbe computed in linear time. We can check whether eachof G1 and G2 is connected and can find the number ofedges of G1 and G2 in linear time. So all the conditionsof Theorem 3.1 can be checked in linear time. If all theconditions of Theorem 3.1 are satisfied, then a locally con-nected spanning tree T of G as constructed in the proof ofthe sufficiency part of Theorem 3.1 can be constructed inlinear time. So we have the following theorem.

Theorem 3.2. It can be recognized in linear time whether agiven connected cograph admits a locally connected spanningtree. A locally connected spanning tree T of a connected cographG can be constructed in linear time if G admits a locally con-nected spanning tree.

4. Locally connected spanning trees in complements ofbipartite graphs

The proof of the following lemma follows from the def-inition of a locally connected spanning tree and hence isomitted.

Lemma 4.1. Let G = (X, Y , E) be a bipartite graph. Let T be alocally connected spanning tree of Gc . If xy, xz ∈ E(T ) be suchthat x, z ∈ X and y ∈ Y , then there exist a ∈ X and b ∈ Y suchthat ax,bx ∈ E(T ) and ab ∈ E(Gc).

An edge xy of the complement Gc of a bipartite graphG = (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 crossedges of Gc is called a zigzag path of Gc .

The following lemma follows from Lemma 4.1.

Lemma 4.2. Let G = (X, Y , E) be a bipartite graph. Let T be alocally connected spanning tree of Gc . If xy,ax,by ∈ E(T ) besuch that x,a ∈ X and y,b ∈ Y , then Gc contains a zigzag path.

Lemma 4.3. Let G = (X, Y , E) be a bipartite graph such that|X | � |Y | and Gc does not admit a star as a locally connectedspanning tree. Then Gc admits a bistar as a locally connectedspanning tree if and only if either Gc contains a zigzag path or Ycontains exactly two vertices, say y1 and y2 such that |Si | � 2for i = 1,2, and S1 ∩ S2 = ∅, where Si = {x ∈ X | xyi ∈ E(Gc)}.

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

Proof. Necessity: Suppose that Gc has a locally connectedspanning tree which is a bistar.

Case I. Gc has a locally connected spanning bistar havingbistar centers x and y such that x ∈ X and y ∈ Y .

Let X1 = {a ∈ X | ax ∈ E(T )}, X2 = {a ∈ X | ay ∈ E(T )},Y1 = {b ∈ Y | by ∈ E(T )}, and Y2 = {b ∈ Y | bx ∈ E(T )}. IfX2 = ∅ and Y2 = ∅, then b, x, y,a is a required zigzag pathfor b ∈ Y2 and a ∈ X2. So, without loss of generality, as-sume that X2 = ∅. Let a ∈ X1. By Lemma 4.1, there exista1 ∈ X1 and a2 ∈ Y such that a2x ∈ E(T ) and a1a2 ∈ E(Gc).If a2 = y, then a1,a2, x, y is a required zigzag path. So as-sume that a2 = y. As X2 = ∅ and T is a bistar, Y1 = ∅.Let b ∈ Y1. By Lemma 4.1, there exists b1 ∈ Y1 such thatb1x ∈ E(Gc). Now b1, x, y,a1 is a zigzag path in Gc .

Case II. Gc has no locally connected spanning bistar havingbistar centers x and y such that x ∈ X and y ∈ Y .

Let T be a locally connected bistar of Gc having bis-tar centers x and y. Without loss of generality assumethat x, y ∈ X . Let Y1 = {b ∈ Y | bx ∈ E(T )} and Y2 = {b ∈Y | by ∈ E(T )}. We show that neither Y1 = ∅ nor Y2 =∅. Without loss of generality assume that Y1 = ∅ for acontradiction. As Y1 = ∅, ya ∈ E(T ) for all a ∈ Y . Sinceyb ∈ E(Gc) for all b ∈ X \ {y}, dGc (y) = n − 1. As Gc

is connected, T ′ = (V , E ′) is a locally connected star inGc , where E ′ = {ya | a ∈ V \ {y}}. This is a contradictionto the fact that Gc does not admit a star as a locallyconnected spanning tree. So neither Y1 = ∅ nor Y2 = ∅.Let y1 ∈ Y1 and y2 ∈ Y2. If y1 y ∈ E(Gc) or y2x ∈ E(Gc),then we get a zigzag path. By Lemma 4.1, there existb1,b2 ∈ X such that b1 y1 ∈ E(Gc) and b2 y2 ∈ E(Gc). Ifpossible, let y3 ∈ (Y \ {y1, y2}). Without loss of general-ity, y3x ∈ E(T ). Then b1, y1, x, y3 is a zigzag path. So Y ={y1, y2} and |Si | = |{a ∈ X | ayi ∈ E(Gc)}| � 2 for i = 1,2.If S1 ∩ S2 = ∅, then y1, p, y2, y or y2, p, y1, x is azigzag path, where p ∈ S1 ∩ S2. Hence the necessity isproved.

Sufficiency: If Gc contains a zigzag path a, x, y, b suchthat 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 whichis a locally connected spanning tree of Gc .

Suppose Y contains exactly two vertices, say y1 andy2 such that |Si| � 2 for i = 1,2, and S1 ∩ S2 = ∅, whereSi = {x ∈ X | xyi ∈ E(Gc)}. Let ai,bi ∈ Si , 1 � i � 2. Con-sider the bistar T = (V , E ′), where E ′ = {y1a1,a1b1, y2a2,

a2b2,a1a2} ∪ {a1x | x ∈ X \ {a1,a2,b1,b2}}. Clearly T is a lo-cally connected spanning tree of Gc . �

The following lemma gives an important structuralproperty of cross edges present in a locally connectedspanning tree of diameter at least 4 of Gc .

Lemma 4.4. Let G = (X, Y , E) be a bipartite graph such thatGc contains neither a star nor a bistar as a locally connectedspanning tree. If Gc admits a locally connected spanning tree,then there is a locally connected spanning tree T of Gc such thatevery cross edge in T is a pendant edge. Furthermore, there is alocally connected spanning tree T ∗ of Gc 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 Gc .By the assumptions of the theorem, Gc does not contain azigzag path and diameter of T is at least four. Let xy be across edge of Gc present in T . If possible, assume that xyis not a pendant edge in T . So there exist a and b such thatax,by ∈ E(T ). As Gc does not contain a zigzag path, a,b ∈X or a,b ∈ Y by Lemma 4.2. Without loss of generality as-sume that a,b ∈ X . Let NT (y) = {b,b1,b2, . . . ,bk}. As Gc isfree from zigzag path, yc /∈ E(T ) for all c ∈ Y , bd /∈ E(Gc)

for all d ∈ Y \ {y}, bid /∈ E(Gc) for all i, 1 � i � k, and forall d ∈ Y \ {y}, and xe /∈ E(Gc) for all e ∈ Y \ {y}. ConsiderT ′ = T − {yb, yb1, yb2, . . . , ybk} ∪ {xb, xb1, xb2, . . . , xbk}. SoT ′ is a locally connected spanning tree of Gc such that xyis a pendant edge in T ′ . This process can be applied toeach cross edge present in T to make the cross edge pen-dant. So Gc 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 andy′ are pendant vertices. If y ∈ Y and y′ ∈ X , then the pathfrom y to y′ in T ∗ would contain a cross edge which willnot be a pendant edge. Hence for any two cross edges xyand x′ y′ with pendant vertices y and y′ , either {y, y′} ⊆ Xor {y, y′} ⊆ Y . �Theorem 4.5. Let G = (X, Y , E) be a bipartite graph such thatGc does not admit a star or a bistar as a locally connected span-ning tree and |X | � |Y |. Then Gc admits a locally connectedspanning tree if and only if

(i) for each y ∈ Y , |(NGc (y) ∩ X)| � 2,(ii) (NGc (y) ∩ X) ∩ (NGc (y′) ∩ X) = ∅ for all y, y′ ∈ Y with

y = y′ , and(iii) |X | � 3.

Proof. Necessity: By Lemma 4.4, Gc admits a locally con-nected spanning tree T such that each y ∈ Y is a pendantvertex in T . Let Y = {y1, y2, . . . , yk} and NT (yi) = {xi},1 � i � k. As Gc is free from zigzag path, by Lemma 4.1,for each yi ∈ Y there exists ai ∈ X such that yiai ∈ E(Gc)

and ai = xi . So |(NGc (y) ∩ X)| � 2 for each y ∈ Y andhence (i) is true. If (NGc (y) ∩ X) ∩ (NGc (y′) ∩ X) = ∅ forsome y, y′ ∈ Y with y = y′ , then x′ , y, x, y′ is a zigzagpath in Gc , where x ∈ (NGc (y) ∩ X) ∩ (NGc (y′) ∩ X) andx′ ∈ (NGc (y) ∩ X) \ {x}. So (ii) is true. Since Gc does notadmit a bistar as a locally connected spanning tree, byLemma 4.3, (iii) is true.

Sufficiency: Suppose Gc satisfies the conditions of thetheorem. Let Y = {y1, y2, . . . , yk}. Let Si = NGc (yi) ∩ X ,1 � i � k. Since |Si | � 2, let ai,bi ∈ Si , 1 � i � k. Con-sider the spanning tree T = (X ∪ Y , E ′) of Gc , whereE ′ = {aibi, yiai | 1 � i � k} ∪ {a1a j | 2 � j � k} ∪ {a1x | x ∈X \ {a1,a2, . . . ,ak,b1,b2, . . . ,bk}}. It is easy to check that Tis a locally connected spanning tree of Gc . �

Note that the locally connected spanning tree con-structed in the proof of the above theorem is of diameterfour. So we have the following corollary.

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

Corollary 4.6. Let G = (X, Y , E) be a bipartite graph. If Gc ad-mits a locally connected spanning tree, then Gc has a locallyconnected spanning tree of diameter at most four.

Next we discuss how to recognize whether Gc admits alocally connected spanning tree. First check whether Gc is2-connected. If Gc is not 2-connected, then by Lemma 2.1,Gc does not admit a locally connected spanning tree. Nextcheck whether Gc contains a dominating vertex. If Gc con-tains a dominating vertex, say x, then T = (V , E ′), whereE ′ = {xa | a ∈ V \ {x}} is a star which is a locally con-nected spanning tree of Gc . Suppose that Gc does notcontain a dominating vertex. Next check whether Gc con-tains a zigzag path. To do this first construct the graphG1 = (X, Y , E1), where E1 = {xy | xy ∈ E(Gc) and x ∈ X ,y ∈ Y }. Check whether G1 has a path of length three. Thiscan be done using breadth first search (BFS). If G1 has apath P of length three, then P is a zigzag path in Gc .In this case, T = (X ∪ Y , E ′), where E ′ = {xy} ∪ {cx | c ∈X \ {x}} ∪ {dy | d ∈ Y \ {y}}, is a bistar which is a locallyconnected spanning tree of Gc . Suppose that Gc does notcontain a zigzag path. Without loss of generality assumethat |X | � |Y |. Let Y = {y1, y2, . . . , yk}. Find Si = {x ∈ X |xyi ∈ E(G1)} for 1 � i � k. If |Si | = 1 for some i,1 � i � k,then Gc does not admit a locally connected spanning tree.Suppose that |Si | � 2 for all i, 1 � i � k. Choose two ver-tices ai,bi from Si , 1 � i � k. Construct the spanning treeT = (V , E ′), where E ′ = {aibi,ai yi | 1 � i � k} ∪ {a1a j | 2 �j � k} ∪ {a1x | x ∈ X \ {a1,a2, . . . ,ak,b1,b2, . . . ,bk}}. ClearlyT is a locally connected spanning tree of Gc . All these stepscan be done in O (n + m) time given G = (X, Y , E) andGc = (V , Ec), where m is the number of edges in Gc . Sowe have the following theorem.

Theorem 4.7. Given a bipartite graph G = (X, Y , E) and itscomplement Gc , it can be checked in O (n +m) time whether Gc

admits a locally connected spanning tree, where m is the num-ber of edges of Gc . Furthermore, a locally connected spanningtree of Gc can be constructed in O (n + m) time if Gc admits alocally connected spanning tree.

5. Locally connected spanning trees in doubly chordalgraphs

A vertex u ∈ NG [v] is a maximum neighbor of v in Gif NG [w] ⊆ NG [u] for all w ∈ NG [v]. A vertex v is calleddoubly simplicial in G if it is simplicial and has a maximumneighbor in G . An ordering σ = (v1, v2, . . . , vn) of V (G) iscalled a doubly perfect elimination ordering (dpeo) of G if viis a doubly simplicial vertex in Gi = G[{vi, vi+1, . . . , vn}] foreach i, 1 � i � n. A graph is doubly chordal if it admits adoubly perfect elimination ordering (dpeo) [1].

If a vertex has more than one maximum neighbors,a unique maximum neighbor can be assigned to a ver-tex by using a suitable rule to break the tie. One suchrule is to choose the maximum neighbor with the largestindex. A dpeo σ = (v1, v2, . . . , vn) is called a canonicaldoubly perfect elimination ordering if the neighbor of vi inGi = G[{vi, vi+1, . . . , vn}] having the largest index is themaximum neighbor. Let ρ(vi) denote the maximum neigh-bor of vi in Gi . Every doubly chordal graph has a canonical

doubly perfect elimination ordering and such an order-ing of a doubly chordal graph can be computed in lineartime [11].

Let G be a doubly chordal graph and let σ = (v1,

v2, . . . , vn) be a canonical doubly perfect elimination or-dering of G . Let Gi = G[{vi, vi+1, . . . , vn}], 1 � i � n. Forv j ∈ NG(vi) with j > i, let �(vi, v j) = p be the minimumindex such that v p ∈ NG [vi] ∩ NG [v j]. Note that if ev-ery common neighbor of vi and v j has a larger indexthan i, then �(vi, v j) = i. The closest neighbor of a ver-tex vi with respect to σ is the vertex vi∗ ∈ NGi (vi) suchthat (i) �(vi, vi∗ ) � �(vi, v j) for all v j ∈ NGi (vi), and (ii) if�(vi, vi∗ ) = �(vi, v j) and i∗ = j, then i∗ > j.

Note that condition (ii) of the definition of the closestneighbor of vi is for breaking the tie if more than one ver-tices satisfy the condition (i). We have broken the tie usingmaximum indexed neighbor.

We now give a characterization of doubly chordal graphadmitting a locally connected spanning tree.

Theorem 5.1. A doubly chordal graph G admits a locally con-nected 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 σ = (v1, v2, . . . , vn) be a canonical doubly perfectelimination ordering of G . Since G is 2-connected, byLemma 2.4, dGi (vi) � 2 for all i, 1 � i � n − 2. Considerthe spanning tree T = (V , E ′) of G , where E ′ = {vn vn−1} ∪{vn−2 v(n−2)∗ , vn−3 v(n−3)∗ , . . . , v1 v1∗ }.

Claim. T is a locally connected spanning tree of G.

Proof. Let Ti = (V i, Ei), where V i = {vn, vn−1, . . . , vn−1−i}and Ei = {vn vn−1} ∪ {vn−2 v(n−2)∗ , vn−3 v(n−3)∗ , . . . ,vn−i−1 v(n−i−1)∗ }, 0 � i � n − 2. Note that Tn−2 = T andT0 has exactly one edge vn vn−1.

First we prove by induction on i, 1 � i � n − 2, that

(i) Ti−1 contains an edge connecting the closest neighborv(n−i−1)∗ of vn−i−1 with a vertex in NGn−i−1(vn−i−1),and

(ii) Ti is a locally connected spanning tree of Gn−i−1 =G[{vn−i−1, vn−i, . . . , vn}].

For the base case when i = 1, we need to prove that(a) T0 contains an edge connecting the closest neighborv(n−2)∗ of vn−2 with a vertex in NGn−2(vn−2), and (b) T1is a locally connected spanning tree of Gn−2. Note thatNGn−2(vn−2) = {vn, vn−1} as dGi (vi) � 2 for all i, 1 � i �n − 2, and hence vn−2 is adjacent to vn and vn−1 in G .Note that v(n−2)∗ is either vn−1 or vn . So T0 contains anedge connecting the closest neighbor v(n−2)∗ of vn−2 and avertex in NGn−2(vn−2). As T1 is a tree with two edges andGn−2 is a complete graph with three vertices, T1 is a lo-cally connected spanning tree of Gn−2. So the base case ofthe induction is true.

Assume that the induction hypothesis is true for i = k,where 2 � k � n − 3. So Tk−1 contains an edge connect-ing the closest neighbor v(n−k−1)∗ of vn−k−1 with a vertex

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

in NGn−k−1(vn−k−1), and Tk is a locally connected spanningtree of Gn−k−1. Consider the vertex vn−k−2. By Lemma 2.4,we have dGn−k−2(vn−k−2) � 2. Recall that v(n−k−2)∗ is theclosest neighbor of vn−k−2. So (n − k − 2) < (n − k − 2)∗ .Recall also that ρ(vn−k−2) is the maximum neighbor ofvn−k−2 in Gn−k−2. Depending on whether v(n−k−2)∗ isequal to ρ(vn−k−2) or not, we need to consider the fol-lowing two cases.

Case I. v(n−k−2)∗ = ρ(vn−k−2).Let v j be the largest indexed neighbor of vn−k−2 in

Gn−k−2 such that j < (n − k − 2)∗ . Since vn−k−2 is acommon neighbor of v j and v(n−k−2)∗ , �(v j, v(n−k−2)∗ ) �(n − k − 2). Again, since vn−k−2 is a simplicial vertex inGn−k−2 and v j and v(n−k−2)∗ are neighbors of vn−k−2 inGn−k−2, v j v(n−k−2)∗ ∈ E .

Next we prove that v j∗ = v(n−k−2)∗ . If possible as-sume that v j∗ = v(n−k−2)∗ to get a contradiction. As v j

is the largest indexed neighbor of vn−k−2 such that j <

(n −k − 2)∗ , v j∗ vn−k−2 /∈ E . As vn−k−2 is a common neigh-bor 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∗ =ρ(vl), then vn−k−2 ∈ NGl [v j] ⊆ NGl [ρ(vl)] = NGl [v j∗ ]. Thisis a contradiction to the fact that v j∗ vn−k−2 /∈ E . Wewill again obtain a contradiction for v j∗ = ρ(vl). AsNGl [v j] ⊆ NGl [ρ(vl)], �(v j,ρ(vl)) � l. Now l = �(v j, v j∗ ) ��(v j,ρ(vl)). So �(v j,ρ(vl)) = l and j∗ < σ−1(ρ(vl)). Thisis 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 Tk , v j v j∗ is an edge in Tk . SoTk contains the edge v(n−k−2)∗ v j connecting the closestneighbor v(n−k−2)∗ with the vertex v j in NGn−k−2(vn−k−2).As Tk is a locally connected spanning tree of Gn−k−1 byinduction hypothesis, by Lemma 2.3, Tk+1 is a locally con-nected spanning tree of Gn−k−2.

Case II. v(n−k−2)∗ = ρ(vn−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 weprove that v((n−k−2)∗)∗ = ρ(vl). Assume that v((n−k−2)∗)∗ =ρ(vl) for a contradiction. Now NGl [v(n−k−2)∗ ] ⊆ NGl [ρ(vl)]and hence �(v(n−k−2)∗ ,ρ(vl)) � l. Again l = �(v(n−k−2)∗ ,v((n−k−2)∗)∗ ) � �(v(n−k−2)∗ ,ρ(vl)). So �(v(n−k−2)∗ ,ρ(vl))

= l and ((n − k − 2)∗)∗ < σ−1(ρ(vl)) by definitionof v((n−k−2)∗)∗ . This is a contradiction to the defini-tion of v((n−k−2)∗)∗ . Hence v((n−k−2)∗)∗ = ρ(vl). This im-plies that vn−k−2 ∈ NGl [v(n−k−2)∗ ] ⊆ NGl [ρ(vl)], and hencev(n−k−2)∗ v((n−k−2)∗)∗ is an edge in Tk . So Tk contains theedge v(n−k−2)∗ v((n−k−2)∗)∗ connecting the closest neigh-bor v(n−k−2)∗ of vn−k−2 with a vertex v((n−k−2)∗)∗ inGn−k−2(vn−k−2).

As Tk is a locally connected spanning tree of Gn−k−1,by Lemma 2.3, Tk+1 is a locally connected spanning treeof Gn−k−2.

So, by induction principle, the statements (i) and (ii) aretrue for all i, 1 � i � n − 2.

As T = Tn−2, the claim is proved. �Thus G admits a locally connected spanning tree. �

The following algorithm finds the closest neighbor ofvi with respect to a canonical doubly perfect eliminationordering σ = (v1, v2, . . . , vn) for all i, 1 � i � n − 2.

Algorithm 1: Closestneighbor(G, σ ).

for i = 1 to n do1Sort NG (vi) into vi1 , vi2 , . . . , vidG (vi )

with i1 < i2 < · · · < idG (vi );2and let ipi is the minimum index which is larger than i.

end3for i = 1 to n do4

vi∗ = 0;5end6for j = 1 to n do7

if (v j∗ == 0) then8v j∗ = v jdG (v j )

;9end10for k = p j to dG (v j) − 1 do11

if (v( jk)∗ == 0) then12v( jk)∗ = v jdG (v j )

;13end14

end15end16

Note that if vir vis /∈ E(G) for every vis ∈ NGi (vi) andir < i, then the closest neighbor vi∗ of vi is the neighborof vi with maximum index which is larger than i. This hasbeen taken care of in lines 8–9. For the other case, vi∗ iscomputed by finding a minimum index j such that i = jk ,i.e. vi ∈ NG j (v j), and i∗ = jdG (v j) for some k with p j � k �dG(v j)− 1. This has also been taken care of in lines 11–15.

Sorting the neighbors of each vi can be done by addingvi into adjacent list of each neighbor of vi from i = 1 ton. So lines 1–3 take O (n + m) time. Lines 4–6 take O (n)

time. Rest of the procedure takes∑n

i=1 dG(vi) = O (n + m)

time. Hence we have the following lemma.

Lemma 5.2. Algorithm 1 takes linear time to compute the clos-est neighbors of all the vertices if a canonical dpeo is provided.

The following algorithm constructs a locally connectedspanning tree of a 2-connected doubly chordal graph.

Algorithm 2: LCSTdoublychordal(G).

Compute a canonical dpeo σ = (v1, v2, . . . , vn) of G;1Closestneighbor(G, σ );2T = {vn vn−1};3for i = n − 2 to 1 do4

find the closest neighbor vi∗ of vi ;5T = T ∪ {vi vi∗ }6

end7Return T .8

The proof of correctness of the above algorithm followsfrom the proof of the sufficiency part of Theorem 5.1.

It can be tested in linear time whether a graph is2-connected using depth first search. A canonical dpeo of adoubly chordal graph can be computed in linear time [11].The closest neighbor of vi for all 1 � i � n − 1 can be com-puted 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 1073

Theorem 5.3. It can be tested in linear time whether a doublychordal graph admits a locally connected spanning tree. More-over, a locally connected spanning tree of a doubly chordal graphcan be constructed in linear time if the graph admits a locallyconnected spanning tree.

6. Conclusion

In this paper we proposed linear time algorithms forthe locally connected spanning tree recognition and con-struction problems for cographs, complements of bipartitegraphs, and doubly chordal graphs, respectively. Our recog-nition algorithms are supported by structural characteriza-tions.

Acknowledgements

The authors would like to thank the anonymous refer-ees for their helpful comments leading to improvements inthe presentation of the paper.

References

[1] A. Brandstädt, F. Dragan, V. Chepoi, V. Voloshin, Dually chordalgraphs, 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 treesin strongly chordal graphs and proper circular-arc graphs, DiscreteMath. 307 (2007) 208–215.

[4] D.G. Corneil, Y. Perl, L.K. Stewart, A linear time recognition algorithmfor cographs, SIAM J. Comput. 14 (1985) 926–984.

[5] D.G. Corneil, Y. Perl, L.K. Stewart, Complement reducible graphs, Dis-crete Appl. Math. 3 (1981) 163–174.

[6] D.R. Fulkerson, O.S. Gross, Incidence matrices and interval graphs, Pa-cific 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 minimumIFI 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 prob-lem, Discrete Appl. Math. 131 (1) (2003) 63–75.

[11] M. Lee, C. Kim, Computation of a (canonical) doubly perfect elimi-nation ordering of a doubly chordal graph, Korean J. Comput. Appl.Math. 5 (2) (1998) 287–294.