Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Minimum Routing Cost Tree Definition –For two nodes u and v on a tree, there is a path between them. –The sum of all edge weights on this path is called.

Similar presentations


Presentation on theme: "1 Minimum Routing Cost Tree Definition –For two nodes u and v on a tree, there is a path between them. –The sum of all edge weights on this path is called."— Presentation transcript:

1 1 Minimum Routing Cost Tree Definition –For two nodes u and v on a tree, there is a path between them. –The sum of all edge weights on this path is called the routing cost of this pair of nodes. –MRCT: Minimize the sum of routing costs between all pairs of nodes. cf. Minimum Spanning Tree

2 2 Example 1 Total sum of all pairs of routing costs of this tree: –RC(a,b)+RC(a,c)+RC(a,d)+RC(b,a)+RC(b,c)+RC(b,d) +RC(c,a)+RC(c,b)+RC(c,d)+RC(d,a)+RC(d,b)+RC(d,c) = 1+2+2+1+1+1+2+1+2+2+1+2 = 18 a b d c 2 2 1 1 1 1 b acd 111

3 3 Example 2 Total sum of all pairs of routing costs of this tree: –RC(a,b)+RC(a,c)+RC(a,d)+RC(b,a)+RC(b,c)+RC(b,d) +RC(c,a)+RC(c,b)+RC(c,d)+RC(d,a)+RC(d,b)+RC(d,c) = 30 a b d c 2 2 1 1 1 1 a bcd 122

4 4 Centroid of A Tree Deleting a centroid of a tree will produce subgraphs such that each subgraph contains no more than n/2 nodes. a b m g cd h i f e

5 5 Centroid (2) Let T be rooted by a centroid m of T. –Every subtree of m contains no more than n/2 nodes. Consider any node v in T. The subtree containing v contains no more than n/2 nodes. –At least n/2 paths between some node u (in other subtree) and v will pass through m. m

6 6 Centroid (3) Note: we count every pair of nodes twice. –The path from u to v and the path from v to u will both be counted. In the routing cost of this tree, the length of the path from any node u to m will be counted at least 2(n/2) = n times. b acd 111

7 7 1-Star A tree with only one internal node. –All other nodes are leaf nodes. …

8 8 Approximation Algorithm for MRCT 1 For each node i 1-1 Form a 1-star S i rooted at i 1-2 Calculate the routing cost C(S i ) 2 Return as the approximate solution

9 9 Time Complexity Step 1: n iterations –Step 1-1: O(n) –Step 1-2: O(n) Step 2: O(n) Total: O(n 2 )

10 10 Performance Ratio Let C(S) denote the cost of 1-star S. Assume T is a minimum routing cost spanning tree and m is a centroid of T. Because of the triangular inequality, w(v,m) is less than RC(v,m) of T. …

11 11 Can we find a better ratio? Yes. There is a PTAS.

12 12 PTAS for MRCT We shall use a k-star to approximate the optimal solution, and show When k=1, this is exact the 1-star case we described in the previous section. We shall use the case k=3 to illustrate the basic concept of this PTAS.

13 13 k-Star A k-star is a tree with exactly k internal nodes. a b j i ha c d e f

14 14  -separator For 0 <   ½, a  -separator of a graph G is a minimum subgraph of G whose deletion will result in subgraphs, each of which contains no more than  n nodes. –For  =1/2, the  -separator contains only one point, i.e. the controid. –We shall choose  = 2/(k+3) –For k=3,  = 1/3

15 15 Analysis of Routing Cost Assume T is a minimum routing cost spanning tree. Assume T is rooted at its centroid m. Then at most two subtrees of m contain more than n/3 nodes. Let a and b be the lowest nodes whose descendants have at least n/3 nodes. P: the path from node a to node b. –P is a (1/3)-separator ap q mhb r n o j k s i g df ec

16 16 Analysis of Routing Cost (2) Let dt(v,P) denote the path length from v to P. –This path length must be counted at least 2n/3 times because P is a (1/3)- separator. For each edge of P, the edge is counted at least (n/3)(2n/3) times in routing cost. –Each edge on P is counted (n/3 +  )(2n/3 -  ) times. –When   n/3, the above formula is always greater than or equal to 2n 2 /9. Let w(P) denote the total path length of P, we have ab

17 17 Partition The Nodes V a consists of nodes whose lowest ancestors on P are a. V b consists of nodes whose lowest ancestors on P are b. V m consists of nodes whose lowest ancestors on P are m. V am consists of nodes whose lowest ancestors on P are between a and m. V bm consists of nodes whose lowest ancestors on P are between b and m. ap q mh b r n o j k s i g df ec

18 18 Transform to 3-Star (1) For each node v in V a, V b, and V m, connect v to a, b, and m respectively. ap q mhb r n o j k s i g df ec

19 19 Transform to 3-Star (1) For each node v in V a, V b, and V m, connect v to a, b, and m respectively. ap q mhb r n o j k s i g df ec

20 20 Transform to 3-Star (2) ap q mhb r n o j k s i g df ec Replace P by a path (a,m) and (b,m). For each node v in V am, connect v to a or m, depending on which one is nearer to v. For each node v in V bm, connect v to b or m, depending on which one is nearer to v.

21 21 Transform to 3-Star (2) Replace P by a path (a,m) and (b,m). For each node v in V am, connect v to a or m, depending on which one is nearer to v. For each node v in V bm, connect v to b or m, depending on which one is nearer to v. a p q m h b r n o j k s i g df ec

22 22 Comparison with 3-Star For each edge (v,a), (v,b), (v,m) in the 3- star, it will be counted (n-1) times. For edge (a,m) or (b,m), it is counted no more than (n/2)(n/2)=(n 2 /4).

23 23 How to find the 3-Star Pick 3 nodes. For i+j+k=n-3, connect i nodes to a, j nodes to b, and k nodes to c. However, if we tries all combinations, it took exponential time. abc ……… i jk

24 24 Minimum Perfect Bipartite Matching In a bipartite graph, there are two sets of nodes, denoted as X and Y. In our case, let X = V – {a,b,c}. Y contains i copies of a, j copies of node b, and k copies of c. –If a node v in X is matched with a node u in Y, v will be connected to u in the 3-star.

25 25 PTAS For all (a,b,c) where a, b and c are selected from V do –For all (i,j,k) where i+j+k = n-3 and I,j,j are all positive integers, do Perform a perfect minimal bipartite matching to create a 3-star. Compute the total routing cost C of this 3-star. –Choose the 3-star with minimum cost to be our approximate solution.

26 26 Time Complexity Total time complexity: O ( n 8 ) –O(n 3 ) possible ways to select a,b and c. –O(n 2 ) possible ways to select I,j and k. –The perfect minimum bipartite problem can be solved in O(n 3 ) time. For k-star, it takes O(n 2k+2 ) time to obtain a solution which is less than or equal to (k+3)/(k+1) of the optimal solution. –Error ratio: 2/(k+1)

27 27 Mid-Term April 28 th, Thursday –9:00-12:00 –No class on April 26 th Closed Book

28 28 Presentation Each student chooses a journal paper about approximation algorithm and gives a 40- minute presentation.


Download ppt "1 Minimum Routing Cost Tree Definition –For two nodes u and v on a tree, there is a path between them. –The sum of all edge weights on this path is called."

Similar presentations


Ads by Google