10
Approximation Algorithms for Some k -Source Shortest Paths Spanning Tree Problems Yen Hung Chen Algorithm and Biocomputing Lab Department of Computer Science, National Tsing Hua University, Hsinchu 300, Taiwan, Republic of China Bang Ye Wu Department of Computer Science and Information Engineering, Shu-Te University, YenChau Kaoshiung 824, Taiwan, Republic of China Chuan Yi Tang Department of Computer Science, National Tsing Hua University, Hsinchu 300, Taiwan, Republic of China In this article, we investigate two spanning tree problems of graphs with k given sources. Let G = (V , E , w ) be an undirected graph with nonnegative edge lengths and S V a set of k specified sources. The first problem is the k -source maximum vertex shortest paths spanning tree (k -MVST) problem, in which we want to find a span- ning tree T such that the maximum total distance from any vertex to all sources is minimized, that is, we want to minimize max v V { sS d T (s, v )}, in which d T (s, v ) is the length of the path between s and v on T . The other problem is the k -source maximum source shortest paths spanning tree (k -MSST) problem, in which the objective function is the maximum total distance from any source to all vertices, that is, max sS { v V d T (s, v )}. In this arti- cle, we present a polynomial time approximation scheme (PTAS) for the 2-MVST problem. For the 2-MSST problem, we first give (2 + ε)-approximation algorithm for any ε > 0, and then present a PTAS for the case that the input graphs are restricted to metric graphs. Finally, we show that there are simple 3-approximation algorithms for both problems with arbitrary k . © 2006 Wiley Periodicals, Inc. NETWORKS, Vol. 47(3), 147–156 2006 Keywords: combinatorial optimization problem; spanning tree; approximation algorithm; polynomial time approximation scheme Received July 2003; accepted November 2005 Correspondence to: Y. H. Chen; e-mail: [email protected] DOI 10.1002/net.20103 Published online in Wiley InterScience (www.interscience.wiley. com). © 2006 Wiley Periodicals, Inc. 1. INTRODUCTION Finding spanning trees of a given graph is an important problem in network design. Depending on the applications, problems are defined by different objectives. For example, a minimum spanning tree is the spanning tree of minimum total edge weight, and the objective function of the minimum routing cost spanning tree (MRCT) [11] is the total distance summed over all pairs of vertices. Motivated by the applications of multicasting and broad- casting, several multisource spanning tree problems have been studied [2, 4, 7, 8, 12, 14]. In such problems, a net- work is modeled by an undirected graph with nonnegative edge length function. Some vertices are destinations, whereas some of them are sources. The goal is to find a tree spanning all sources and destinations such that messages can be routed from sources to destinations along the tree edges. The length of an edge usually represents the cost of routing a message via the edge, and the cost from a source to a destination is the distance between the two vertices, that is, the total length of the edges of the unique path between the two vertices in the tree. With different considerations, the objective func- tions of the problems are defined differently but in general to minimize some distance related costs. Let G = (V , E, w) be an undirected graph with non- negative edge length function w and S V a set of k specified sources. The k -source MRCT (k -MRCT), also called as the k -source shortest paths spanning tree, is the spanning tree T minimizing sS { vV d T (s, v)}, where d T (s, v) is the length of the path between s and v in T . If there is only one source, the problem can be solved by finding the shortest paths tree, a spanning tree in which NETWORKS—2006—DOI 10.1002/net

Approximation algorithms for some k-source shortest paths spanning tree problems

Embed Size (px)

Citation preview

Page 1: Approximation algorithms for some k-source shortest paths spanning tree problems

Approximation Algorithms for Some k -SourceShortest Paths Spanning Tree Problems

Yen Hung ChenAlgorithm and Biocomputing Lab Department of Computer Science, National Tsing Hua University,Hsinchu 300, Taiwan, Republic of China

Bang Ye WuDepartment of Computer Science and Information Engineering, Shu-Te University, YenChau Kaoshiung 824,Taiwan, Republic of China

Chuan Yi TangDepartment of Computer Science, National Tsing Hua University, Hsinchu 300,Taiwan, Republic of China

In this article, we investigate two spanning tree problemsof graphs with k given sources. Let G = (V , E , w ) bean undirected graph with nonnegative edge lengths andS ⊂ V a set of k specified sources. The first problem isthe k -source maximum vertex shortest paths spanningtree (k -MVST) problem, in which we want to find a span-ning tree T such that the maximum total distance fromany vertex to all sources is minimized, that is, we wantto minimize maxv∈V {∑s∈S dT (s, v )}, in which dT (s, v ) isthe length of the path between s and v on T . The otherproblem is the k -source maximum source shortest pathsspanning tree (k -MSST) problem, in which the objectivefunction is the maximum total distance from any sourceto all vertices, that is, maxs∈S {∑v∈V dT (s, v )}. In this arti-cle, we present a polynomial time approximation scheme(PTAS) for the 2-MVST problem. For the 2-MSST problem,we first give (2 + ε)-approximation algorithm for any ε > 0,and then present a PTAS for the case that the input graphsare restricted to metric graphs. Finally, we show that thereare simple 3-approximation algorithms for both problemswith arbitrary k . © 2006 Wiley Periodicals, Inc. NETWORKS,Vol. 47(3), 147–156 2006

Keywords: combinatorial optimization problem; spanningtree; approximation algorithm; polynomial time approximationscheme

Received July 2003; accepted November 2005Correspondence to: Y. H. Chen; e-mail: [email protected] 10.1002/net.20103Published online in Wiley InterScience (www.interscience.wiley.com).© 2006 Wiley Periodicals, Inc.

1. INTRODUCTION

Finding spanning trees of a given graph is an importantproblem in network design. Depending on the applications,problems are defined by different objectives. For example,a minimum spanning tree is the spanning tree of minimumtotal edge weight, and the objective function of the minimumrouting cost spanning tree (MRCT) [11] is the total distancesummed over all pairs of vertices.

Motivated by the applications of multicasting and broad-casting, several multisource spanning tree problems havebeen studied [2, 4, 7, 8, 12, 14]. In such problems, a net-work is modeled by an undirected graph with nonnegativeedge length function. Some vertices are destinations, whereassome of them are sources. The goal is to find a tree spanningall sources and destinations such that messages can be routedfrom sources to destinations along the tree edges. The lengthof an edge usually represents the cost of routing a messagevia the edge, and the cost from a source to a destination isthe distance between the two vertices, that is, the total lengthof the edges of the unique path between the two vertices inthe tree. With different considerations, the objective func-tions of the problems are defined differently but in general tominimize some distance related costs.

Let G = (V , E, w) be an undirected graph with non-negative edge length function w and S ⊂ V a set ofk specified sources. The k-source MRCT (k-MRCT), alsocalled as the k-source shortest paths spanning tree, is thespanning tree T minimizing

∑s∈S{

∑v∈V dT (s, v)}, where

dT (s, v) is the length of the path between s and v in T .If there is only one source, the problem can be solved byfinding the shortest paths tree, a spanning tree in which

NETWORKS—2006—DOI 10.1002/net

Page 2: Approximation algorithms for some k-source shortest paths spanning tree problems

the path between the source and each vertex is a shortestpath on the given graph. The shortest paths tree problemhas been well studied, and efficient algorithms were devel-oped (see [3] or other text books for algorithms). The mostefficient algorithms run in O(|E| + |V | log |V |) time ongraphs with nonnegative edge lengths. Recently, Thorup gavean O(|E|) time algorithm for graphs with positive integerlengths [9].

In the case of k > 1, the k-MRCT problem is a gen-eralization of the MRCT problem (also called the shortesttotal path length spanning tree problem, [ND3] in [5]), inwhich all vertices are sources. The MRCT problem is NP-hard [5, 6] and admits a polynomial time approximationscheme (PTAS) [11]. The k-MRCT problem for general k isobviously NP-hard because it includes the MRCT problem asa special case. The NP-hardness of the 2-MRCT problem wasshown independently in [4] and [12]. In the former article, a2-approximation algorithm was presented, and a PTAS wasproposed in the latter article. Recently, the k-MRCT problemfor any constant k was also shown to be NP-hard [13] anda 2-approximation algorithm can be found in the previouswork of the authors [10].

Although the k-MRCT problem is defined by a min-sum objective function, Connamacher and Proskurowski [2]posted two variants of the k-MRCT problem with bottle-neck objective functions. They are the k-source maximumvertex shortest paths spanning tree (k-MVST) problem andthe k-source maximum source shortest paths spanning tree(k-MSST) problem, in which the objective functions aremaxv∈V {∑s∈S dT (s, v)} and maxs∈S{∑v∈V dT (s, v)}, respec-tively. Both problems were shown to be NP-Complete in thestrong sense even for k = 2 [2]. A possible application ofthe two problems is in the following scenario. There are ksources in a network, and each source has messages to bebroadcasted. Because the distance from a source to a destina-tion represents the delay, or cost, of the message routing, theaverage service quality in the aspect of any customer (vertex)may be measured by the total distance from all sources to it.The k-MVST is the tree optimizing the worst average qual-ity. On the other hand, the average quality of a source may bemeasured by the total distance from it to all destinations, andthe k-MSST is the tree optimizing the worst average qualityof the sources.

In this article, we focus on the approximation algorithmsfor the two problems. For the 2-MVST problem, we presenta PTAS. For the 2-MSST problem, we show a (2 + ε)-approximation algorithm for the general graphs and a PTASfor metric graphs. A metric graph is a complete graph inwhich the edge lengths obey the triangle inequality. Finally,for any arbitrary k > 2, we give simple 3-approximationalgorithms for both problems. In Table 1, we list the objec-tive functions of the multi-source spanning tree problems andtheir best known ratios.

The rest of this article is organized as follows. In Section 2,some definitions and notations are given. In Section 3, wedescribe a PTAS for the 2-MVST. In section 4, we discussthe 2-MSST problem. In section 5, we focus on the k-MVST

TABLE 1. The multisource spanning tree problems and approximationratios.

Problem Objective function Ratio Reference

2-MRCT(2-SPST)∑

s∈{s1,s2}{∑

v∈V dT (s, v)} PTAS [12]

k-MRCT(k-SPST)∑

s∈S{∑v∈V dT (s, v)} 2 [10]

2-MVST maxv∈V {∑s∈{s1,s2} dT (s, v)} PTAS this paper

k-MVST maxv∈V {∑s∈S dT (s, v)} 3 this paper

2-MSST(generalgraphs)

maxs∈{s1,s2}{∑v∈V dT (s, v)} 2 + ε this paper

2-MSST(metricgraphs)

maxs∈{s1,s2}{∑v∈V dT (s, v)} PTAS this paper

k-MSST maxs∈S{∑v∈V dT (s, v)} 3 this paper

and k-MSST for arbitrary k. Finally, conclusion remarks aregiven in Section 6.

2. PRELIMINARIES

In this article, a graph is simple, connected, and undi-rected. By G = (V , E, w), we denote a graph G with vertexset V , edge set E and edge length function w. The edge lengthfunction is assumed to be nonnegative. For any graph G, V(G)

denotes its vertex set and E(G) denotes its edge set. For a sub-graph H of G, we define w(H) = w(E(H)) = ∑

e∈E(H) w(e).We shall also use n to denote |V(G)|.

Definition 1. For u, v ∈ V, SPG(u, v) denotes a shortestpath between u and v on G. The shortest path length is denotedby dG(u, v) = w(SPG(u, v)).

Definition 2. Let H be a subgraph of G. For a vertex v ∈V(G), we let dG(v, H) denote the shortest distance from v toH, that is, dG(v, H) = minu∈V(H){dG(v, u)}. The definitionalso includes the case that H is a subset of V.

Definition 3. Let T be a spanning tree of G. For v ∈ Vand a vertex set R ⊂ V, we use DT (v, R) to denote the totaldistance from vertex v to R, i.e., DT (v, R) = ∑

r∈R dT (v, r).

Definition 4. Let T be a tree and S ⊂ V(T) a set ofk sources. The maximum vertex shortest paths cost of T,denoted by CV (T), is the maximum total distance from anyvertex to all sources, that is, maxv∈V DT (v, S). Given agraph and a set of k sources, the maximum vertex shortestpaths spanning tree (k-MVST) problem is to find a spanningtree T with minimum CV (T) among all possible spanningtrees.

Definition 5. Let T be a tree and a set of k sources S ⊂V(T). The maximum source shortest paths cost of T, denotedby CS(T), is the maximum total distance from any source to allvertices, that is, maxs∈S DT (s, V). Given a graph and a set ofk sources, the maximum source shortest paths spanning tree(k-MSST) problem is to find a spanning tree T with minimumCS(T) among all possible spanning trees.

148 NETWORKS—2006—DOI 10.1002/net

Page 3: Approximation algorithms for some k-source shortest paths spanning tree problems

Let G be a graph and r ∈ V(G). A shortest paths treerooted at r is a spanning tree T of G such that dT (r, v) =dG(r, v) for each vertex v ∈ V . That is, on a shortest pathstree, the path from the root to any vertex is a shortest path in G.Let R ⊂ V . A forest F is a shortest paths forest with multi-ple roots R if dF(v, R) = dG(v, R) for any vertex v ∈ V , thatis, each vertex is connected to the closest root by a shortestpath. A shortest paths forest can be constructed by an algo-rithm similar to the shortest paths tree algorithm. The timecomplexity is the same as the shortest paths tree algorithm.

3. A PTAS FOR THE 2-MVST PROBLEM

In this section, we discuss the 2-MVST problem. Through-out this section, we assume that s1 and s2 are the two givensources. We first show a simple 2-approximation algorithmand then generalize it to a PTAS. The 2-approximation algo-rithm is the same as one designed in [12] for the 2-MRCT,and we show that it also works for the 2-MVST problem. Forthe completeness, we list the 2-approximation algorithm asfollows.

Algorithm Simple-2MVST. Input: A graph G = (V , E, w)

and s1, s2 ∈ V . Output: A spanning tree T of G.

1. Find a shortest path P between s1 and s2 on G.2. Find a shortest paths forest with multiple roots in V(P).3. Construct T as a union of the shortest paths forest and P.

The following property is useful for showing the performanceof the algorithm.

Lemma 1. Let T be any spanning tree of G = (V , E, w)

and P be the path between s1 and s2 on T. CV (T) = w(P) +2 maxv∈V {dT (v, P)}.

Proof. First, by definition, DT (v, S) = dT (v, s1)+dT (v,s2) = w(P) + 2dT (v, P) for any v ∈ V . Because CV (T) isthe maximum DT (v, S) over all vertices in V , the resultfollows. ■

Now we show the performance of the simple algorithm.

Lemma 2. The algorithm Simple-2MVST finds a 2-approximation solution of the 2-MVST in O(|V | log |V |+|E|)time.

Proof. First we show a lower bound of the optimal solu-tion. Let Y be the optimal tree of the 2-MVST problem. Forany vertex v ∈ V , we have

CV (Y) = maxu∈V

{dY (u, s1) + dY (u, s2)}≥ dG(v, s1) + dG(v, s2). (1)

Because dG(s1, s2) ≤ dG(v, s1) + dG(v, s2), we have

CV (Y) ≥ dG(s1, s2). (2)

By Equations (1) and (2), for any vertex v, we have

CV (Y) ≥ 12 (dG(s1, s2) + dG(v, s1) + dG(v, s2)).

Because P is a shortest path between the two sources andeach vertex is connected to P by a shortest path, for any vertexv ∈ V , we have

dT (v, P) ≤ min{dG(v, s1), dG(v, s2)}≤ 1

2 (dG(v, s1) + dG(v, s2))

and, hence,

2dT (v, P) + dT (s1, s2) ≤ (dG(v, s1) + dG(v, s2)) + dT (s1, s2)

= (dG(v, s1) + dG(v, s2)) + dG(s1, s2)

≤ 2CV (Y).

By Lemma 1, we have CV (T) ≤ 2CV (Y), and T is a 2-approximation solution of the 2-MVST. Note that the timecomplexity of Algorithm Simple-2MVST is dominated bythe one of constructing the shortest paths forest. ■

Now, we describe the PTAS and its performance analysis.By Lemma 1, it is easy to see that one can find the optimaltree if the path between the two sources is given. Similar to theprevious PTAS for the 2-MRCT, our PTAS tries to guess somevertices of the path. For each guess, it first constructs a tree Xspanning those guessed vertices, and then extends X to allother vertices by adding shortest paths to X. The performanceis ensured by showing that at least one of the constructed treesis a good approximation solution and the approximation ratioapproaches 1 as the number of guessed vertices increases.Although the algorithm is very similar to the previous one,the analysis of performance is different.

Let ρ ≥ 0 be an integer parameter to be determined later.In the remaining paragraphs of this section, let Y be the opti-mal tree of the 2-MVST. Also let P = (p1 = s1, p2, p3, . . . ,ph = s2) be the path between the two sources on Y .

Lemma 3. For any integer ρ ≥ 0, there exists a subset M ⊂V(P) such that |M| ≤ ρ and dY (v, M ∪ {s1, s2}) ≤ 1

ρ+2 w(P)

for any v ∈ V(P).

Proof. Let M = M ∪ {s1, s2}. We show the lemma byinduction. When ρ = 0, M = ∅. For any vertex v of P,

dY (v, M) = min{dY (v, s1), dY (v, s2)}≤ 1

2 (dY (v, s1) + dY (v, s2)) = 12 w(P).

Thus, the result holds for ρ = 0. Suppose that the resultholds for ρ = i. We shall show that it is also true forρ = i + 1. Then by induction, the result follows. Startingat s1, we travel along the path P and find the first ver-tex pj such that dY (s1, pj) ≥ w(P)

i+3 . Clearly, for any vertexbetween s1 and pj, the distance to s1 is less than w(P)

i+3 . Fur-thermore, we have dY (pj, s2) ≤ i+2

i+3 w(P). By the induction

NETWORKS—2006—DOI 10.1002/net 149

Page 4: Approximation algorithms for some k-source shortest paths spanning tree problems

hypothesis, there exists a set M1 of the vertices of the sub-path SPY (pj, s2) such that |M1| ≤ i and for any v in thesubpath,

dY (v, M1 ∪ {pj, s2}) ≤ 1

i + 2dY (pj, s2)

≤(

1

i + 2

) (i + 2

i + 3

)w(P) = 1

i + 3w(P).

Therefore, M = M1∪{pj} is a desired vertex set and the proofis completed. ■

The bound in the above lemma is tight. An extreme exam-ple is that the path has exactly ρ + 1 internal vertices andall the edges are of the same length. Because we can onlychoose ρ vertices, there is one vertex left and the distance toits neighbor is w(P)/(ρ + 2).

Let M be a vertex set satisfying the property in Lemma 3and M = M ∪ {s1, s2}.

Lemma 4. For any vertex v, dG(v, M) ≤ dY (v, P) + 1ρ+2

w(P).

Proof. For any v ∈ V , because Y is a subgraph of G,dG(v, M) ≤ dY (v, M). Recall that dY (v, M) is the minimumdistance from v to any vertex in M on Y . Therefore, thereexists some vertex pi of the path P such that the distancedY (v, M) is equal to the distance from v to pi plus the distancefrom pi to the closest vertex in M. Consequently, by Lemma 3we have

dY (v, M) = dY (v, pi) + dY (pi, M)

≤ dY (v, P) + 1

ρ + 2w(P). ■

By Lemma 4, we can design a good approximation algo-rithm for the 2-MVST if the input graph is a metric graph.A metric graph is a complete graph with edge lengths satisfy-ing the triangle inequality. In a metric graph, the edge betweenany pair of vertices is a shortest path. For a metric graph andan integer ρ, we try each possible path (s1, m1, m2, . . . , mi, s2)

for i ≤ ρ. There exists at least one such path whose inter-nal vertices are also on the path P of the optimal tree in thesame order and satisfy the property in Lemma 4. Becausethe graph is a metric graph, the length of the path is nomore than w(P). Connecting all other vertices to the pathby a shortest paths forest, we may have a spanning tree,and it is a (ρ + 4)/(ρ + 2)-approximation solution of the2-MVST (shown later). However, a problem is encounteredwhen the input is a general graph instead of a metric graph.For a guessed i-tuple (m1, m2, . . . , mi) of vertices, there isno obvious way to construct such a desired path. The dif-ficulty can be overcome by the following technique, whichwas developed for approximating the 2-MRCT. We only statethe result, and the proof should be referred to the originalarticle.

Lemma 5 [12]. Suppose that P is a path on a general graph.Let s1 and s2 be the two endpoints and m1, m2, . . . , mi be ivertices such that P connects the consecutive mj. Given thetwo endpoints of P and the i-tuple (m1, m2, . . . , mi), there isan O(in2) time algorithm, which constructs a tree X spanningthe given vertices and having the property that dX(v, s1) +dX(v, s2) ≤ w(P) for any v ∈ V(X).

We list the PTAS below.

Algorithm PTAS-2-MVST. Input: A graph G = (V , E, w)

and s1, s2 ∈ V , and an integer ρ ≥ 0. Output: A spanningtree T of G.

1. For each i ≤ ρ and i-tuple (m1, m2, . . . , mi) of verticesdo1.1. Find a tree X as in Lemma 5.1.2. Find the shortest paths forest spanning V(G) with

all vertices in V(X) as roots.1.3. Let T be the union of the forest and X.

end for2. Output the tree T with minimum CV (T) among all

constructed trees.

The performance of the PTAS is shown in the next lemma.

Lemma 6. The algorithm returns a spanning tree T with

CV (T) ≤(

1 + 2

ρ + 2

)CV (Y).

Proof. Because the algorithm tries all possible i-tuple ofvertices for all i ≤ ρ, it is sufficient to show the approximationratio for the i-tuple satisfying the property in Lemma 4. LetM be the set of vertices in the i-tuple and M = M ∪ {s1, s2}.As in Lemma 5, let X be a tree spanning M and dX(v, s1) +dX(v, s2) ≤ w(P) for any v ∈ V(X).

For each vertex v, because it is connected to X by a shortestpath, there exists a vertex x ∈ V(X) such that dT (v, s1) =dG(v, x) + dT (x, s1) and dT (v, s2) = dG(v, x) + dT (x, s2).Therefore,

DT (v, S) = 2dG(v, X) + dT (x, s1) + dT (x, s2).

By Lemma 5, we have

DT (v, S) ≤ 2dG(v, X) + w(P).

Because M ⊂ V(X), dG(v, X) ≤ dG(v, M), and then byLemma 4 we have

dG(v, X) ≤ dY (v, P) + 1

ρ + 2w(P).

Consequently, we have, for any vertex v,

DT (v, S) ≤ 2dY (v, P) + 2

ρ + 2w(P) + w(P)

= DY (v, S) + 2

ρ + 2w(P)

≤(

1 + 2

ρ + 2

)DY (v, S),

150 NETWORKS—2006—DOI 10.1002/net

Page 5: Approximation algorithms for some k-source shortest paths spanning tree problems

because w(P) ≤ DY (v, S). Then, by definition,

CV (T) = maxv∈V

{DT (v, S)}

≤ maxv∈V

{(1 + 2

ρ + 2

)DY (v, S)

}

=(

1 + 2

ρ + 2

)CV (Y). ■

The result of this section is summarized in the followingtheorem.

Theorem 7. The 2-MVST problem admits a PTAS. For anyconstant ε > 0, a (1 + ε)-approximation algorithm of the2-MVST of a graph G can be found in O(n� 2

ε�) time.

Proof. For any fixed ρ, the number of possible i-tupleswith i ≤ ρ is O(nρ). Thus, the time complexity of the algo-rithm is O(nρ+2), because it takes O(n2) time to constructthe tree X and to build the shortest paths forest. By Lemma 6,the algorithm returns a (1 + 2

ρ+2 )-approximation solution.For any desired ratio (1 + ε), 0 < ε ≤ 1, an approximationsolution can be obtained by the algorithm with ρ = � 2

ε� − 2,

and the time complexity is O(n� 2ε�), which is polynomial for

fixed ε. ■

4. THE 2-MSST PROBLEM

In this section, we discuss the 2-MSST problem, in whichthe objective function is CS(T) = maxs∈S{∑v∈V dT (s, v)}.Throughout this section, we assume that s1 and s2 are the twogiven sources. First, we shall consider the case that the inputis a general graph and give a (2+ε)-approximation algorithmfor any fixed ε > 0. Then we show that the problem admitsa PTAS if the input is restricted to a metric graph.

4.1. On General Graphs

First we present a (2 + ε)-approximation algorithm ongeneral graphs. The algorithm is basically the same as algo-rithm PTAS-2-MVST except that, among all the constructedtrees, it returns the tree T with minimum CS(T) instead ofCV (T). The main idea is similar to the PTAS for the 2-MVST,but we need a different analysis of the performance.

Lemma 8. Let T be a spanning tree of G = (V , E, w) andP be the path between s1 and s2 on T. CS(T) ≥ n

2 w(P) +∑v∈V dT (v, P).

Proof. For any s ∈ S, DT (s, V) = ∑v∈V {dT (v, P) +

w(SPT (v, s)∩ P)}, where SPT (v, s) is the path between v ands in T . Hence,

CS(T) = max{DT (s1, V), DT (s2, V)}≥ 1

2{DT (s1, V) + DT (s2, V)}

≥ n

2w(P) +

∑v∈V

dT (v, P). ■

FIG. 1. The definitions of the partition of the vertices.

In the remaining paragraphs of this section, we shall usethe following notations. Let Y be the optimal tree of the 2-MSST. Also let P = (p1 = s1, p2, p3, . . . , ph = s2) be thepath between s1 and s2 on Y . Now we introduce a partitionof the vertices that appeared in the previous work [12] for the2-MRCT problem (Fig. 1).

Define Vi, 1 ≤ i ≤ h, as the set of the vertices connected toP at pi and also let pi ∈ Vi. Let ρ ≥ 0 be an integer parameterto be determined later. For 0 ≤ i ≤ ρ + 1, define mi = pj inwhich j is the minimal index such that

∑1≤q≤j

|Vq| ≥⌈

in

ρ + 1

⌉.

By definition, s1 = m0 and s2 = mρ+1. For 0 ≤ i ≤ ρ, letUi = ⋃

a<j<b Vj and Pi be the path from pa and pb, in whichpa = mi and pb = mi+1. Also, let U = V \ ⋃

0≤i≤ρ Ui

and M = {mi : 0 ≤ i ≤ ρ + 1}. Note that the abovedefinitions include the case mi = mi+1. In such a case, Pi

contains only one vertex and Ui is empty. By the above def-initions, the vertex set V is partitioned into U, U0, U1, . . . ,Uρ satisfying the following properties. The next lemmacomes from [12]. We state the result but the proof isomitted.

Lemma 9.∑

v∈U dG(v, M) ≤ ∑v∈U dY (v, P) and for any

0 ≤ i ≤ ρ,∑

v∈UidG(v, M) ≤ ∑

v∈UidY (v, P)+ n

2(ρ+1)w(Pi).

Our algorithm tries to correctly guess m1, m2, . . . mρ , andconstructs a tree X spanning these vertices with the prop-erty that dX(v, s1) + dX(v, s2) ≤ w(P) for any v ∈ V(X).Once such a tree X has been constructed, we extend it to aspanning tree T by adding the shortest paths forest with ver-tices in V(X) as the multiple roots. In the next lemma, weshow that T is a (2 + 1

ρ+1 )-approximation solution of the2-MSST.

Lemma 10. Let X be a tree spanning M and dX(v, s1) +dX(v, s2) ≤ w(P) for any v ∈ V(X). The spanning tree T,which is the union of X and the shortest paths forest withvertices in V(X) as the multiple roots, is a (2 + 1

ρ+1 )-approximation solution of the 2-MSST problem.

Proof. By definition, the vertices m1, m2, . . . , mρ parti-tion the vertex set V into (U, U0, U1, . . . , Uρ) and the subsets

NETWORKS—2006—DOI 10.1002/net 151

Page 6: Approximation algorithms for some k-source shortest paths spanning tree problems

satisfy the properties in Lemma 9. Because dX(v, s1) +dX(v, s2) ≤ w(P) for any v ∈ V(X), we have

CS(T) = maxs∈S

{∑v∈V

dT (v, s)

}

≤∑v∈V

dT (v, X) + n w(P)

≤∑v∈U

dT (v, X) +∑

0≤i≤ρ

∑v∈Ui

dT (v, X) + n w(P). (3)

For v ∈ U, because dT (v, X) = dG(v, X) ≤ dG(v, M) and byLemma 9, we have

∑v∈U

dT (v, X) ≤∑v∈U

dG(v, M) ≤∑v∈U

dY (v, P). (4)

Similarly, dT (v, X) ≤ dG(v, M) for v ∈ Ui, and then byLemma 9, we have∑0≤i≤ρ

∑v∈Ui

dT (v, X)

≤∑

0≤i≤ρ

v∈Ui

dY (v, P) + n

2(ρ + 1)w(Pi)

≤∑

0≤i≤ρ

∑v∈Ui

dY (v, P) + n

2(ρ + 1)w(P). (5)

By Equations (3)–(5) and Lemma 8,

CS(T) ≤∑v∈U

dY (v, P) +∑

0≤i≤ρ

∑v∈Ui

dY (v, P)

+ n

2(ρ + 1)w(P) + n w(P)

=∑v∈V

dY (v, P) + 2ρ + 3

2(ρ + 1)n w(P)

=(∑

v∈V

dY (v, P) + n

2w(P)

)+ ρ + 2

2(ρ + 1)n w(P)

≤ CS(Y) +(

ρ + 2

ρ + 1

)CS(Y) =

(2 + 1

ρ + 1

)CS(Y),

because CS(Y) ≥ n2 w(P). ■

Theorem 11. For any constant ε > 0, there is an algorithmfinding a (2 + ε)-approximation solution of the 2-MSST of ageneral graph in O(n� 1

ε+1�) time.

Proof. By Lemma 10, we can find a (2 + 1ρ+1 )-

approximation solution of the 2-MSST of a general graphfor any integer ρ ≥ 0. As shown in Theorem 7, the timecomplexity is O(nρ+2). For any ε > 0, we set ρ = � 1

ε� − 1,

and the result follows. ■

4.2. On Metric Graphs

Although the 2-MVST problem and the 2-MSST problemseem very similar, they are actually different. In the 2-MVSTproblem, by Lemma 1, if the path between the two sourcesis given, the optimal tree can be easily obtained by connect-ing all other vertices to their closest vertices on the path.However, it does not hold for the 2-MSST problem. Thereis no obvious way to find an optimal tree even if the path isgiven. For this reason, the 2-MSST seems more difficult to beapproximated than the 2-MVST. In the last section, we showhow to approximate the 2-MSST on general graphs withinapproximation ratio 2 + ε. We shall show that the 2-MSSTadmits a PTAS if the input graph is restricted to a metricgraph. The key point is that we employ an algorithm to findhow to connect the other vertices to the path so as to mini-mize the cost. The algorithm runs in polynomial time if thenumber of vertices of the path is constant.

The main idea of the PTAS is similar to the algorithmfor the problem on general graphs. The definitions of Y , P,Pi, Vi, M, U, U0, U1, . . . , Uρ are also the same as in theprevious section. To show the performance, we first constructa spanning tree Y from the optimal tree Y as follows. Notethat the tree Y does not appear in the PTAS. It is used to showthe performance of our PTAS.

• Let P be the path (s1 = m0, m1, m2, . . . , mρ+1 = s2). Becausethe graph is a metric graph, the path exists.

• For each v ∈ Vj ⊂ U (pj ∈ M), v is connected to pj , that is,edge (v, pj) ∈ E(Y).

• For each v ∈ Ui, v is connected to either mi or mi+1 dependedon which is closer to v on Y , that is, edge (mi, v) ∈ E(Y)

if dY (v, mi) ≤ dY (v, mi+1), and (mi+1, v) ∈ E(Y) otherwise.Note that the decision is made by the distances on Y but noton the original graph.

We shall show that Y is a (ρ+3ρ+1 )-approximation solution

of the 2-MSST.

Lemma 12. For s ∈ {s1, s2} and 0 ≤ i ≤ ρ,

DY (s, Ui) ≤ DY (s, Ui) + n

(ρ + 1)w(Pi).

Proof. We show the result for s1. The case of s2 canbe shown similarly. First, because the graph is a metricgraph, dY (s1, m) ≤ dY (s1, m) for any m ∈ M. For eachv ∈ Vj ⊂ Ui, v is connected to either mi or mi+1. When v isconnected to mi, it is clear that dY (v, s1) ≤ dY (v, s1), becausethe path in Y is just replaced with consecutive short-cutedges. Now we consider the case that v is connected to mi+1.It only happens when dY (v, mi+1) < dY (v, mi). BecausedY (v, mi) = dY (v, pj) + dY (pj, mi) and dY (v, mi+1) =dY (v, pj)+dY (pj, mi+1), the condition implies dY (pj, mi+1) <

dY (pj, mi) or equivalently dY (pj, mi+1) < w(Pi)/2. We have

dY (v, s1) = dY (s1, mi+1) + w(mi+1, v)

≤ ((dY (s1, pj) + dY (pj, mi+1)) + (dY (v, pj) + dY (pj, mi+1))

= dY (v, s1) + 2dY (pj, mi+1) ≤ dY (v, s1) + w(Pi).

152 NETWORKS—2006—DOI 10.1002/net

Page 7: Approximation algorithms for some k-source shortest paths spanning tree problems

Consequently, dY (v, s1) ≤ dY (v, s1) + w(Pi) in both cases.Because |Ui| ≤ n

ρ+1 , we have

DY (s1, Ui) ≤∑v∈Ui

(dY (v, s1) + w(Pi))

≤∑v∈Ui

dY (v, s1) + n

(ρ + 1)w(Pi)

= DY (s1, Ui) + n

(ρ + 1)w(Pi). ■

Now we show the approximation ratio of Y .

Lemma 13. The spanning tree Y is a (ρ+3ρ+1 )-approximation

solution of Y.

Proof. For any vertex v ∈ Vj ⊂ U, it is connected to pj ∈M in Y , and dY (v, s1) ≤ dY (v, s1) obviously. By Lemma 12,

DY (s1, V) = DY (s1, U) +∑

0≤i≤ρ

DY (s1, Ui)

≤ DY (s1, U) +∑

0≤i≤ρ

(DY (s1, Ui) + n

(ρ + 1)w(Pi)

)

≤ DY (s1, V) + n

(ρ + 1)w(P).

Similarly,

DY (s2, V) ≤ DY (s2, V) + n

(ρ + 1)w(P).

By definition, we have

CS(Y) = max{DY (s1, V), DY (s2, V)}≤ max{DY (s1, V), DY (s2, V)} + n

(ρ + 1)w(P)

= CS(Y) + n

(ρ + 1)w(P) ≤

(1 + 2

ρ + 1

)CS(Y),

because CS(Y) ≥ n2 w(P) by Lemma 8. ■

We have transformed a 2-MSST Y into a tree Y , and haveshown that Y is a good approximation of Y . Because the inputis a metric graph, we may assume that the vertices of P are theonly possible internal vertices of Y , that is, Y is a caterpillar.As a result, the tree Y belongs to a special kind of spanningtree in which there are only (ρ + 2), or less, internal verticesand the internal vertices form a path with the two sources asthe endpoints. Our PTAS for the 2-MSST is designed to findthe best spanning tree of the kind.

Definition 6. A spanning tree T is a λ-caterpillar ifSPT (s1, s2) is a (λ+1)-edges path and all the internal verticesare on the path.

By the definition and Lemma 13, we have the nextcorollary.

Corollary 14. For a metric graph and any integer ρ ≥0, there exists a λ-caterpillar, λ ≤ ρ, which is a (

ρ+3ρ+1 )-

approximation solution of the 2-MSST.

Our PTAS finds the λ-caterpillar with minimum maximumsource shortest paths cost for each λ ≤ ρ and returns thebest of them. By Corollary 14, it is a (

ρ+3ρ+1 )-approximation

solution. Now we show how to find the best λ-caterpillar ofa metric graph for a fixed λ. The idea is from [11], whichis used to find the minimum routing cost spanning tree withconstant number of internal vertices.

A λ-caterpillar can be described by a (λ + 1)-edgespath Q = (s1 = q0, q1, . . . , qλ+1 = s2) and a partitionL = (L0, L1, . . . , Lλ+1) of V , in which V = V \ V(Q) andLi is the set of vertices in V and adjacent to qi. We denotea λ-caterpillar by (Q, L). Let l = (l0, l1, . . . , lλ+1) be a non-negative (λ + 2)-vector such that

∑λ+1i=0 li = n − λ − 2. We

say that a λ-caterpillar (Q, L) has the configuration (Q, l) ifli = |Li| for all 0 ≤ i ≤ λ + 1. We define α(Q, l) to be the λ-caterpillar of minimum maximum source shortest paths costwith a configuration (Q, l). We shall show that α(Q, l) can befound in polynomial time.

Lemma 15. For a given configuration (Q, l), the optimalλ-caterpillar α(Q, l) can be found in O(n3) time.

Proof. Let T = (Q, L) be a λ-caterpillar with configu-ration (Q, l). For each i, we have

DT (s1, Li) =∑v∈Li

dT (s1, v) = li dT (s1, qi) +∑v∈Li

w(v, qi).

Summing over all i,

λ+1∑i=0

DT (s1, Li) =λ+1∑i=0

li dT (s1, qi) +λ+1∑i=0

∑v∈Li

w(v, qi).

Therefore,

DT (s1, V) = DT (s1, V(Q)) +λ+1∑i=0

DT (s1, Li)

= DT (s1, V(Q)) +λ+1∑i=0

li dT (s1, qi) +λ+1∑i=0

∑v∈Li

w(v, qi).

Similarly,

DT (s2, V) = DT (s2, V(Q))

+λ+1∑i=0

li dT (s2, qi) +λ+1∑i=0

∑v∈Li

w(v, qi).

Define

f1(Q, l) = DT (s1, V(Q)) +λ+1∑i=0

li dT (s1, qi)

NETWORKS—2006—DOI 10.1002/net 153

Page 8: Approximation algorithms for some k-source shortest paths spanning tree problems

and

f2(Q, l) = DT (s2, V(Q)) +λ+1∑i=0

li dT (s2, qi).

Note that the two functions depend only on Q and l. Dif-ferent trees with the same configuration have the same valuesof the two functions.

Therefore, we have

CS(T) = max{DT (s1, V), DT (s2, V)}

= max

f1(Q, l) +

λ+1∑i=0

∑v∈Li

w(v, qi), f2(Q, l)

+λ+1∑i=0

∑v∈Li

w(v, qi)

= max{f1(Q, l), f2(Q, l)} +λ+1∑i=0

∑v∈Li

w(v, qi).

For a specified configuration (Q, l), the cost depends onlyon the second term. As a result, α(Q, l) can be constructedby finding a minimum-cost way of matching up the verticesof V to those in V(Q), which obeys the degree constraintsimposed by l. It is equivalent to find the minimum-cost perfectmatching on the auxiliary complete bipartite graph H withvertex set Q∪ V in which Q contains li copies of qi for each i.Because the bipartite perfect matching problem, also calledthe assignment problem, can be solved in O(n3) time [1],α(Q, l) can be solved with the same time complexity for agiven configuration. ■

For a (λ + 1)-edges path Q, we may find the best λ-caterpillar by trying every possible nonnegative (λ+2)-vectorl. Because there are O(nλ+1) such vectors and each vec-tor corresponds to one instance of the assignment problem,it takes O(nλ+4) time if we solve the assignment problemsindividually. As in [11], by carefully ordering the assignmentproblems for the vectors and exploiting the common struc-ture of two consecutive problems, we can obtain the optimalsolution of every vector in this order by performing a singleaugmentation on the optimal solution of the previous vector.By this method, the optimal solution for each vector can befound in O(λn) time from the solution for its predecessor. Westate the result in the next lemma.

Lemma 16. For any constant λ ≥ 0, the λ-caterpillar ofminimized maximum source shortest paths cost can be foundin O(n2λ+2).

Proof. There are O(nλ)possible (λ+1)-edges paths withendpoints s1 and s2. For each such path, there are O(nλ+1)

assignment problems to be solved. By the above discussion,each of them can be solved in O(n) time. Therefore, the totaltime complexity is O(n2λ+2). ■

In summary, we show the 2-MSST problem on a metricgraph admits a PTAS.

Theorem 17. There exists a PTAS for the 2-MSST prob-lem on a metric graph, which finds a (1+ε)-approximationsolution in O(n�4/ε�) time.

Proof. By Corollary 14, for any integer ρ ≥ 0, thereexists a λ-caterpillar, λ ≤ ρ, which is a (

ρ+3ρ+1 )-approximation

solution of the 2-MSST. We find an optimal caterpillar foreach λ ≤ ρ and choose the best. The obtained solutionis a (

ρ+3ρ+1 )-approximation of the 2-MSST. The total time

complexity is ∑0≤λ≤ρ

O(n2λ+2) = O(n2ρ+2).

For any ε > 0, taking ρ = �2/ε� − 1, we can obtain a(1 + ε)-approximation algorithm in O(n�4/ε�) time. ■

5. THE k -MVST AND THE k -MSST FORARBITRARY k

In this section, we discuss the k-MVST and the k-MSSTproblems for arbitrary k > 2. We show that both problemscan be approximated with ratio 3 by a shortest paths tree.First, we show the result for the k-MVST problem.

Theorem 18. Any shortest paths tree rooted at any vertexis a 3-approximation solution of the k-MVST, and the boundis tight.

Proof. Let Y be the optimal tree of the k-MVST, we have

CV (Y) = maxv∈V

{DY (v, S)} ≥ maxv∈V

{DG(v, S)}.

That is, CV (Y) ≥ DG(v, S) for any vertex v. Let T be anyshortest paths tree rooted at an arbitrary vertex r.

CV (T) = maxv∈V

{∑s∈S

dT (v, s)

}

≤ maxv∈V

{∑s∈S

(dT (v, r) + dT (r, s))

}

≤ maxv∈V

{∑s∈S

((dG(v, s) + dG(r, s)) + dG(r, s))

}

= maxv∈V

{DG(v, S)} + 2DG(r, S)

≤ 3CV (Y).

To show the tightness of the bound, consider the instanceshown in Figure 2a, in which s0 and s1 are sources, and ε1 >

ε2 are two small positive numbers. Frame (b) is a shortestpaths tree rooted at s1, in which vb has the maximum totaldistance to the sources, and the cost is 6 + 2ε2. Frame (c)is the optimal tree, in which all five vertices have the same

154 NETWORKS—2006—DOI 10.1002/net

Page 9: Approximation algorithms for some k-source shortest paths spanning tree problems

cost 2 + ε1 + ε2. The approximation ratio approaches to 3when ε1 → 0. ■

Corollary 19. Given a general graph and a set of sources,a 3-approximation solution of the k-MVST can be found inO(|E| + |V | log |V |) time.

Similarly, we have the next result for the k-MSST problem.

Theorem 20. Any shortest paths tree rooted at any sourceis a 3-approximation solution of the k-MSST, and the boundis tight.

Proof. Let Y be the optimal tree of the k-MSST, we have

CS(Y) = maxs∈S

{DY (s, V)} ≥ maxs∈S

{DG(s, V)}.

That is, CS(Y) ≥ DG(s, V) for any source s. Let T be anyshortest paths tree rooted at an arbitrary source r.

CS(T) = maxs∈S

{∑v∈V

dT (s, v)

}

≤ maxs∈S

{∑v∈V

(dT (s, r) + dT (r, v))

}

≤ maxs∈S

{∑v∈V

((dG(s, v) + dG(v, r)) + dG(r, v))

}

= maxs∈S

{DG(s, V)} + 2DG(r, V)

≤ 3CS(Y),

because r ∈ S.To show the tightness of the bound, consider the follow-

ing instance shown in Figure 3a, in which s0 and s1 are twosources, and {uj, vj|1 ≤ j ≤ i} is the set of nonsource ver-tices. The edge lengths are set as follows. For 1 ≤ j ≤ i,w(s0, vj) = w(s1, uj) = 1, w(s0, uj) = w(s1, vj) = ε, andw(s0, s1) = 1. Frame (b) is the shortest paths tree rootedat s1, in which the total distance from s0 to all vertices is3i + 1 + iε. Frame (c) is the optimal tree, in which the totaldistance from each of the sources to all vertices is i+1+2iε.The approximation ratio approaches to 3 when i → ∞ andε → 0. ■

FIG. 2. An extreme instance for Theorem 18. (a) The graph G = (V , E);(b) a shortest paths tree rooted at s1; (c) the optimal tree.

FIG. 3. An extreme instance for Theorem 20. (a) The graph G = (V , E);(b) a shortest paths tree rooted at s1; (c) the optimal tree.

Corollary 21. Given a general graph and a set of sources,a 3-approximation solution of the k-MSST can be found inO(|E| + |V | log |V |) time.

6. CONCLUSION

In this article, we investigate the k-MVST and the k-MSSTproblems and propose approximation algorithms. Althoughthe 2-MVST problem has been shown to admit a PTAS, the 2-MSST seems more difficult to approximate. We show a PTASfor the 2-MSST only for metric graphs. For general graphs,we only have a (2 + ε)-approximation algorithm. Improvedapproximation algorithms will be interesting. Another openproblem left in the article is the approximabilities of the twoproblems with more than two sources. The approximationalgorithms in this article are very simple and better resultsare expected.

Acknowledgment

We thank the anonymous referees for their careful readingand many useful comments.

REFERENCES

[1] R.K. Ahuja, T.L. Magnanti, and J.B. Orlin, Network Flows—Theory, Algorithms, and Applications, Prentice–Hall, Engle-wood Cliffs, NJ, 1993.

[2] H.S. Connamacher and A. Proskurowski, The complexity ofminimizing certain cost metrics for k-source spanning trees,Discrete Appl Math 131 (2003), 113–127.

[3] T.H. Cormen, C.E. Leiserson, R.L. Rivest, and C. Stein, Intro-duction to Algorithms, 2nd ed., MIT Press, Cambridge, MA,2001.

[4] A.M. Farley, P. Fragopoulou, D.W. Krumme, A.Proskurowski, and D. Richards, Multi-source spanningtree problems, J Interconnect Networks 1 (2000), 61–71.

[5] M.R. Garey and D.S. Johnson, Computers and intractability:A guide to the theory of NP-completeness, W.H. Freemanand Company, San Francisco, CA, 1979.

[6] D.S. Johnson, J.K. Lenstra, and A.H.G. Rinnooy Kan, Thecomplexity of the network design problem, Networks 8(1978), 279–285.

[7] D.W. Krumme and P. Fragopoulou, Minimum eccentricitymulticast trees, Discrete Math Theoret Comput Sci 4 (2001),157–172.

[8] H.B. McMahan and A. Proskurowski, Multi-source span-ning trees: Algorithms for minimizing source eccentricities,Discrete Appl Math 137 (2004), 213–222.

NETWORKS—2006—DOI 10.1002/net 155

Page 10: Approximation algorithms for some k-source shortest paths spanning tree problems

[9] M.Thorup, Undirected single source shortest paths with posi-tive integer weights in linear time, J ACM 46 (1999), 362–394.

[10] B.Y. Wu, K.M. Chao, and C.Y. Tang, Approximation algo-rithms for some optimum communication spanning treeproblems, Discrete Appl Math 102 (2000), 245–266.

[11] B.Y. Wu, G. Lancia, V. Bafna, K.M. Chao, R. Ravi, and C.Y.Tang, A polynomial time approximation scheme for mini-mum routing cost spanning trees, SIAM J Comput 29 (2000),761–778.

[12] B.Y. Wu, A polynomial time approximation scheme for thetwo-source minimum routing cost spanning trees, J Algo-rithms 44 (2002), 359–378.

[13] B.Y. Wu, Approximation algorithms for the optimal p-source communication spanning tree, Discrete Appl Math143 (2004), 31–42.

[14] B.Y. Wu, An improved algorithm for the k-source maximumeccentricity spanning trees, Discrete Appl Math 143 (2004),342–350.

156 NETWORKS—2006—DOI 10.1002/net