algorithm O(V·H)

Reliability Analysis of Tree
Networks Applied to Balanced
Content Replication
Mugurel Ionut Andreica, Nicolae Tapus
Polytechnic University of Bucharest
Computer Science Department
Summary


Motivation
Unrestricted Vertex Multicut Problem on Trees





Reliability Metric Definition
Balanced Content Replication on Trees




problem definition
suboptimal solution (known)
optimal solution (new)
problem definition
k-equitable coloring of trees (new algorithm)
Evaluation Results
Conclusions
Reliability Analysis of Tree Networks Applied to Balanced Content Replication
2
Motivation

Trees

multiple uses:
•
•
•
•

multicast content distribution
packet routing
content replication
distributed data indexing and storage
very fragile
• a single node failure disconnects the network

need a special kind of reliability analysis
(maybe node failures and network “splits” are
acceptable under certain conditions)
Reliability Analysis of Tree Networks Applied to Balanced Content Replication
3
Unrestricted Vertex Multicut
Problem on Trees (1/3)

problem definition




tree – V vertices
H pairs of critical vertices (si,ti)
remove the minimum number of vertices such that all the
critical pairs are disconnected
suboptimal algorithm – O(V·H) [Guo et al., 2006]






Step 1. root the tree at some vertex r and compute the
parent-son relationships for all the vertices.
Step 2. for each critical pair (si,ti) do: compute its LCA and
the level of the LCA (the distance from the LCA to the root)
Step 3. sort all the critical pairs in non-increasing order of the
level of their LCA
Step 4. for each critical pair (si, ti), in the sorted order, do
Step 4.1. if si and ti are not already disconnected then
Step 4.1.1. remove the LCA of si and ti from the tree
Reliability Analysis of Tree Networks Applied to Balanced Content Replication
4
Unrestricted Vertex Multicut
Problem on Trees (2/3)

optimal algorithm – O(V+H)



Step 1: choose a root r and compute the parent-son
relationships for all the vertices of the tree – O(V)
Step 2: compute the arrays pLCA and level: pLCA[i] is
the lowest common ancestor of the ith pair and level[i] is
the level of their LCA in the tree – O(V+H) [Bender,
Farach-Colton, 2000]
Step 3 – O(V+H)
•
•
•
•
for l=0 to V-1 do LL[l]=empty
for i=1 to H do LL[level[i]].add(i)
sorted_pairs=empty
for lev=V-1 downto 0 do

if (LL[lev] is not empty) then
• for i in LL[lev] do sorted_pairs.add(i)
Reliability Analysis of Tree Networks Applied to Balanced Content Replication
5
Unrestricted Vertex Multicut
Problem on Trees (3/3)

optimal algorithm – O(V+H) (continued)

Step 4 – O(V+H), amortized analysis
• for v=1 to V do marked[v]=False
• num_removed=0
• for i=1 to H do


p=sorted_pair[i]
if ((not marked[sp]) and (not marked[tp])) then
• num_removed = num_removed + 1
• TraverseAndMark(pLCA[p])
• return num_removed

TraverseAndMark(v):
• marked[v]=True
• for each w in sons(v) do

if (not marked[w]) then
• TraverseAndMark(w)
Reliability Analysis of Tree Networks Applied to Balanced Content Replication
6
Reliability Metric Definition
 tree
with V vertices
 H critical pairs (problem dependent)
 Q=total number of distinct vertices
belonging to at least one pair
 U=UVMC(V, H)
 reliability=U/Q
Reliability Analysis of Tree Networks Applied to Balanced Content Replication
7
Balanced Content Replication
(1/5)



tree with V vertices (servers)
k pieces of content
distribute the pieces evenly among the servers






each server: 1 piece of content
nvi=the number of servers storing piece i
|nvi-nvj|≤1
neighboring servers should store different pieces of
content
find a valid assignment (piece of content – set of
vertices) => k-equitable coloring
supplementary assumption: k≥D (D=the maximum
degree of the tree)
Reliability Analysis of Tree Networks Applied to Balanced Content Replication
8
Balanced Content Replication
(2/5)

new k-equitable coloring algorithm – O(V·k)



root the tree at a vertex r having <D sons => each vertex has
at most D-1 sons
bottom-up traversal of the tree (from leaves to the root)
for each vertex i, compute:
• nvtotali = the number of vertices in i’s subtree (including i)
• ncplusi = (nvtotali mod k) – the number of surplus colors in an
equitable coloring of vertex i’s subtree
• colori = the color of vertex i in an equitable coloring of its subtree.
• color_permi = a permutation which describes how the colors in
vertex i’s subtree should be relabeled.

r=v1, v2, ..., vq=i -> the path from r ro i
• p=color_permv1 • color_permv2 • … • color_permvq
• real_colori=p(colori)

if i is a leaf:
• nvtotali=1; ncplusi=1 mod k; colori=1; color_permi=(1,2,...,k)
Reliability Analysis of Tree Networks Applied to Balanced Content Replication
9
Balanced Content Replication
(3/5)

new k-equitable coloring algorithm –
O(V·k) (continued)

if i has ns(i)>0 sons
• combine the colorings of i’s sons (in some order
s(i,1), s(i,2), ..., s(i,j), ..., s(i,ns(i)))
• define cplus(j-1)=nvtotal(s(i,1))+...+nvtotal(s(i,j-1))
• if ncpluss(i,j)=0 => si,j is inactive; otherwise si,j is
active.
• if (ncpluss(i,j)>0 and cplusj-1=0) or (cplusj-1 +
ncpluss(i,j)>k), then all the sons si,1,…, si,j-1 are made
inactive and si,j=the only active son
• if s(i,j)=inactive then

swap 2 colors: colors(i,j) and k-1 in color_perms(i,j)
Reliability Analysis of Tree Networks Applied to Balanced Content Replication
10
Balanced Content Replication
(4/5)

new k-equitable coloring algorithm – O(V·k) (continued)

if (vertex i has ns(i)>0 sons) and (s(i,j)=active) then
• cyclic recoloring: color c -> color ((cplusj-1+c-1) mod k)+1 (in
color_perms(i,j))
• maintain counters:


cactive=number of currently active sons
totalactive=total number of sons which were active at some point
• if (color_perms(i,j)(colors(i,j))>totalactive) then


relabeling permutation with a cycle of length 3:
color_perms(i,j)(colors(i,j)) -> cactive -> totalactive
else: relabeling permutation with two-color swap:
color_perms(i,j)(colors(i,j)) , cactive
• maintain a stack S of relabeling permutation (inactive sons push
the identity permutation on the stack)
• after the last son, compose the permutations in S top-down


plev=the composition from the top until level lev
color_perms(i,lev)=ComposePermutations(plev,color_perms(i,lev))
• assign to vertex i the color k (no son is colored with k)
• swap the colors in color_permi, such that vertex i is colored with 1
Reliability Analysis of Tree Networks Applied to Balanced Content Replication
11
Balanced Content Replication
(5/5)
k-equitable coloring algorithm –
O(V·k) (continued)
 new




perform a second, top-down traversal of
the tree
compose the permutations on the path
from the root r to each vertex i (O(V·k)
overall)
compute the “real color” of vertex i
overall complexity: O(V·k)
Reliability Analysis of Tree Networks Applied to Balanced Content Replication
12
Evaluation Results (1/5)

comparison between UVMC algorithms
(Python implementation)

O(V·H) vs O((V+H)·log(V)) (a simpler, more
practical, LCA finding method)
V
H
O(V·H)
algorithm
O((V+H)·log(V))
algorithm
10000
9998
10,25 sec
0,37 sec
30000
29999
86 sec
1,39 sec
50000
50001
229,58 sec
2,18 sec
66666
66666
1149,22 sec
3,70 sec
99999
99998
1896,78 sec
5,71 sec
Reliability Analysis of Tree Networks Applied to Balanced Content Replication
13
Evaluation Results (2/5)

two types of test scenarios
 type 1 test scenario




different values of V, D, k, leaf percentage
C – number of vertices serving client requests
we k-equitably colored the tree
critical pairs = (i,j)
• j has color color(j)
• dist(i,j)<dist(i,p), with color(p)=color(j)


reliability decreases with k
reliability depends on leaf percentage (tree
structure) more than anything else
Reliability Analysis of Tree Networks Applied to Balanced Content Replication
14
Evaluation Results (3/5)
 V=10000
0,1
0,09
0,08
0,07
50%
leaves
0,06
66%
leaves
90%
leaves
0,05
0,04
c
0,03
0,02
0,01
0
0
10
20
30
40
50
60
Number of colors
Reliability Analysis of Tree Networks Applied to Balanced Content Replication
15
Evaluation Results (4/5)
 different
values of V and different leaf
percentages
0,085
0,08
66% leaves, V=5000
0,075
66% leaves, V=10000
0,07
66% leaves, V=25000
90% leaves, V=5000
0,065
90% leaves, V=10000
0,06
90% leaves, V=25000
0,055
0,05
0,045
0,04
0
10
20
30
40
50
60
Number of colors
Reliability Analysis of Tree Networks Applied to Balanced Content Replication
16
Evaluation Results (5/5)
 type

2 test scenario
critical pairs=(i,j)
• color(i)=color(j)
• motivated by the need of periodical
synchronization between replicas

obtained similar results
Reliability Analysis of Tree Networks Applied to Balanced Content Replication
17
Conclusions



first optimal algorithm for UVMC on trees
new k-equitable coloring algorithm
reliability metric depends on tree structure
more than anything else


has potential to be a useful metric
future work

tests on real-life tree networks
• content replication (might not be perfectly balanced)
• multicast
• peer-to-peer overlays (many possibilities) or
physical network infrastructure (tree-like in certain
situations)
Reliability Analysis of Tree Networks Applied to Balanced Content Replication
18
Thank You !
Reliability Analysis of Tree Networks Applied to Balanced Content Replication
19