Download presentation
Presentation is loading. Please wait.
Published byGeorgiana King Modified over 9 years ago
1
Reliability Analysis of Tree Networks Applied to Balanced Content Replication Mugurel Ionut Andreica, Nicolae Tapus Polytechnic University of Bucharest Computer Science Department
2
Reliability Analysis of Tree Networks Applied to Balanced Content Replication 2 Summary Motivation Unrestricted Vertex Multicut Problem on Trees problem definition problem definition suboptimal solution (known) suboptimal solution (known) optimal solution (new) optimal solution (new) Reliability Metric Definition Balanced Content Replication on Trees problem definition problem definition k-equitable coloring of trees (new algorithm) k-equitable coloring of trees (new algorithm) Evaluation Results Conclusions
3
Reliability Analysis of Tree Networks Applied to Balanced Content Replication 3 Motivation Trees multiple uses: multiple uses: multicast content distributionmulticast content distribution packet routingpacket routing content replicationcontent replication distributed data indexing and storagedistributed data indexing and storage very fragile very fragile a single node failure disconnects the networka single node failure disconnects the network need a special kind of reliability analysis (maybe node failures and network “splits” are acceptable under certain conditions) need a special kind of reliability analysis (maybe node failures and network “splits” are acceptable under certain conditions)
4
Reliability Analysis of Tree Networks Applied to Balanced Content Replication 4 Unrestricted Vertex Multicut Problem on Trees (1/3) problem definition tree – V vertices tree – V vertices H pairs of critical vertices (s i,t i ) H pairs of critical vertices (s i,t i ) remove the minimum number of vertices such that all the critical pairs are disconnected 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 1. root the tree at some vertex r and compute the parent-son relationships for all the vertices. Step 2. for each critical pair (s i,t i ) do: compute its LCA and the level of the LCA (the distance from the LCA to the root) Step 2. for each critical pair (s i,t i ) 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 3. sort all the critical pairs in non-increasing order of the level of their LCA Step 4. for each critical pair (s i, t i ), in the sorted order, do Step 4. for each critical pair (s i, t i ), in the sorted order, do Step 4.1. if s i and t i are not already disconnected then Step 4.1. if s i and t i are not already disconnected then Step 4.1.1. remove the LCA of s i and t i from the tree Step 4.1.1. remove the LCA of s i and t i from the tree
5
Reliability Analysis of Tree Networks Applied to Balanced Content Replication 5 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 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 i th pair and level[i] is the level of their LCA in the tree – O(V+H) [Bender, Farach-Colton, 2000] Step 2: compute the arrays pLCA and level: pLCA[i] is the lowest common ancestor of the i th 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) Step 3 – O(V+H) for l=0 to V-1 do LL[l]=emptyfor l=0 to V-1 do LL[l]=empty for i=1 to H do LL[level[i]].add(i)for i=1 to H do LL[level[i]].add(i) sorted_pairs=emptysorted_pairs=empty for lev=V-1 downto 0 dofor lev=V-1 downto 0 do if (LL[lev] is not empty) then if (LL[lev] is not empty) then for i in LL[lev] do sorted_pairs.add(i)for i in LL[lev] do sorted_pairs.add(i)
6
Reliability Analysis of Tree Networks Applied to Balanced Content Replication 6 Unrestricted Vertex Multicut Problem on Trees (3/3) optimal algorithm – O(V+H) (continued) Step 4 – O(V+H), amortized analysis Step 4 – O(V+H), amortized analysis for v=1 to V do marked[v]=Falsefor v=1 to V do marked[v]=False num_removed=0 num_removed=0 for i=1 to H do for i=1 to H do p=sorted_pair[i] p=sorted_pair[i] if ((not marked[s p ]) and (not marked[t p ])) then if ((not marked[s p ]) and (not marked[t p ])) then num_removed = num_removed + 1num_removed = num_removed + 1 TraverseAndMark(pLCA[p])TraverseAndMark(pLCA[p]) return num_removedreturn num_removed TraverseAndMark(v): TraverseAndMark(v): marked[v]=Truemarked[v]=True for each w in sons(v) dofor each w in sons(v) do if (not marked[w]) then if (not marked[w]) then TraverseAndMark(w)TraverseAndMark(w)
7
Reliability Analysis of Tree Networks Applied to Balanced Content Replication 7 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
8
Reliability Analysis of Tree Networks Applied to Balanced Content Replication 8 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 each server: 1 piece of content nv i =the number of servers storing piece i nv i =the number of servers storing piece i |nv i -nv j |≤1 |nv i -nv j |≤1 neighboring servers should store different pieces of content 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)
9
Reliability Analysis of Tree Networks Applied to Balanced Content Replication 9 Balanced Content Replication (2/5) new k-equitable coloring algorithm – O(V·k) root the tree at a vertex r having each vertex has at most D-1 sons root the tree at a vertex r having each vertex has at most D-1 sons bottom-up traversal of the tree (from leaves to the root) bottom-up traversal of the tree (from leaves to the root) for each vertex i, compute: for each vertex i, compute: nvtotal i = the number of vertices in i’s subtree (including i)nvtotal i = the number of vertices in i’s subtree (including i) ncplus i = (nvtotal i mod k) – the number of surplus colors in an equitable coloring of vertex i’s subtreencplus i = (nvtotal i mod k) – the number of surplus colors in an equitable coloring of vertex i’s subtree color i = the color of vertex i in an equitable coloring of its subtree.color i = the color of vertex i in an equitable coloring of its subtree. color_perm i = a permutation which describes how the colors in vertex i’s subtree should be relabeled.color_perm i = a permutation which describes how the colors in vertex i’s subtree should be relabeled. r=v 1, v 2,..., v q =i -> the path from r ro i r=v 1, v 2,..., v q =i -> the path from r ro i p=color_perm v1 color_perm v2 … color_perm vqp=color_perm v1 color_perm v2 … color_perm vq real_color i =p(color i )real_color i =p(color i ) if i is a leaf: if i is a leaf: nvtotal i =1; ncplus i =1 mod k; color i =1; color_perm i =(1,2,...,k)nvtotal i =1; ncplus i =1 mod k; color i =1; color_perm i =(1,2,...,k)
10
Reliability Analysis of Tree Networks Applied to Balanced Content Replication 10 Balanced Content Replication (3/5) new k-equitable coloring algorithm – O(V·k) (continued) if i has ns(i)>0 sons 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)))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))define cplus(j-1)=nvtotal(s(i,1))+...+nvtotal(s(i,j-1)) if ncplus s(i,j) =0 => s i,j is inactive; otherwise s i,j is active.if ncplus s(i,j) =0 => s i,j is inactive; otherwise s i,j is active. if (ncplus s(i,j) >0 and cplus j-1 =0) or (cplus j-1 + ncplus s(i,j) >k), then all the sons s i,1,…, s i,j-1 are made inactive and s i,j =the only active sonif (ncplus s(i,j) >0 and cplus j-1 =0) or (cplus j-1 + ncplus s(i,j) >k), then all the sons s i,1,…, s i,j-1 are made inactive and s i,j =the only active son if s(i,j)=inactive thenif s(i,j)=inactive then swap 2 colors: color s(i,j) and k-1 in color_perm s(i,j) swap 2 colors: color s(i,j) and k-1 in color_perm s(i,j)
11
Reliability Analysis of Tree Networks Applied to Balanced Content Replication 11 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 if (vertex i has ns(i)>0 sons) and (s(i,j)=active) then cyclic recoloring: color c -> color ((cplus j-1 +c-1) mod k)+1 (in color_perm s(i,j) )cyclic recoloring: color c -> color ((cplus j-1 +c-1) mod k)+1 (in color_perm s(i,j) ) maintain counters:maintain counters: c active =number of currently active sons c active =number of currently active sons total active =total number of sons which were active at some point total active =total number of sons which were active at some point if (color_perm s(i,j) (color s(i,j) )>total active ) thenif (color_perm s(i,j) (color s(i,j) )>total active ) then relabeling permutation with a cycle of length 3: color_perm s(i,j) (color s(i,j) ) -> c active -> total active relabeling permutation with a cycle of length 3: color_perm s(i,j) (color s(i,j) ) -> c active -> total active else: relabeling permutation with two-color swap: color_perm s(i,j) (color s(i,j) ), c active else: relabeling permutation with two-color swap: color_perm s(i,j) (color s(i,j) ), c active maintain a stack S of relabeling permutation (inactive sons push the identity permutation on the stack)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-downafter the last son, compose the permutations in S top-down p lev =the composition from the top until level lev p lev =the composition from the top until level lev color_perm s(i,lev) =ComposePermutations(p lev,color_perm s(i,lev) ) color_perm s(i,lev) =ComposePermutations(p lev,color_perm s(i,lev) ) assign to vertex i the color k (no son is colored with k)assign to vertex i the color k (no son is colored with k) swap the colors in color_perm i, such that vertex i is colored with 1swap the colors in color_perm i, such that vertex i is colored with 1
12
Reliability Analysis of Tree Networks Applied to Balanced Content Replication 12 Balanced Content Replication (5/5) new k-equitable coloring algorithm – O(V·k) (continued) perform a second, top-down traversal of the tree 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) 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 compute the “real color” of vertex i overall complexity: O(V·k) overall complexity: O(V·k)
13
Reliability Analysis of Tree Networks Applied to Balanced Content Replication 13 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) O(V·H) vs O((V+H)·log(V)) (a simpler, more practical, LCA finding method) VH O(V·H) algorithm O((V+H)·log(V)) algorithm 100009998 10,25 sec 0,37 sec 3000029999 86 sec 1,39 sec 5000050001 229,58 sec 2,18 sec 6666666666 1149,22 sec 3,70 sec 9999999998 1896,78 sec 5,71 sec
14
Reliability Analysis of Tree Networks Applied to Balanced Content Replication 14 Evaluation Results (2/5) two types of test scenarios type 1 test scenario different values of V, D, k, leaf percentage different values of V, D, k, leaf percentage C – number of vertices serving client requests C – number of vertices serving client requests we k-equitably colored the tree we k-equitably colored the tree critical pairs = (i,j) critical pairs = (i,j) j has color color(j)j has color color(j) dist(i,j)<dist(i,p), with color(p)=color(j)dist(i,j)<dist(i,p), with color(p)=color(j) reliability decreases with k reliability decreases with k reliability depends on leaf percentage (tree structure) more than anything else reliability depends on leaf percentage (tree structure) more than anything else
15
Reliability Analysis of Tree Networks Applied to Balanced Content Replication 15 Evaluation Results (3/5) V=10000
16
Reliability Analysis of Tree Networks Applied to Balanced Content Replication 16 Evaluation Results (4/5) different values of V and different leaf percentages
17
Reliability Analysis of Tree Networks Applied to Balanced Content Replication 17 Evaluation Results (5/5) type 2 test scenario critical pairs=(i,j) critical pairs=(i,j) color(i)=color(j)color(i)=color(j) motivated by the need of periodical synchronization between replicasmotivated by the need of periodical synchronization between replicas obtained similar results obtained similar results
18
Reliability Analysis of Tree Networks Applied to Balanced Content Replication 18 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 has potential to be a useful metric future work tests on real-life tree networks tests on real-life tree networks content replication (might not be perfectly balanced)content replication (might not be perfectly balanced) multicastmulticast peer-to-peer overlays (many possibilities) or physical network infrastructure (tree-like in certain situations)peer-to-peer overlays (many possibilities) or physical network infrastructure (tree-like in certain situations)
19
Reliability Analysis of Tree Networks Applied to Balanced Content Replication 19 Thank You !
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.