Minimum Routing Cost Tree

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
1
Example 1
a
1
b
2
2
c
1
b
1
1
d
1
a
1
c
1
d
• 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)
2
= 1+2+2+1+1+1+2+1+2+2+1+2 = 18
Example 2
a
1
b
2
2
c
1
a
1
1
d
1
b
2
c
2
d
• 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)
3
= 30
Centroid of A Tree
a
m
b
h
i
f
g
e
c
d
• Deleting a centroid of a tree will produce
subgraphs such that each subgraph contains no
more than n/2 nodes.
4
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
5
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
C (T )  n RC (u, m)
1
u
18  12
a
1
c
1
d
6
1-Star
• A tree with only one internal node.
– All other nodes are leaf nodes.
…
7
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 min i C (Si ) as the approximate
solution
8
Time Complexity
• Step 1: n iterations
– Step 1-1: O(n)
– Step 1-2: O(n)
• Step 2: O(n)
• Total: O(n2)
9
Performance Ratio
• Let C(S) denote the cost of 1-star S.
C ( S )  (2n  2) w(v, m)
…
v
• 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.
C ( S )  2n RC (v, m)
v
C ( S )  2C (T )
10
Can we find a better ratio?
• Yes. There is a PTAS.
11
PTAS for MRCT
• We shall use a k-star to approximate the optimal
solution, and show
k 3
C (k  Star ) 
C (T )
k 1
• When k=1, this is exact the 1-star case we
described in the previous section.
C ( S )  2C (T )
• We shall use the case k=3 to illustrate the basic
concept of this PTAS.
12
k-Star
• A k-star is a tree with exactly k internal
nodes.
d
c
a
j
b
e
i
f
a
h
13
-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
14
Analysis of Routing Cost
r
n
a
p
m
h
c
e
d
f
b
o
j
k
q
i
s
g
•
•
•
•
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
15
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 2n2/9.
n
3 a
n
b 3
n
n
n
9
9
9
• Let w(P) denote the total path length of P, we have
2n
2n 2
C (T ) 
dt (v, P) 
w( P)

3 vP
9
16
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
between a and m.
• Vbm consists of nodes whose lowest ancestors on P are
between b and m.
r
n
a
p
m
h
c
e
d
f
b
o
j
k
q
i
s
g
17
Transform to 3-Star (1)
• For each node v in Va, Vb, and Vm, connect
v to a, b, and m respectively.
r
n
o
a
p
m
h
j
k
q
e
d
f
b
i
s
c
g
18
Transform to 3-Star (1)
• For each node v in Va, Vb, and Vm, connect
v to a, b, and m respectively.
r
n
o
a
p
m
h
j
k
q
e
d
f
b
i
s
c
g
19
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.
r
n
o
a
p
m
h
j
k
q
e
d
f
b
i
s
c
g
20
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.
r
h
p
n
o
a
m
q
e
d
f
b
j
k
c
i
s
g
21
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).
RC (3  star , T )
1
 (n  1) dt (v, P )  n 2 w( P)
4
v
1 2
 n dt (v, P )  n w( P)
3
v
3
 C (T )
2
22
How to find the 3-Star
a
b
…
i
c
…
j
…
k
• 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.
23
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.
24
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.
25
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)
26
Mid-Term
• April 28th, Thursday
– 9:00-12:00
– No class on April 26th
• Closed Book
27
Presentation
• Each student chooses a journal paper about
approximation algorithm and gives a 40minute presentation.
28