Presentation is loading. Please wait.

Presentation is loading. Please wait.

Distributed Algorithms for Network Diameter David Peleg, Liam Roditty and Elad Tal.

Similar presentations


Presentation on theme: "Distributed Algorithms for Network Diameter David Peleg, Liam Roditty and Elad Tal."— Presentation transcript:

1 Distributed Algorithms for Network Diameter David Peleg, Liam Roditty and Elad Tal

2 Diameter - definition VUX W Diameter = 3 Diameter = 2

3 Diameter – the idea

4 Model and definitions. A synchronized network of n processors represented by a graph G=(V,E), each processor is assumed to have unique identifier from {1,...,n}. In each round, every vertex (processor): (i) receives all the messages sent to it by its neighbors. (ii) perform some local computation. (iii) sends a, possibly different, message of size O(logn) bits to each of its neighbors. Known as the CONGEST model

5 Presented algorithms

6 First, how to construct BFS(v). 1)v sends a message = {ID(v), distance from itself (0)} to all of its neighbors. 2)For every vertex v’ ≠ v do: - upon receiving a message for the first time (over an edge(s) e): send a message = {ID(v), d(v,v’)} on every other edge, and send “ack” message over the edge e, e enters the BFS. - upon receiving a message containing ID(v) again: discard it and do nothing.

7 BFS(v). v v3 v2 v1 v5 v4 v6 {V,0} Ack {V,1} {V,2} Ack {V,2}

8 BFS(v). u e ack

9 Exact diameter the idea: u v After computing BFS(v), u knows d(u,v).

10 Exact Diameter - Take 1.

11 Exact Diameter - Take 1(cont.) v0 v3 v2 v1 v4v5 v6 depth(v3)depth(v4) depth(v5)depth(v6) max(depth(v3),depth(v4),depth(v1)) max(depth(v5),depth(v6),depth(v2)) diameter Step 2:

12 Exact Diameter - Take 1(cont.) Step 2: 1)Starting with the leafs in BFS(v0), each leaf sends its dm(v) to its parent in BFS(v0). 2)Each inner node in BFS(v0), sends to it parent the maximum dm(v) in its subtree. 3) After O(D) rounds, v0 knows the diameter of the graph. 4) v0 informs all the vertices about the diameter by broadcasting the message downward, i.e. starting with v0, each vertex sends the diameter to its children in BFS(v0).

13 Exact Diameter - Take 1, what is wrong? During step 1, collisions between messages of different BFS constructions may occur: v1 v2 v3 v4 v5 v6...... Can’t breath here!!!

14 Exact Diameter - Take 2 - the idea

15 Exact Diameter - Take 2 The algorithms is composed of four stages: v0 Stage 1: Compute BFS(v0). Use BFS(v0)-tree to synchronize the clocks of all vertices, so thereafter they all agree on time 0 and the current time. Each vertex sends to its children current time+1 0 0 1 11 2 2 2 2 22

16 Exact Diameter - Take 2 (cont.) Stage 2: Run DFS(BFS(v0)), as a by-product, each vertex v get labelled by a number q(v) – the round in which the DFS visited v for the first time. v0 v1 v2 v3 v4 v5 M q(v0) = 0 q(v1) = 1 M M M M q(v2) = 2 q(v4) = 5 M M M q(v2) = 8 q(v4) = 9 M = the current round of DFS.

17 Exact Diameter - Take 2 (cont.)

18 Take 2 – Analysis

19 Lemma 1: there are no collisions between messages of different BFS construction processes. Assume for the sake of contradiction that some collision occur, and the very fast collision is between BFS(v) and BFS(w): V W X

20 Take 2 – Analysis(cont.) (1) T0 + 2q(v) + d(v,x) = T0 + 2q(w) + d(w,x) Assume, w.l.o.g. that q(v) < q(w), then: (2) d(v,x) – d(w,x) = 2q(w) – 2q(v) > 0

21 Take 2 – Analysis(cont.) BFS(v) begins at T0 + 2q(v) BFS(w) begins at T0 + 2q(w) Assume, w.l.o.g. that q(v) < q(w) Thus, BFS(w) starts 2q(w) – 2q(v) rounds after BFS(v) V W T0 + 2q(v)T0 + 2q(w)

22 Correctness – the idea V W

23 Take 2 – Analysis(cont.)

24

25 Dominating set A dominating set for a graph G is subset M of the vertices of G such that each node is either in M or is adjacent to at least 1 node in M. Not dominating set! Dominating set!

26 Approximation of the diameter – notation. v 2 3 4 5 What is C(1,v)? 2 What is C(3,v)? 2 3 What is d(C(1,v))? What is d(C(3,v))? 4

27 Approximation of the diameter – notation(cont.) V V N(k,v) : the k-hop neighborhood of some v, i.e all the vertices at distance at most k from v. Example for N(2,v) : Don’t confuse with C(2,v)

28 Approximation of the diameter – the idea. BFS

29 Approximation of the diameter – the idea. v’ u’ D 1/3 D Let u’,v’ be two vertices such that d(u’,v’) = D. N(D/3,v’) N(D/3,u’)

30 Approximation of the diameter – the idea.

31 v’ u’ N(D/3,v’) N(D/3,u’) D

32 Approximation of the diameter – the idea. Two main questions: 1)How to pick a subset S of the vertices such that at least one vertex in S is also in N(D/3,v’) or N(D/3,u’). 2)How to do it in the CONGEST model ! v’ u’ N(D/3,v’) N(D/3,u’) D

33 Approximation of the diameter.

34 Approximation of the diameter – visualization(cont.) C(s,v) Let w be the vertex with maximum d. w C(s,w) BFS tree

35 Approximation of the diameter – visualization(cont.) C(s,v) G’ Compute dominating set for G’ - M Compute BFS tree for every vertex in M

36 Approximation of the diameter – (cont.) v’ u’ D N(D/3,v’) N(D/3,u’)

37 Approximation of the diameter – (cont.) C(s,v’) V’ Reminder: we considered the graph G’ And constructed dominating set M for G’

38 Approximation of the diameter – (cont.)

39

40 C(s,w) W

41 Approximation of the diameter – (cont.) C(s,w) W

42 Approximation of the diameter – (cont.) C(s,w) w v’

43 Approximation of the diameter – (cont.)

44

45 The main question is how to implement the algorithm in the CONGEST model? we need to show 2 things:CONGEST 1)How to compute C(s,v)? 2) How to compute dominating set M for G’?M

46 Approximation of the diameter – (cont.) Cs(v) w C(s,w)

47 Constructing dominating set M for G’: To construct a dominating set in G’ we are going to construct a subset M of vertices such that for each vertex at least one of its neighbors in G’ is in M. Since all the vertices in C(s,v) are neighbors of v in G’, it is sufficient to pick for each v, one vertex in C(s,v). C(s,v) C(s,u) C(s,w) V U W

48 Constructing dominating set M for G’ (cont.): C(s,v) V

49 Constructing dominating set M for G’ (cont.): Reminder from the second lecture: Union bound:

50 Constructing dominating set M for G’ (cont.):

51

52 Reminder from the second lecture: Chernoff bound:

53

54 Computing C(s,v) for each v: The algorithm operates in cycles: At the i’th cycle, every vertex v notifies its neighbors concerning vertices at distance i-1 from it. The messages are sent according to the id of these vertices in ascending order. Each vertex transmits exactly s messages in total, throughout the entire process.

55 Computing C(s,v) for each v: 51 2 3 4 S = 3 In cycle number 1 each vertex notifies its neighbors about its ID 5 1 1 1 1 2 3 4 Lets focus on vertices 1 and 5 Left messages to send = 2 Vertices at distance 1: {1} Vertices at distance 1: {2,3,4,5} In cycle number 2 each vertex notifies its neighbors about vertices at distance 1 from it 1 2 Left messages to send = 1 3 S closest vertices: {2,3,4} S closest vertices: {1,2,3}

56 Computing C(s,v) for each v:

57

58 Computing Cs(v) for each v: There are at most D cycles, each cycle contains at most s rounds, thus, the running time for computing s-partial-BFS(v) for all the vertices v is O(D*s).) N(i*+1,v) C(v) N(i*,v) v

59 Analysis

60 Summary

61 v’ u’ D Have a great weekend!


Download ppt "Distributed Algorithms for Network Diameter David Peleg, Liam Roditty and Elad Tal."

Similar presentations


Ads by Google