28
Locality Sensitive Distributed Computing Exercise Set 1 David Peleg Weizmann Institute Exercises Basic complexity considerations Global function computation + pipeline Termination detection for Dijkstra’s BFS Fast DFS T gap in synchronizers and 3-coloring bounded-degree graphs MIS / coloring on unoriented rings

Locality Sensitive Distributed Computing Exercise Set 1

  • Upload
    javier

  • View
    36

  • Download
    3

Embed Size (px)

DESCRIPTION

Locality Sensitive Distributed Computing Exercise Set 1. David Peleg Weizmann Institute. Exercises Basic complexity considerations Global function computation + pipeline Termination detection for Dijkstra’s BFS Fast DFS T gap in synchronizers a and b 3-coloring bounded-degree graphs - PowerPoint PPT Presentation

Citation preview

Page 1: Locality Sensitive Distributed Computing Exercise Set 1

Locality Sensitive Distributed Computing

Exercise Set 1David Peleg

Weizmann Institute

Exercises• Basic complexity considerations• Global function computation + pipeline• Termination detection for Dijkstra’s BFS• Fast DFS• Tgap in synchronizers and • 3-coloring bounded-degree graphs• MIS / coloring on unoriented rings

Page 2: Locality Sensitive Distributed Computing Exercise Set 1

Basic complexity issues

1. Prove or disprove:In a graph G(V,E),if there are at least k edge-disjoint paths of length d between the nodes v and w,then it is possible to send m msgs from v to w in time O(d+m/k).

Page 3: Locality Sensitive Distributed Computing Exercise Set 1

Exercises (cont)

2. Prove or disprove:In a graph G(V,E),if dist(v,w)=k and there are k2 edge-disjoint paths between the nodes v and w,then it is possible to send k2 msgs from v to w in time O(k).

Page 4: Locality Sensitive Distributed Computing Exercise Set 1

Global function computationGoal: Compute global function f(Xv1,...,Xvn) where each node v holds input Xv

Semigroup function f:1. Well-defined for any input subset2. Associative and commutative

Efficiently computable on tree T by convergecast

Page 5: Locality Sensitive Distributed Computing Exercise Set 1

Global function computation

During the process: The value sent upwards by each v in T= value of function on inputs of its subtree Tv

fv = f(v) where v = { Xw | w Tv }

Converge(f,X) process• Leaf v sends Xv to parent

• Intermediate v with k children w1,...,wk

- receives values fwi = f(wi) from all children

- applies fv (Xv,fw1,...,fwk)

Page 6: Locality Sensitive Distributed Computing Exercise Set 1

Example: Addition

13

105

49

291329

50

Page 7: Locality Sensitive Distributed Computing Exercise Set 1

Example: Maximum

?

?

? ? ?

?

?

Page 8: Locality Sensitive Distributed Computing Exercise Set 1

Global function computation

Claim:Assume f() is represented in O(p) bitsfor every input set

On tree T:

• Message(Converge(f)) = ?

• Time(Converge(f)) = ?

Page 9: Locality Sensitive Distributed Computing Exercise Set 1

Pipelining

Separate broadcast / convergecast operations can be efficiently pipelined

Example: Pipelining 3 Converge(max) operations to get Mi = max {Xi(v) | v leaf } for i=1,2,3

Page 10: Locality Sensitive Distributed Computing Exercise Set 1

Pipelining

Page 11: Locality Sensitive Distributed Computing Exercise Set 1

Pipelining

Lemma:k global semi-group functions can be computed on tree in time ?

Page 12: Locality Sensitive Distributed Computing Exercise Set 1

Level-synchronized BFS (Dijkstra)

Q. Prove the tightness of the message complexity analysis of Dijkstra's algorithm, by establishing the following:

Lower bound:For integers n and 1 D n-1, there exists n-node, D-diameter graph G=(V,E) on which the execution of Dijkstra's algorithm requires (nD+|E|) messages.

Page 13: Locality Sensitive Distributed Computing Exercise Set 1

Level-synchronized BFS (Dijkstra)

Termination detection:Modify the Distributed Dijkstra algorithm so that the root can tell when the process is completed (and the entire graph is spanned by the constructed BFS tree)

Page 14: Locality Sensitive Distributed Computing Exercise Set 1

Distributed Depth-First Search

DFS: Search process on G, traversing all vertices, progressing over edges, with preference to visiting new vertices

Page 15: Locality Sensitive Distributed Computing Exercise Set 1

Distributed Depth-First Search

DFS algorithm• Search starts at origin v0 • Whenever search reaches vertex v:

- If v has neighbors not visited so far, then visit one of them next.- Else return to the vertex

from which visited first- If v = v0 then end

Page 16: Locality Sensitive Distributed Computing Exercise Set 1

Distributed Depth First Search

Fact: DFS process visits every vertex in G.

Search defines DFS tree, with v0 as root:• v's parent = node from which v was visited first

Sequential time complexity = O(|E|)

Page 17: Locality Sensitive Distributed Computing Exercise Set 1

Direct distributed implementation

- Completely sequential: one activity locus at any time. - Control carried via single message (“token”) traversing G in depth-first fashion

Note: For v to know whether neighbor w was visited or not,it must send message over edge (v,w)

Page 18: Locality Sensitive Distributed Computing Exercise Set 1

Direct distributed implementation

every edge must be explored

both time and message complexities = (|E|)

Page 19: Locality Sensitive Distributed Computing Exercise Set 1

Exercise

Q.• Modify the DFS algorithm to allow the traveler

to complete the tour (visiting all nodes) faster than O(|E|).

• Analyze the time complexity of the modified algorithm and prove your bound.

Page 20: Locality Sensitive Distributed Computing Exercise Set 1

Synchronizers

Consider a 15-processor asynchronous G(V,E), V={0,…,14}, constantly running a synchronizer.v, v' = nodes in G. At time t, pulse counter Pv = 27.

What is the range of possible pulse numbers at Pv' in following cases:

Page 21: Locality Sensitive Distributed Computing Exercise Set 1

Synchronizers (cont)

1. G = ring (with nodes arranged in order), v=11, v'=2, synchronizer used = .

2. G = full balanced binary tree (4 levels), v = root, v' = one of the leaves, synchronizer used =

3. The same as in (2), except both v and v' are leaves.

Page 22: Locality Sensitive Distributed Computing Exercise Set 1

Synchronizers (cont)

4. Synchronizer used = . Clusters, spanning tree of each cluster, inter-cluster edges and locations of v, v' are as follows:

Page 23: Locality Sensitive Distributed Computing Exercise Set 1

Synchronizer gaps

Gap of synchronizer Tgap() = maxv,p {t(v,p+1)-t(v,p)}

(max length of period (v,p) that some processor v stays in some pulse p)

Tgap()

Page 24: Locality Sensitive Distributed Computing Exercise Set 1

Synchronizer gaps (cont)

1. How large could Tgap be for :a. synchronizerb. synchronizerc. synchronizer

2. For synchronizer , design a scenario realizing the worst-case waiting time, Tgap()

Page 25: Locality Sensitive Distributed Computing Exercise Set 1

3-coloring bounded-degree graphs

Goal: Color arbitrary bounded degree G ((G)=O(1))

with +1 colors in time O(log*n)

Page 26: Locality Sensitive Distributed Computing Exercise Set 1

Consistent orientation and MIS

Consistent orientation: the ring edges are oriented in a consistent manner(each node identifies its “left” and “right” neighbors, and each edge e = (v,w) is marked as going “left” by one of its endpoints and as going “right” by the other.

We have seen: Given an MIS on the ring, the nodes can be colored with 3 colors in a single round.

Page 27: Locality Sensitive Distributed Computing Exercise Set 1

Consistent orientation and MIS(a) Show that algorithm might fail if the ring

does not enjoy consistent orientation(b) Prove that on an anonymous ring (no ID’s)

without a consistent orientation,it is impossible to deterministically 3-color the nodes, even given an MIS.

(c) Prove that on a non-anonymous ring without a consistent orientation, it is still possible to deterministically 3-color the vertices in a constant number of rounds given an MIS. (Try to use the smallest number of rounds.)

Page 28: Locality Sensitive Distributed Computing Exercise Set 1

Consistent orientation and MIS(d) What lower bound can be proved for the

number of rounds required for computing MIS on a ring without consistent orientation? Specify precise constants (not only asymptotic lower bound).

(e) What is the smallest n for which the lower bound you got in the previous question is greater than 1? What is the smallest n for which the lower bound on 3-coloring is greater than 1?