Journal of Algorithms 30, 166᎐184Ž. 1999 Article ID jagm.1998.0962, available online at http:rrwww.idealibrary.com on

Distance Approximating Trees for Chordal and Dually Chordal Graphs*

Andreas Brandstadt¨

Uni¨ersitat¨¨ Rostock, Fachbereich Informatik, Lehrstuhl fur Theoretische Informatik, D-18051 Rostock, Germany E-mail: [email protected]

Victor Chepoi*

Laboratoire de Biomathematiques,´´ Uni¨ersite d’Aix Marseille II, F-13385 Marseille Cedex 5, France E-mail: [email protected]

and

Feodor Dragan

Uni¨ersitat¨¨ Rostock, Fachbereich Informatik, Lehrstuhl fur Theoretische Informatik, D-18051 Rostock, Germany E-mail: [email protected]

Received April 23, 1997; revised March 10, 1998

In this paper we show that, for each G, there is a tree T such that T is a spanning tree of the square G2 of G and, for every two vertices, the distance between them in T is not larger than the distance in G plus 2. Moreover, we prove that, if G is a or even a dually chordal graph, then there exists a spanning tree T of G that is an additive 3-spanner as well as a multiplica- tive 4-spanner of G. In all cases the tree T can be computed in linear time. ᮊ 1999 Academic Press

1. INTRODUCTION

Many combinatorial and algorithmic problems concern the distance dG on the vertices of a possibly weighted graph G s Ž.V, E . Approximating

* The second and third authors were supported by VW, Project no. Ir69041; the third author was also supported by DFG. The results were presented at ESA’97Ž Grazwx 6. . The second and third authors are on leave from the Universitatea de stat din Moldova, Chis¸inau.˘

166 0196-6774r99 $30.00 Copyright ᮊ 1999 by Academic Press All rights of reproduction in any form reserved. DISTANCE APPROXIMATING TREES 167

dG by a simpler distanceŽ. in particular, by tree distance is useful in many areas such as communication networks, data analysis, motion planning, image processing, network design, and phylogenetic analysisŽ seew 1, 2, 4, 10, 12, 22, 27, 28, 30, 32x. . The goal is, for a given graph G, to find a sparse s Ј ¨ graph G Ž.V, E with the same vertex set, such that the distance duH Ž., in H between two vertices u, ¨ g V is reasonably close to the correspond- ¨ ing distance duGŽ., in the original graph G. There are several ways to measure the quality of this approximation, two of them leading to the notion of a spanner. For t G 1 a spanning subgraph H of G is called a ¨ wx¨ F и ¨ multiplicati et-spanner of G 12, 27, 28 if duHGŽ., t du Ž., for all ¨ g G ¨ F ¨ q ¨ g u, V.If r 0 and duHGŽ., du Ž., r for all u, V, then H is called an additi¨er-spanner wx22 . For many applicationsŽ e.g., in numerical taxonomy or in phylogeny reconstruction. the condition that H must be a spanning subgraph of G can be droppedŽ seewx 2, 30, 32. . In this case there is a striking way to measure how sharp dHGapproximates d , based on the notion of a pseudoisometry between two metric spaces. This idea is borrowed from the geometry of hyperbolic groupswx 15, 18 . For graphs and finite metric spaces a related notion of a near-isometry has been already used by Linial et al. wx23 . For our purposes we present a simplified version of this notionŽ the interested reader can consultwxwx 15, pp. 71᎐72 and 18 for the general definition and related material. . Let t G 1 and r G 0 be real numbers. Two graphs G s Ž.V, E and H s Ž.V, EЈ are called Ž.t, r -pseudoisometric if ¨ F и ¨ q ¨ F и ¨ q duHGŽ., t du Ž., r and du GH Ž., t du Ž., r for all u, ¨ g V. In this case we will say that H is a distanceŽ. t, r - approximating graph for G Žand conversely, G will be a distance Ž.t, r -approximating graph for H .. The graphs G and H are Ž.t, 0 -pseudo- isometric iff 1 и duŽ., ¨ F du Ž., ¨ F t и du Ž., ¨ t GH G for u, ¨ g V. If, in addition, H is a spanning subgraph of G, then we obtain the notion of the multiplicative t-spanner. Clearly, G and H are < ¨ y ¨ < F ¨ g Ž.1, r -pseudoisometric iff duGHŽ., du Ž., r for u, V. Again, if H is a spanning subgraph of G, this is the usual notion of the additive r-spanner. Recently Cai and Corneilwx 10 have considered multiplicative tree span- ners in graphs. They showed that for a given graph G, the problem of deciding whether G has a multiplicative tree t-spanner is NP-complete for any fixed t G 4 and is linearly solvable for t s 1, 2. The status of the case 168 BRANDSTADT¨ , CHEPOI, AND DRAGAN t s 3 is still open. For NP-completeness results on planar spanners seewx 5 . Multiplicative tree 3-spanners exist for interval and permutation graphs, and they can be found in linear timewx 24 . Similar results are known for the additive tree r-spanner problem. Prisnerwx 29 proposes a simple approach to constructing additive tree 2-spanners in interval and distance-hereditary graphs, and such 4-spanners in cocomparability graphs. Both papersw 10, 29x ask which important graph classes have tree t-spanners and r-spanners with small t and r. As mentioned inwx 29 , McKee showed that for every fixed integer t there is a chordal graph without tree t-spannersŽ additive as well as multiplicative. . Nevertheless, from the metric point of view, chordal graphs look like trees. In this paper we prove that for every chordal graph G there exists a tree T Žactually, T is a spanning tree of the square G2 . such that ¨ F и ¨ ¨ F ¨ q duTGŽ., 3 du Ž., and du TG Ž., du Ž., 2 for all vertices u, ¨ of G. In other words, T is aŽ. 3, 0 - and Ž. 1, 2 -approxi- mating tree for G. Moreover, if G is a strongly chordal graph, then there exists a spanning tree T of G that is an additive 3-spanner and a multiplicative 4-spanner. Thus, this answers the question whether strongly chordal graphs have tree t-spanners with small t, posed inwx 29 . Further- more, we show that the method elaborated for strongly chordal graphs works for a more general graph class, for the dually chordal graphs. In all cases the tree T can be computed in linear time.

2. PRELIMINARIES

All graphs occurring in this paper are connected, finite, undirected, loopless, and without multiple edges. A graph G s Ž.V, E is chordal wx9, 13 if it does not contain any inducedŽ. chordless cycle of length at least four. In a graph G the length of a path from a vertex ¨ to a vertex u is the ¨ number of edges in the path. The distance dGŽ. u, between the vertices u and ¨ is the length of a shortest Ž.u, ¨ -path, and the inter¨al I Ž. u, ¨ ¨ s g ¨ s q between these vertices is the set IuŽ., Äw V: duGGŽ., du Ž, w . ¨ k dwGŽ., 4. Let k be a positive integer. The kth power G of G has the same vertices as G, and two vertices are joined by an edge in Gk if and only if the distance in G is at most k. The disk of radius k centered at ¨ is ¨ ¨ s g the set of all vertices at distance at most k from , DkŽ. Äw V: ¨ F ¨ ¨ dGkŽ.,w k4, and the kth neighborhood N Ž.of is defined as the set of ¨ ¨ s g ¨ s all vertices at distance k from , that is, NkGŽ. Äw V: d Ž., w k4. ¨ ¨ ¨ [ ¨ By NŽ.we denote the neighborhood of , i.e., N Ž.N1 Ž.. More : s D ¨ generally, for a subset S V let NSŽ.¨ g S N Ž.denote the neigh- borhood of S. DISTANCE APPROXIMATING TREES 169

A subset S : V of a graph G is called m-con¨ex wx17 if for any pair of vertices u, ¨ g S each induced path connecting u and ¨ is contained in S. If two vertices x and y of a m-convex set S can be joined outside S by a path, then by definition of m-convexity, x and y must be adjacent. wx ¨ ¨ PROPOSITION 117. Any disk DkŽ.of a chordal graph G is m-con ex. This basic metric property of chordal graphs has some immediate but important consequencesŽ some of them already being used by different authors. . In the subsequent results the graph G is assumed to be chordal and u is an arbitrary but fixed vertex of G. ¨ ¨ ¨ ¨ - - ¨ LEMMA 1. For e ery ertex of G and e ery k,0 k duGŽ., , the set l ¨ NukŽ.Iu Ž, .induces a complete subgraph of G. g l ¨ Proof. Pick vertices x, y NukŽ.Iu Ž, .. Concatenating arbitrary shortest paths that connect ¨ with x and y, we will obtain a path outside the disk DukkŽ.. By the m-convexity of Du Ž.we conclude that x and y are adjacent. ¨ ¨ g ¨ LEMMA 2. If two ertices , w NkŽ. u are adjacent, then they ha ea common neighbor in the set Nky1Ž. u . g ¨ Proof. Indeed, take x, y Nuky1Ž.such that is adjacent to x and w is adjacent to y.By m-convexity x and y are adjacent or coincide. If x s y we are done. Otherwise, from the chordality of G we will deduce that either ¨y g E or wx g E, concluding the proof.

LEMMA 3. For any connected component S of the subgraph of G induced l ¨ by NkkŽ. u , the set N Ž. S Ny1 Ž. u induces a complete subgraph. Moreo er, ¨ g l s l there exists a ertex w S such that NŽ. S Nuky1 Ž.Nw Ž .Nuky1 Ž. Ž.Fig.1. g l ¨ Proof. Let x, y NSŽ.Nuky1 Ž.. Then we can find two vertices , w g S such that x is adjacent to w and y is adjacent to ¨. Consider a path P of S connecting the vertices ¨ and w. Then P together with the edges xw ¨ and y will give a path that intersects the disk Duky1Ž.only in the vertices x and y. Since Duky1Ž.is m-convex, we deduce that the vertices x and y are adjacent. Now consider a vertex w g S with a maximal number of neighbors in f g l Nuky1Ž.and assume that wy E for some y NS Ž.Nuky1 Ž.. Among ¨ ¨ neighbors of y in S we choose a vertex for which the distance dwSŽ., is minimal. Let P be a shortest path in S connecting the vertices w and ¨.

For every neighbor x of w in Nuky1Ž.consider the cycle formed by path P ¨ ¨ and the edges wx, xy, and y . Since G is chordal and dwSŽ., is minimal, ¨ the vertices x and must be adjacent. So, every neighbor of w in Nuky1Ž. is a neighbor of ¨ as well. But then from wy f E and ¨y g E we get a contradiction to the choice of the vertex w. 170 BRANDSTADT¨ , CHEPOI, AND DRAGAN

FIG. 1. Illustration of Lemma 3.

Let q s maxÄduŽ., ¨ : ¨ g V 4. For a given k,0F k F q, let S kk,...,S G 1 pk be the connected components of the subgraph of G induced by the kth neighborhood of u. Define a new graph ⌫ whose vertices are the con- k s s k nected components Siki, k 0,...,q and i 1,..., p . Two vertices S ky1 and Sj are adjacent if and only if there is an edge of G with one end in k ky1 k ) Sijand another end in S . Lemma 3 implies that every S i, k 0, is ⌫ adjacent in to exactly one connected component of Nuky1Ž.. This shows that the following holds.

LEMMA 4. ⌫ is a tree. ⌫ s 0 In what follows we consider rooted at the vertex u S1 . As usual, the kl kl⌫ nearest common ancestor ncaŽ Sij, S . of two vertices S iand S jof is ⌫ k the root of the smallest subtree of that contains both of the vertices Si l and Sj.

3. DISTANCE APPROXIMATING TREES FOR CHORDAL GRAPHS

In this section for a given chordal graph G s Ž.V, E we construct a tree T s Ž.V, EЈ that is a distance Ž.Ž. 3, 0 - and 1, 2 -approximating tree for G. As in the previous section, we fix an arbitrary vertex u of G. To construct k G ¨ g T, for each connected component Skj Ž.1 we select a vertex k l ¨ k NSŽ jk.Ž.Nuy1 and make adjacent in T to all vertices of Sj Ža formal description is given below. . DISTANCE APPROXIMATING TREES 171

PROCEDURE 1. EЈ [ л; for k [ q downto 1 do [ for j 1to pk do ¨ k l pick an arbitrary vertex in NSŽ jk.Ž.Nuy1 ; g k ¨ Ј for all x Sj add x to E . By Lemma 4 it follows easily that T is a tree. For any edge x¨ of T that ¨ s is not an edge of G we have dxGŽ., 2. Indeed, by Lemma 3 every ¨ neighbor of x in Nuky1Ž.is adjacent to . Therefore, T is a spanning tree of G2. Since for constructing T we need only find the connected compo- nents of the kth neighborhoods of u, the complexity of this procedure is OVŽ<

THEOREM 1. T is a distance Ž.3, 0 - and Ž.1, 2 -approximating tree of G. F Proof. First we will show that for any edge xy of G we have dxT Ž., y s s 3. If duGGŽ., x du Ž., y k, then x and y belong to a common con- nected component of NukŽ.. Therefore, in T both x and y are adjacent to ¨ s y the same vertex . In this case dxTGŽ., y 2. Now suppose that du Ž., x s s ¨ 1 duGŽ., y k and xy is not an edge of T. Let be the neighbor of x on the path connecting u and x in the tree T. By Lemma 3 the vertices ¨ ¨ s and y are adjacent. Since duGŽ., k, from the previous case we obtain ¨ s s that dTTŽ., y 2. Hence dx Ž., y 3. On the other hand, as we men- F tioned above, for every edge xy of T, dxGŽ., y 2. Now consider two arbitrary vertices x and y of G and a shortest Ž.x, y path. Applying to every edge of this path the obtained inequalities, we will get

1 и F F и 2 dxGTŽ., y dx Ž., y 3 dx G Ž., y .

< y < F To prove that dxGTŽ., y dx Ž., y 2, we proceed as follows. Suppose g klg [ kl that x Sijand y S . Let S ncaŽ S ij, S . and assume that S is a connected component of the sth neighborhood of u. Denote by SЈ and SЉ ⌫ k l the neighbors of S in on the paths between S, Sij, and S, S , respectively. From the definition of the trees ⌫ and T we obtain that in T and G the distances between u and any other vertex of V are the same. Any shortest path in G between u and each of the vertices x and y shares a common vertex with S. Therefore, one can select two vertices xЈ, yЈ g S such that Ј s y Ј s y Ј Ј dxGGŽ., x k s and dy Ž., y l s Žnote that x and y are vertices of S closest to x and y, respectively. . Since ⌫ is a tree, one can easily show that in G any shortest Ž.x, y path Px Ž., y between x and y passes through the set S. Let xЉ, yЉ denote the first and last vertices of PxŽ., y in S. 172 BRANDSTADT¨ , CHEPOI, AND DRAGAN

Ј Љ g Ј Ј Љ g Љ Љ s y Since x , x NSŽ.and y , y NS Ž ., by Lemma 3, dxG Ž, x . k s Љ s y s q y и q Љ Љ and dyGGGŽ., y l s. Therefore, dx Ž., y k l 2 s dx Ž, y .. Љ Љ F From Lemma 3 we have dxGŽ., y 3. On the other hand, from the s q y и q ␣ ␣ s algorithm we obtain that dxT Ž., y k l 2 s , where 0ifinT the nearest common ancestor of x and y is a vertex of S, and ␣ s 2 if this ancestor belongs to the father of S in ⌫. In the first case necessarily NSŽ.Ј and NSŽ.Љ share a vertex in S. Since by Lemma 3 NS Ž.Ј l S and Љ l Љ Љ F NSŽ.S are complete subgraphs, one can easily show that dxG Ž, y . < y < F 2. Therefore, in this case dxGTŽ., y dx Ž., y 2. The same inequality is evidently true if ␣ s 2. This completes the proof of the theorem. It is an open problem whether the distance matrix D of a chordal graph G s Ž.V, E can be computed in OV Ž<<2 . time. From the second assertion of Theorem 1 we obtain that within these time bounds we can compute the elements of D with an error of at most 2. Even more, given a pair of vertices x, y g V by the algorithm of Harel and Tarjanwx 20 , the nearest common ancestor ncaŽ. x, y of x and y in T can be computed in O Ž.1 time s q after a linear time preprocessing of T. Since dxTTŽ., y dx Ž., u y и dyTTŽ., u 2 du Ž, nca Ž.. x, y , the distance dx T Ž., y can be found by using a constant number of operations. Therefore, after a linear time prepro- cessing, in only OŽ.1 time we can compute dxG Ž, y .with an error of at most 2. A chordal graph together with some distanceŽ. 1, 2 -approximating tree produced by Procedure 1 is given in Fig. 2. Note that this chordal graph has no additive tree r-spanner for r F 3Ž seewx 29. . It remains an open question whether every chordal graph admits anŽ. 1, 1 -approximating tree.

4. SPANNERS OF SOME CLASSES OF CHORDAL GRAPHS

As we already mentioned in the Introduction, chordal graphs do not have multiplicative or additive t-spanners with a fixed t. However, we will show that chordal graphs, which do not containŽ. extended suns as induced subgraphs, have multiplicative 4-spanners and additive 3-spanners. We present an OVŽ<

FIG. 2. A chordal graph and a distanceŽ. 1, 2 -approximating tree of it.

adjacent to u3 and y may be adjacent to up. Suns S34and S and extensions of S4 are presented in Fig. 3. A chordal graph G is called strongly chordal if it does not contain any wx sun Sp as an induced subgraph 11, 16 . For equivalent definitions and properties of strongly chordal graphs seewx 16 , and for the recognition problem seewx 26, 31 . kq1 kq1 Pick an arbitrary vertex u of G, and let S1 ,...,Sp q be the con- k 1 G nected components of the subgraph of G induced by Nukq1Ž., k 1. Let 174 BRANDSTADT¨ , CHEPOI, AND DRAGAN

FIG. 3. Suns S34and S and extensions of S 4.

s kq1 l s CjjNSŽ .Nu k Ž.Ž j 1,..., p kq1 .Žbecause of Lemma 3, Cj is a D pkq 1 . and denote by Hkjthe graph with s1 Cj as the vertex set, and two vertices x, y are adjacent in Hk if and only if they belong to a common clique Cj. By a two-set of a graph G we will mean a subset M : V such that F g dxGŽ., y 2 for any x, y M.

LEMMA 5. Let G be a chordal graph that does not contain S3 as an : ¨ induced subgraph. For any two-set M NkŽ. u of G there exists a ertex ¨ g ¨ Nky1Ž. u that is adjacent to all ertices of M. Proof. By induction on the cardinality q s <

Hence, x and y must have a common neighbor in Nuky1Ž.. y G s Assume now that every q 1 Ž.q 3 vertices of M Ä4x12, x ,..., x q have a common neighbor in Nuky1Ž.but not all q vertices have such a s F q l s neighbor. Let ypis1, i/ piNxŽ.Nu ky1 Ž., p 1, 2, 3. Since x p is adjacent to ypq1 and ypy1123Ž.mod 3 by Lemma 3, the vertices y , y , and y are pairwise adjacent. Moreover, the vertices x12, x , and x 3induce an independent set; otherwise we will obtain an induced 4-cycle. Hence, again we have constructed an induced 3-sun formed by x123123, x , x , y , y , y . DISTANCE APPROXIMATING TREES 175

LEMMA 6. Let G be a chordal graph that does not contain extended suns U G ¨ Spp Ž.4 as induced subgraphs. Then e ery connected component of the G graph Hk Ž. k 1 is a two-set of G.

Proof. Let x, y be two vertices of a connected component F of the G s s graph HkGsuch that dxŽ., y 3. Pick a shortest path P Žx0 s x, x1,..., xly1, xl y. in F connecting x and y. By Lemma 3 and since P is an induced path of F, we will find l pairwise nonadjacent vertices s z1,..., zlkin Nuq1Ž.such that every ziii Ž1,...,l .is adjacent to x y1, xi only. Let a and b be neighbors in Nuky1Ž.of x and y, respectively. Note that a f NyŽ.and b f Nx Ž.. From Lemma 3 we obtain that a and b must be adjacent. Furthermore, by Lemma 2 there is a common neighbor g U w Nuky2Ž.of a and b. Now we construct an extended sun Sp with p G 4 in the following way. Pick the smallest iiŽ.s 1,...,l y 1 such that s xi is adjacent to y. Then pick the largest jjŽ.1,...,i such that x j is G G F - adjacent to x. Since dxGŽ., y 3, we have i 2 and 1 j i. It is easy to see that the vertices w, x, zjq1,..., zi, y together with the vertices a, x jj, x q1,..., xi, b induce a sun in G. Adding to this sun the vertices z1 and zl , we obtain an extended sun.

Now we have all of the prerequisites needed to formulate the main result of this section. Let G be a chordal graph that does not contain a sun U G S3 and extended suns Spp Ž.4 as induced subgraphs. Consider an arbitrary fixed vertex u and a tree ⌫ rooted at u, which is defined as in Section 2. Let q [ maxÄduŽ., ¨ : ¨ g V 4 and S kk,...,S be the connected 1 pk components of the kth neighborhood NukŽ.of u. We construct a distance-approximating spanning tree T s Ž.V, EЈ of G step by step, ⌫ Ј starting from the leaves of , i.e., from NuqŽ.. Initially E is empty. At ¨ g Ј ¨ first, for each vertex NuqŽ., we add to E one edge of the form w, ¨ where w is a neighbor of in Nuqy1Ž.. Now consider an arbitrary k that y s kq1 l s runs from q 1 to 1 and the cliques CjjNSŽ .Ž.ŽNu k j 1,..., pkq1.. By Lemma 6, every connected component F of the graph Hk ¨ is a two-set. Therefore all vertices of F have a common neighbor F in g Nuky1Ž.Žsee Lemma 5 . . Now if x is a vertex of Hk , say x F for some Ј connected component F of Hk , then we add to the current E the edge ¨ Ј x Fk. For every vertex y of NuŽ.that does not belong to H k, we add to E an edge connecting y with an arbitrary neighbor of it in Nuky1Ž..

PROCEDURE 2.

EЈ [ л; ¨ g for every NuqqŽ.pick a neighbor w in Nuy1 Ž.and add the edge ¨w to EЈ; 176 BRANDSTADT¨ , CHEPOI, AND DRAGAN

for k [ q y 1 downto 1 do kq1 kq1 compute the connected components S ,...,S of Nuq Ž.; 1 pkkq 1 1

determine the graph Hk and compute its connected compo- nents; g _ for every y NukkŽ.H pick a neighbor w in Nu ky1 Ž.and add the edge yw to EЈ;

for every connected component F of the graph Hk do ¨ choose in Nuky1Ž.a common neighbor F of all vertices of F; g ¨ Ј for every x F add the edge x F to E .

One can easily show that the graph T s Ž.V, EЈ constructed by this procedure is a spanning tree of G. Next we will show that the procedure can be implemented in linear time. In the preprocessing step we apply the breadth-first search to compute the kth neighborhoods of the vertex u in OVŽ<

Finally, to decide which connected components of the graph Hk are ¨ ¨ g contained in the neighborhood NŽ.of some vertex Nuky1 Ž.,wedo ¨ the following. In total OŽŽ.. deg time, for each connected component Fi s ¨ l / л Ž.Ž.i 1,...,r with N Fii, we compute the value n , which is ¨ s << the number of vertices of Fiiifrom NŽ..If n F , then we put ¨ [ ¨. Thus, this line of the procedure can be implemented in Fi OŽŽ..ݨ g deg ¨ time, too. Nky 1Žu. DISTANCE APPROXIMATING TREES 177

Summarizing, the whole procedure requires only

q ¨ q s <

THEOREM 2. Let G be a chordal graph that does not contain a sun S3 and U G s Ј extended suns Sp Ž. p 4 as induced subgraphs. The tree T Ž.V, E constructed by Procedure 2 is a multiplicati¨e 4-spanner as well as an additi¨e 3-spanner of G. F Proof. First we will show that dxT Ž., y 4 holds for any edge xy of G. s s g k Suppose that duGGŽ., x du Ž., y k, say x, y S j.If x and y belong to a common connected component F of the graph Hk , then in T they have ¨ s Ј Ј a common father FT, and thus dxŽ., y 2. Otherwise, let x and y be Ј Ј g the fathers of x and y, respectively, in T. Since x , y Cjk,in H y1 the vertices xЈ and yЈ lie in a common connected component. As we have Ј Ј s s already shown dxTTŽ., y 2. Therefore, in this case dx Ž., y 4. g g Ј Now suppose that x NukkŽ.and y Nuy1 Ž.. Let x be the father of x in T.If xЈ s y we are done. Assume xЈ / y. Both xЈ and y have some neighbor in the same component of NukŽ., and thus they are adjacent in Ј s Hky1. According to the algorithm, for an edge of this type, dxT Ž., y 2 s holds. Hence dxT Ž., y 3. Now consider two arbitrary vertices ¨ and w of G and a shortest Ž.¨, w F path. Applying to every edge xy of this path the inequality dxT Ž., y 4, ¨ F и ¨ we will get dTGŽ., w 4 d Ž., w , i.e., T is a multiplicative 4-spanner for G. That T is an additive 3-spanner of G follows already from the previous part of our proof and fromwx 29, Lemma 1 . For the sake of completeness we present here our proof. For this suppose that T is rooted at the vertex u. From the algorithm it follows that the distances in G and T between a vertex and any of its ancestors are the same. Pick two vertices ¨, w g V ¨ ¨ and proceed by induction on dGŽ., w .If and w are adjacent, then we ¨ F ¨ s G are done, because then dTGŽ., w 4. Now suppose that d Ž., w s 2 and let z be a neighbor of ¨ on a shortest path between ¨ and w. From F y q s q the induction assumption we have dzT Ž., w s 1 3 s 2 and ¨ F s ¨ ¨ dT Ž., z 4. Let a nca Ž., z be the nearest common ancestor of and 178 BRANDSTADT¨ , CHEPOI, AND DRAGAN

FIG. 4. A strongly chordal graph and an additive tree 3-spanner of it. DISTANCE APPROXIMATING TREES 179

¨ s ¨ s ¨ g z in the tree T. Since daTGTGŽ., da Ž.Ž., , da, z da Ž., z , and z E, < ¨ y < F we obtain that dTTŽ., a dz Ž., a 1. - ¨ y We can further assume that dzTTŽ., w d Ž., w 1; otherwise we ¨ F ¨ q immediately conclude that dTGŽ., w d Ž., w 3. From this and the previous inequality we deduce that the vertex ncaŽ. w, z lies on the path of T between the vertices a and z. Therefore, a is an ancestor of w, and thus s ¨ q daTGŽ., w da Ž., w . Notice that the distance sums d TT Ž., w da Ž., z ¨ q and dTTŽ., z da Ž, w .are equal. Hence

¨ s y q ¨ dTTTTŽ., w da Ž., w da Ž., z d Ž., z s y q ¨ daGGTŽ., w da Ž., z d Ž., z F q F ¨ q dwGGŽ., z 4 d Ž., w 3, concluding the proof.

COROLLARY 1. E¨ery strongly chordal graph G admits a spanning tree T that is a multiplicati¨e 4-spanner as well as an additi¨e 3-spanner of G. Such a tree T can be constructed in linear time. Figure 5 gives a small strongly chordal graph G without additive tree

2-spanners. This graph G is obtained from four copies H123, H , H , and H 4 of a graph H by identifying some vertices and adding some new edgesŽ see Fig. 5. . Now assume that G has an additive tree 2-spanner T. Then there g must be an index i Ä41, 2, 3, 4 such that the vertices aiiiand b of H are connected in T by a pathŽ. of length at most three that does not contain any other vertices of Hiii. Indeed, if for every index i vertices a and b would be connected in T by a path using only the vertices of Hi, then the G edge ab14of G cannot be an edge of T, but daT Ž.14, b 4 will hold. Hence, to get a contradiction of our assumption it is enough to show that q the graph Hiiiwith tree edges axand bxdoes not have any additive tree

FIG. 5. A strongly chordal graph G that does not have an additive tree 2-spanner. 180 BRANDSTADT¨ , CHEPOI, AND DRAGAN

2-spanner that contains both edges axiiand bx. But this can be done directly. The case in which aiiand b are connected outside H iby a path of length 3 of T is even simpler.

5. SPANNERS OF DUALLY CHORDAL GRAPHS

Below we show that Procedure 2 from the previous section can be applied to produce multiplicative 4-spanners and additive 3-spanners in dually chordal graphs. These graphs were introduced inwx 14 as a general- ization of strongly chordal graphsŽ which are the hereditary dually chordal graphs. where the Steiner tree problem and many domination-like prob- lems still have efficient solutions. It turns out that the dually chordal graphs are exactly the intersection graphs of maximal cliques of chordal graphsŽ seewx 7, 33. . To define dually chordal graphs, we need some notions from the theory of hypergraphswx 3 . Let E be a hypergraph with underlying set V, i.e., E is a collection of subsets of V. The dual hypergraph E* has E as its vertex set, and for every ¨ g V a hyperedge Ä4e g E: ¨ g e . The line graph LŽ.E s ŽE, E .of E is the intersection graph of E, i.e., eeЈ g E if and only if e l eЈ / л.A Helly hypergraph is one whose edges satisfy the Helly property, that is, any subfamily EЈ : E of pairwise intersecting edges has a nonempty intersection. A hypergraph E is a hypertree if there is a tree T with vertex set V such that every edge e g E induces a subtree in T. Equivalently, E is a hypertree if and only if the line graph LŽ.E is chordal and E is a Helly hypergraph. A hypergraph E is a dual hypertree Ž.␣-acyclic hypergraph if there is a tree T with vertex set E such that, for every vertex ¨ g V, T¨ s Ä4e g E: ¨ g e induces a subtree of T. Observe that E is a hypertree if and only if E* is a dual hypertree. For a graph G by CŽ.G s Ä4C : C is a maximal clique in G we denote s ¨ ¨ g the clique hypergraph. Furthermore, let DŽ.G Ä DkŽ.: V, k a nonnegative integer4 be the disk hypergraph of G. A graph G is called dually chordal if the clique hypergraph CŽ.G is a hypertreewx 7, 14, 33 . In wx7, 14 it is shown that dually chordal graphs are the graphs G whose disk hypergraphs DŽ.G are hypertrees Ž seewx 7, 14 for other characterizations, particularly in terms of certain elimination schemes, andwx 8 for their algorithmic use. . From the definition of hypertrees we deduce that for dually chordal graphs the line graphs of the clique and disk hypergraphs are chordal. Conversely, if G is a chordal graph, then CŽ.G is a dual hypertree, and, therefore, the line graph LŽŽ..C G is a dually chordal graph, justifying the term ‘‘dually chordal graphs.’’ Finally note that graphs that are both chordal and dually chordal were dubbed doubly chordal and were investigated inwx 7, 14, 25 . DISTANCE APPROXIMATING TREES 181

Henceforward, we will suppose that G is a dully chordal graph. To prove that Procedure 2 indeed constructs an additive 3-spanner of G, we need some properties of two-sets and graphs Hk constructed from G. : ¨ ¨ g LEMMA 7. For any two-set M NkŽ. u of G there exists a ertex ¨ Nky1Ž. u that is adjacent to all ertices of M. g Proof. Indeed, consider the disks Ä Dw1Ž.: w M4 and Duky1Ž.. Since these disks intersect pairwise, by the Helly property they share a common ¨ ¨ g : vertex . Necessarily, Nuky1Ž.because M Nuk Ž..

LEMMA 8. Let S be a connected component of the subgraph of G induced [ l ¨ by NkkŽ. u . Then M NS Ž.Ny1 Ž. u is a two-set, and, moreo er, any two nonadjacent ¨ertices of M ha¨e a common neighbor in M. In particular, the graph ⌫, defined in Section 2, is a tree.

Proof. Pick two arbitrary nonadjacent vertices x, y g M. Then we can find two vertices ¨, w g S such that x is adjacent to ¨ and y is adjacent to w. Consider a path P of S connecting the vertices ¨ and w. The disk [ g j Duky2Ž., together with the disks of the family M Ä Dz1Ž.: z P Ä44x, y , forms a cycle in the line graph LŽŽ..D G . From the chordality of L ŽŽ..D G l s л g l and since Duky21Ž.Dz Ž.for all z P, we deduce that Dx 1 Ž. / л s Dy1Ž., i.e., dxG Ž, y .2. Ž Here we used the following property of chordal graphs: for each vertex t on a cycle C of length at least 4, either the neighbors of t in C are adjacent or C has a chord incident to t.. Applying once more the property to the cycle of LŽŽ..D G formed by the Ј disks of M, we will find in this cycle a disk Dz1Ž., which together with Dx11Ž.and Dy Ž., induces a triangle in L ŽD ŽG ... By the Helly property the Ј pairwise intersecting disks Dz11Ž .. Dx Ž., and Dy 1 Ž.have a common g g vertex s.If s Nuky1Ž.we are done. So assume that s S. The disks Duky111Ž., Ds Ž., Dx Ž., and Dy 1 Ž.intersect pairwise. Again, by the Helly s property and since dsGŽ., u k, we can find in M a common neighbor of the vertices x, y, and s.

As in Procedure 2, let S kq1,...,S kq1 denote the connected components 1 pkq 1 G s kq1 l of the subgraph of G induced by Nukq1Ž., k 1. Set MjjNS Ž . s NukkŽ., j 1,..., p q1 Žthe two-sets Mjjplay the role of the cliques C in the case of strongly chordal graphs. . Denote by Hk the graph with D pkq 1 js1 Mj as the vertex set, and two vertices x, y are adjacent in Hk if and only if they belong to a common set Mj. We continue with the following result, which is analogous to Lemma 6.

¨ G LEMMA 9. E ery connected component F of the graph Hk Ž. k 1 is a two-set of G. 182 BRANDSTADT¨ , CHEPOI, AND DRAGAN

Proof. Let x, y be two nonadjacent vertices of a connected component

F of the graph Hk . Then we can find a collection of two-sets M , M ,...,M such that x g M , y g M , and M l M / л for all ii12 ih i1 ihjj i iq1 j s 1,...,h y 1. Pick z g M l M , j s 1,...,h y 1, and let z [ x jijj iq1 0 and z [ y. Since z y , z g M , j s 1,...,h, we can find two vertices hj1 jij X Y kq1 ¨ , ¨ g S adjacent to z y and z , respectively. Let P be a path of jj ij j1 jj kq1 XY S connecting the vertices ¨ and ¨ . The disk Duy Ž., together with ijjkj 1 g D h Dx11Ž., Dy Ž.and the disks of the family Ä Dz 1Ž.: z js1 Pj4, forms a cycle in the line graph LŽŽ..D G . From chordality of this graph and since l s л g D h l Duky11Ž.Dz Ž. holds for all z js1 Pj, we deduce that Dx1Ž. / л s Dy1Ž., i.e., dxG Ž, y . 2.

To find the connected components of the graph Hk we construct again a special bipartite graph B s Ž.W, K; U . In this graph W s Ä4s ,...,s Ža k 1 pkq 1 kq1 vertex sjjrepresents a set S ., and K is the vertex set of H k. A vertex g ¨ g ¨ g kq1 sjkjW and a vertex K are adjacent in B if and only if NSŽ .. ŽŽ..¨ The graph Bk can be constructed in O ݨ g N q Žu.j N Žu. deg time. Note ¨ g k 1 k that a vertex NukkŽ.belongs to H if and only if it has a neighbor in Nukq1Ž.. The connected components of Hk are exactly the intersections of the connected components of Bk with the set K, and thus can be found within the same time bound. All other steps of the procedure can be implemented in the same way as for strongly chordal graphs. Summarizing, the whole procedure for a dually chordal graph G requires

q ¨ q s <

THEOREM 3. Let G be a dually chordal graph. The tree T s Ž.V, EЈ constructed by Procedure 2 is a multiplicati¨e 4-spanner as well as an additi¨e 3-spanner of G. Proof. The proof is the same as the proof of Theorem 2. First, from Lemma 8 we conclude that T is a spanning tree of G. We will prove only F g k that dxT Ž., y 4 for any edge xy of G. First suppose that x, y Sj .If x and y belong to a common connected component of Hk , by Lemmas 7 and 9 we deduce that x and y have a common father in T, and thus s Ј Ј dxT Ž., y 2. Otherwise, let x and y be their fathers in T. By Lemma 8 we obtain that xЈ and yЈ belong to a common connected component of Ј Ј s s Hky1. But we know that in this case dxTTŽ., y 2; hence dx Ž., y 4. g g Ј / Now suppose that x NukkŽ.and y Nuy1 Ž.. Let x y be the father of x in T Ž.if xЈ s y we are done . By Lemma 8 xЈ and y either are adjacent or have a common neighbor in Nuky1Ž.. In any case they both DISTANCE APPROXIMATING TREES 183

Ј s belong to a common connected component of Hky1. Then dxT Ž., y 2, s and hence dxT Ž., y 3.

REFERENCES

1. I. Althofer,¨ G. Das, D. Dobkin, D. Joseph, and J. Soares, On sparse spanners of weighted graphs, Discrete Comput. Geom. 9 Ž.1993 , 81᎐100. 2. J.-P. Barthelemy´´ and A. Guenoche, ‘‘Trees and Proximity Representations,’’ Wiley, New York, 1991. 3. C. Berge, ‘‘Hypergraphs,’’ Horth-Holland, Amsterdam, 1989. 4. S. Bhatt, F. Chung, F. Leighton, and A. Rosenberg, Optimal simulations of tree ma- chines, in ‘‘27th IEEE Foundations of Computer Science, Toronto, 1986,’’ pp. 274᎐282. 5. U. Brandes and D. Handke, ‘‘NP-Completeness Results for Minimum Planar Spanners,’’ preprint, University of Konstanz, Konstanzer Schrift. Math. Inform. 16 Ž.1996 . 6. A. Brandstadt,¨ V. Chepoi, and F. Dragan, Distance approximating trees for chordal and dually chordal graphs, Graz, Austria, September 1997, Lecture Notes in Comp. Sci. 1284 Ž.1997 , 78᎐91. 7. A. Brandstadt,¨ F. Dragan, V. Chepoi, and V. Voloshin, Dually chordal graphs, Graph- Theoretic Concepts in Computer Science, Lecture Notes in Comput. Sci. 790 Ž.1994 , 237᎐251Ž. to appear in SIAM J. Discrete Math. 8. A. Brandstadt,¨ V. Chepoi, and F. Dragan, Clique r-domination and clique r-packing problems on dually chordal graphs, SIAM J. Discrete Math. 10 Ž.1997 , 109᎐127. 9. P. Buneman, A characterization of rigid circuit graphs, Discrete Math. 9 Ž.1974 , 205᎐212. 10. L. Cai and D. G. Corneil, Tree spanners, SIAM J. Discrete Math. 8 Ž.1995 , 359᎐387. 11. G. J. Chang and G. L. Nemhauser, The k-domination and k-stability problems on sun-free chordal graphs, SIAM J. Alg. Discrete Math. 5 Ž.1984 , 332᎐345. 12. L. P. Chew, There are planar graphs almost as good as the complete graph, J. Comput. Syst. Sci. 39 Ž.1989 , 205᎐219. 13. G. A. Dirac, On rigid circuit graphs, Abh. Math. Sem. Uni¨. Hamburg 25 Ž.1961 , 71᎐76. 14. F. Dragan, C. Prisacaru, and V. Chepoi, Location problems in graphs and the Helly propertyŽ. in Russian , Discrete Math. Moscow 4 Ž.1992 , 67᎐73. 15. D. B. A. Epstein, J. W. Cannon, D. F. Holt, S. V. F. Levy, M. S. Paterson, and W. P. Thurston, ‘‘Word Processing in Groups,’’ Jones and Bartlett, Boston, 1992. 16. M. Farber, Characterization of strongly chordal graphs, Discrete Math. 43 Ž.1983 , 173᎐189. 17. M. Farber and R. E. Jamison, Convexity in graphs and hypergraphs, SIAM J. Alg. Discrete Math. 7 Ž.1986 , 433᎐444. 18. E. Ghys and P. de la Harpe, Les Groupes Hyperboliques d’apres` M. Gromov, Prog. Math. 83 Ž.1990 . 19. M. C. Golumbic, ‘‘Algorithmic and Perfect Graphs,’’ Academic Press, London, 1980. 20. D. Harel and R. E. Tarjan, Fast algorithms for finding nearest common ancestors. SIAM J. Comput. 13 Ž.1984 , 338᎐355. 21. Hoang-Oanh Le, Personal communication. 22. A. L. Liestman and T. Shermer, Additive graph spanners, Networks 23 Ž.1993 , 343᎐364. 23. N. Linial, E. London, and Y. Rabinovich, The geometry of graphs and some of its algorithmic applications, Combinatorica 15 Ž.1995 , 215᎐245. 24. M. S. Madanlal, G. Venkatesan, and C. Pandu Rangan, Tree 3-spanners on interval, permutation and regular bipartite graphs, Inform. Proc. Lett. 59 Ž.1996 , 97᎐102. 184 BRANDSTADT¨ , CHEPOI, AND DRAGAN

25. M. Moscarini, Doubly chordal graphs, Steiner trees and connected domination, Networks 23 Ž.1993 , 59᎐69. 26. R. Paige and R. E. Tarjan, Three partition refinement algorithms, SIAM J. Comput. 16 Ž.1987 , 973᎐989. 27. D. Peleg and A. A. Schafer,¨ Graph spanners, J. Graph Theory 13 Ž.1989 , 99᎐116. 28. D. Peleg and J. D. Ullman, An optimal synchronizer for the hypercube, in ‘‘Proceedings of the 6th ACM Symposium on Principles of Distributed Computing, Vancouver, 1987,’’ pp. 77᎐85. 29. E. Prisner, Distance approximating spanning trees, Proceedings of STACS’97, Lecture Notes in Comput. Sci. 1200 Ž.1997 , 499᎐510. 30. P. H. A. Sneath and R. R. Sokal, ‘‘Numerical Taxonomy,’’ San Francisco, 1973. 31. J. P. Spinrad, Doubly lexical ordering of dense 0᎐1-matrices, Inform. Proc. Lett. 45 Ž.1993 , 229᎐235. 32. D. L. Swofford and G. J. Olsen, Phylogeny reconstruction, in ŽD. M. Hills and C. Moritz, Eds.. , ‘‘Molecular Systematics,’’ pp. 411᎐501, Sinauer Associates, Sunderland, MA, 1990. 33. J. L. Szwarcfiter and C. F. Bornstein, Clique graphs of chordal and path graphs, SIAM J. Discrete Math. 7 Ž.1994 , 331᎐336.