Minimum Routing Cost Tree

28
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

description

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. - PowerPoint PPT Presentation

Transcript of Minimum Routing Cost Tree

Page 1: Minimum Routing Cost Tree

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

Page 2: Minimum Routing Cost Tree

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

dc

2

2

1

1 1

1

b

a c d

1 1 1

Page 3: Minimum Routing Cost Tree

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

dc

2

2

1

1 1

1

a

b c d

1 2 2

Page 4: Minimum Routing Cost Tree

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

c d

h i

f

e

Page 5: Minimum Routing Cost Tree

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 subtre

e) and v will pass through m.

m

Page 6: Minimum Routing Cost Tree

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.

u

muRCnTC ),()(

b

a c d

1 1 11218

Page 7: Minimum Routing Cost Tree

7

1-Star

• A tree with only one internal node.– All other nodes are leaf nodes.

Page 8: Minimum Routing Cost Tree

8

Approximation Algorithm for MRCT

1 For each node i

1-1 Form a 1-star Si rooted at i

1-2 Calculate the routing cost C(Si)

2 Return as the approximate solution

)(min ii SC

Page 9: Minimum Routing Cost Tree

9

Time Complexity

• Step 1: n iterations– Step 1-1: O(n)– Step 1-2: O(n)

• Step 2: O(n)

• Total: O(n2)

Page 10: Minimum Routing Cost Tree

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.

v

mvwnSC ),()22()(

v

mvRCnSC ),(2)(

)(2)( TCSC

Page 11: Minimum Routing Cost Tree

11

Can we find a better ratio?

• Yes. There is a PTAS.

Page 12: Minimum Routing Cost Tree

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.

)(1

3)( TCk

kStarkC

)(2)( TCSC

Page 13: Minimum Routing Cost Tree

13

k-Star

• A k-star is a tree with exactly k internal nodes.

a bj

i

ha

c

d

e

f

Page 14: Minimum Routing Cost Tree

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 po

int, i.e. the controid.– We shall choose = 2/(k+3)– For k=3, = 1/3

Page 15: Minimum Routing Cost Tree

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 n

odes.• P: the path from node a to node b.

– P is a (1/3)-separator

a p

q

m h b

rn

o

j

k si g

d f

ec

Page 16: Minimum Routing Cost Tree

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)-s

eparator.

• 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 2n2/9.

• Let w(P) denote the total path length of P, we have

Pv

Pwn

Pvdtn

TC )(9

2),(

3

2)(

2

a b3

n

3

n

9

n

9

n

9

n

Page 17: Minimum Routing Cost Tree

17

Partition The Nodes• Va consists of nodes whose lowest ancestors on P are a.• Vb consists of nodes whose lowest ancestors on P are b.• Vm consists of nodes whose lowest ancestors on P are m.• Vam consists of nodes whose lowest ancestors on P are bet

ween a and m.• Vbm consists of nodes whose lowest ancestors on P are bet

ween b and m.

a p

q

m h b

rn

o

j

k si g

d f

ec

Page 18: Minimum Routing Cost Tree

18

Transform to 3-Star (1)

• For each node v in Va, Vb, and Vm, connect v to a, b, and m respectively.

a p

q

m h b

rn

o

j

k si g

d f

ec

Page 19: Minimum Routing Cost Tree

19

Transform to 3-Star (1)

• For each node v in Va, Vb, and Vm, connect v to a, b, and m respectively.

a p

q

m h b

rn

o

j

k si g

d f

ec

Page 20: Minimum Routing Cost Tree

20

Transform to 3-Star (2)

a p

q

m h b

rn

o

j

k si g

d f

ec

• Replace P by a path (a,m) and (b,m).

• For each node v in Vam, connect v to a or m, depending on which one is nearer to v.

• For each node v in Vbm, connect v to b or m, depending on which one is nearer to v.

Page 21: Minimum Routing Cost Tree

21

Transform to 3-Star (2)

• Replace P by a path (a,m) and (b,m).

• For each node v in Vam, connect v to a or m, depending on which one is nearer to v.

• For each node v in Vbm, connect v to b or m, depending on which one is nearer to v.

a

p

q

m

h

b

rn

o

j

k si g

d f

ec

Page 22: Minimum Routing Cost Tree

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)=(n2/4).

)(2

3

)(3

1),(

)(4

1),()1(

),3(

2

2

TC

PwnPvdtn

PwnPvdtn

TstarRC

v

v

Page 23: Minimum Routing Cost Tree

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.

a b c

… … …

i j k

Page 24: Minimum Routing Cost Tree

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.

Page 25: Minimum Routing Cost Tree

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.

Page 26: Minimum Routing Cost Tree

26

Time Complexity

• Total time complexity: O(n8)– O(n3) possible ways to select a,b and c.

– O(n2) possible ways to select I,j and k.

– The perfect minimum bipartite problem can be solved in O(n3) time.

• For k-star, it takes O(n2k+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)

Page 27: Minimum Routing Cost Tree

27

Mid-Term

• April 28th, Thursday– 9:00-12:00– No class on April 26th

• Closed Book

Page 28: Minimum Routing Cost Tree

28

Presentation

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