A faster approximation algorithm for the Steiner tree problem in graphs *

Report 4 Downloads 226 Views
17 May 1993

Information Processing Letters 46 (1993) 79-83 Elsevier

A faster approximation algorithm for the Steiner tree problem in graphs * Alexander Z. Zelikovsky Institute of Mathematics, Academy of Sciences, Akademiei 5, Kishinev 277028, Moldova

Communicated by T. Lengauer Received 16 November 1992 Revised 24 February 1993

Zelikovsky, A.Z., A faster approximation algorithm for the Steiner tree problem in graphs, Information Processing Letters 46 (1993) 79-83. The Steiner tree problem requires a shortest tree spanning a given vertex subset S within graph G = @‘, El. Two heuristics finding approximate Steiner trees no longer than 11/6 times of the optima1 length appeared recently. They run in time O(CY+ KS2 + S4) and O(a + l@ + S3s), respectively, where LYis the time complexity of the all-pairs-shortest-paths problem. We reduce the runtime of the first heuristic to O(S(E + VS + V log k’)). Keywords: Combinatorial problems; approximation algorithms; Steiner tree

Let G = W, E, d) be a graph with a vertex set V, an edge set E and distance function d : E + R+. A tree T is a Steiner tree of S, S c V, if S is contained in the vertex set of T. Steiner Tree Problem WIT). Given G and S, find the shortest Steiner tree (also called the Steiner minimal tree) of S. It is known that the Steiner tree problem is NP-hard [6]. Therefore, algorithms which in polynomial time construct an approximate Steiner Correspondence

to: Dr. A.Z. Zelikovsky, Institute of Mathematics, Academy of Sciences, Akademiei 5, Kishinev 277028, Moldova. * Parts of this work have been done at Max-Planck-Institut tir Informatik, Saarbriicken.

Elsevier Science Publishers B.V.

minimal tree are investigated. The quality of an approximation is measured by its performance ratio: an upper bound on the ratio between achieved length and the optimal length. A well-known heuristic (an MST-heuristic) for the Steiner tree problem approximates a Steiner minimal tree with a minimum length spanning tree (MST) of a complete graph G,. It was proved that the performance ratio of this heuristic comes arbitrary close to 2 [8]. The fastest known implementation of the MST-heuristic has a running time O(E + I/ log I’) [7] (we use E, V, S and (Y to denote #E, #V, #S and the time complexity of the all-pairs-shortest-paths problem, respectively, in the order of a running time of an algorithm). Two better heuristics appeared recently [2,10] while considering k-restricted Steiner trees. First we introduce some notations: SMT(S) and smt(S) are a Steiner minimal tree of S and 79

Volume 46, Number 2

INFORMATION

PROCESSING

its length, respectively. For a complete graph G,, M(G,) denotes the MST of G,, and m(G,) denotes its length. SMT(S) may in general contain vertices of V\S. So SMT(S) contains the set S of given vertices and some additional vertices. SMT(S) is called a full Steiner tree if S coincides with the set of leaves of SMT(S). If SMT(S) is not full, then we can split it into the union of edge-disjoint full Steiner subtrees. SMT(S) is called k-restricted if every full component has at most k given vertices. Let the shortest k-restricted Steiner tree for the set S, denoted by SMT,(S), have the length smtJD.9 Note, that SMT,(S) = MCG,).

Let rk = sup{smt,(S)/smt(S)). The bound for the MST-heuristic implies r2 = 2 [S]. It was proved [l]. that r3 = 5/3 [9,10], r4 < 3/2 and r, ind(b, c), otherwise i = ind(a, b) = ind(b, c) > ind(c, a). q

A sequence of triples chosen by the greedy heuristic is called greedy in G,. It was proved in [lo] that the set of elements of a greedy sequence of triples H and an arbitrary set of triples 2

Corollary 2.6 [lo].

2win,(H)

&win,(Z).

= max save,(e) ecS + min save,(e) ec.7

(2.2)

Inequalities (2.1) and (2.2) imply the following: Theorem 2.4. A performance heuristic is at most 11/6.

win,(z)

ratio of the greedy

An implementation of the greedy heuristic given in [lo] generates stars for all triples of given vertices in time O(a + I’S’). The same procedure is necessary for the evaluation heuristic. This generation needs the shortest path distances between given vertices and additional vertices. Therefore, we can decrease its running time to OWE + I/s + V log V)) using an O(E + V log V&algorithm [4] for every given vertex s E S to find all shortest paths from s to other vertices of V. Now we describe computing of the function win,. For a pair e = (a, b) of given vertices define save,(e) = d(T) - d(T[e]). Let List(T) = It i, . . . , t,) be an nondecreasing order of edges of T. Then save,(e) is the length of the last edge of List, say ti, in the unique cycle of T U e. The index i of ti is denoted by ind,(e), i.e. save,(e) 1. Note that T[e] = e U T\ti and List ;T$X, t, )...) ti_l, ti+l )...) t ) Further, Z denotes the set “0; three edges {(a, b), (b, c), Cc, a)), for a triple z = {a, b, c). Lemma 2.5. For any triple z = (a, b, c), Z contains a unique edge with the minimum index and two other edge indices equal to each other. Proof. Let Pab, Pbc, PC, be simple paths in the tree T between a and b, b and c, c and a,

respectively. One of these three paths is the symmetric subtraction of the two others. Let PC, =

-d(z).

This corollary implies that it is sufficient to compute the function save=. At first we construct a binary tree T’ which corresponds to T according to List in the following way. Inner vertices of T’ correspond to edges of T, its leaves correspond to the vertices of T. A root of T’ is 1,. Let ACti) denote the set of ancestors of ti in T’, then two sons of ti in T’ are the longest edges in two new components of T\(ti UA(ti)) which appear after deletion of ti from T\A(tJ If such component coincides with a vertex of T, then the son corresponds to a leave of T’. Now, using preprocess(T ‘) (preprocessing of time O(S)) we can find in time O(1) the nearest common ancestor of any pair e of given vertices [51 in the tree T’ which corresponds to the edge of T with the length saver.(e). Thus, to fulfill the step (1Xa) of Algorithm 2.3 we need time 0(S3), therefore, step (1) demands time 0(S4) and a running time of the whole algorithm is O(S(E

+ V&s+ V log V+ S’)).

3. A faster implementation The following algorithm finds a best star with the center u for every vertex and then chooses the best one among starts. Therefore, it omits the generation

possible u E V\S all such phase.

Algorithm 3.1. (0) find all shortest paths from S to c find T = M(G,); W+ @; 81

Volume

46, Number

2

INFORMATION

PROCESSING

(11 repeat forever (a) find List(T), T’; preprocess(T’); (b) for all u E V\S do sa + arg min, E &(u, s); si +- arg max,,, [saveT(so, s) - d(u, ~11; s2 + arg max, ,,win,(u; sO, si, s); (4 2 + arg max,,,,,win,(u; so, sl, s,); (d) if win,(z) I 0 then exit repeat; (e) T + T \ (e,,

e2) U {(so,

s,>, (so,

s2)),

where &so, si) + &so, s2) + 0 and

U

W in graph G

Lemma 3.2. The output Steiner tree T2 of Algorithm 3.1 coincides with the output Steiner tree T, of Algorithm 2.3. Proof. It is necessary to prove that a star produced by steps (l)(b) and (1%~) has a maximum win. Let

z’= (u; a, b, c) = arga~~~swin,(~; , ,

a, b, c).

Let i and j be the largest and the smallest indices of Z’. Then

-d(v,

-d(v,

+d(t,)

-d(v,

-d(v,

sl) -d(u,

so) b).

This value is at least d(tj) -d(v,

c) +d(ti)

-d(v,

so) -d(v,

b)

d(t,) - d(u, sl) a d(ti) - d(u, c) > d(tj) -

b) -d(u,

Theorem 3.3. Algotithm 3.1 finds an y-upproximution of a minimal Steiner tree in time OWE + I/s + V log V)). Proof. Lemma 3.2 implies that it is sufficient

to estimate the running time of Algorithm 3.1. The steps (0) and (2) have been considered already above: they can be implemented in time O(S(E + I/ log V)) [7]. The updating time for the step (1) is O(S) for “preprocess” and constant for substitution of edges in the current tree T. The most complicated step is (l)(a), which takes time O(VS) per iteration. Thus, the whole running time of Algorithm 3.1 is OWE + VS + I/ log V)). 0

a) c).

(3.1)

The forest T\{ti, tj) has three components with vertex sets A, B, C, such that a EA, b E B, c E C. Let ti connect A and B, tj connect B and C. Then ind(u’, b’) 2 i for every two vertices a’ E A and b’ E B. The same inequality holds for the components B and C. Note, that (3.1) implies that a, b, c are the nearest vertices to u in its components. Therefore, so E z ‘. Let so coincide with a. If s1 belongs to the other component (B or 0, then s, also coincides with b or c and z = z’, since the star z has the largest win, among stars with the center u and given vertices so and si. 82

so, si, b) =d(ti)

The cases of so coincides with b or c are similar. Cl

ec?

+d(t,)

win,(u;

d(v, c).

e2 = arg min saver( e)

a, b, c) =d(ti)

Let si EA and indr(s,, si) = k. Then k cannot coincide with i and j and Lemma 2.5 implies that

since

ec2

win,(u;

17 May 1993

= win,( u; so, b, c),

e, = arg maxsaver( e),

(f) insert(W, u(z)); (2) find a Steiner tree T2 for S using MST-heuristic.

LETTERS

References [l] P. Berman and V. Ramaiyer, An approximation algorithm for the Steiner tree problem, Tech. Rept. #CS-9105, The Pennsylvania State University, 1991. [2] P. Berman and V. Ramaiyer, Improved approximations for the Steiner tree problem, in: Proc. 3rd SODA (1992) 325-334. [3] Ding-Zhu Du, Yanjun Zhang and Qing Feng, On better heuristic for Euclidean Steiner minimum trees, in: Proc. 32nd Ann. Symp. on Foundations of Computer Science (1992) 431-439. [4] M.L. Fredman and R.E. Tarjan, Fibonacci heaps their uses in improved network optimization algorithms, J. ACM 34 (1987) 596-615. [5] D. Hare1 and R.E. Tarjan, Fast algorithms for finding nearest common ancestor, SOlM J. Comput. 13 (1984) 338-355.

Volume 46, Number 2

INFORMATION

PROCESSING LETTERS

[6] R.M. Karp, Reducibility among combinatorial problems, in: Miller and Thatcher, eds., Complexity of Computer Compututions (Plenum Press, New York, 1972) 85-103. [7] K. Mehlhorn, A faster approximation algorithm for the Steiner problem in graphs, Inform. Process. Lert. 27 (1988) 125-128. [81 H. Takahashi and A. Matsuyama, An approximate solution for the Steiner problem in graphs, Math. .&on. (1980) 573-577.

17 May 1993

[9] A.Z. Zelikovsky, The Steiner problem in graphs without optimal vertices, Mar. Issled. 121 (1991) 44-49 (in Russian). [lo] A.Z. Zelikovsky, An 11/6-approximation algorithm for the Steiner problem on graphs, in: J. NeSetiil and M. Fiedler, eds., Proc. Fourth Czechoslovakian Symp. on Combinatorics, Graphs and Complexity, Annals of Discrete Mathematics 51 (North-Holland, Amsterdam, 1992) 351-354.

83