Title: Locality Sensitive Distributed Computing Exercise Set 1
1Locality Sensitive Distributed ComputingExercise
Set 1
- David PelegWeizmann Institute
- Exercises
- Basic complexity considerations
- Global function computation pipeline
- Termination detection for Dijkstras BFS
- Fast DFS
- Tgap in synchronizers a and b
- 3-coloring bounded-degree graphs
- MIS / coloring on unoriented rings
2Basic complexity issues
- 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(dm/k).
3Exercises (cont)
- 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).
4Global function computation
Goal Compute global function f(Xv1,...,Xvn)
where each node v holds input Xv Semigroup
function f 1. Well-defined for any input
subset 2. Associative and commutative ? Efficien
tly computable on tree T by convergecast
5Global 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(Yv) where Yv Xw w ? Tv
- Converge(f,X) process
- Leaf v sends Xv to parent
- Intermediate v with k children w1,...,wk
- - receives values fwi f(Ywi) from all children
- applies fv ? (Xv,fw1,...,fwk)
6Example Addition
105
49
50
13
29
13
29
7Example Maximum
?
?
?
?
?
?
?
8Global function computation
- Claim
- Assume f(Y) is represented in O(p) bits
- for every input set Y
- On tree T
- Message(Converge(f)) ?
- Time(Converge(f)) ?
9Pipelining
Separate broadcast / convergecast operations can
be efficiently pipelined Example Pipelining 3
Converge(max) operations to get Mi max Xi(v)
v leaf for i1,2,3
10Pipelining
11Pipelining
Lemma k global semi-group functions can be
computed on tree in time ?
12Level-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 ?(nDE)
messages.
13Level-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)
14Distributed Depth-First Search
DFS Search process on G, traversing all
vertices, progressing over edges, with preference
to visiting new vertices
15Distributed 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
16Distributed 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)
17Direct 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)
18Direct distributed implementation
? every edge must be explored
? both time and message complexities Q(E)
19Exercise
- 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.
20Synchronizers
Consider a 15-processor asynchronous G(V,E),
V0,,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
21Synchronizers (cont)
- G ring (with nodes arranged in order), v11,
v'2, synchronizer used a. - G full balanced binary tree (4 levels), v
root, v' one of the leaves, synchronizer used
b. - The same as in (2), except both v and v' are
leaves.
22Synchronizers (cont)
- Synchronizer used g.
- Clusters, spanning tree of each cluster,
inter-cluster edges and locations of v, v' are as
follows
23Synchronizer gaps
Gap of synchronizer n Tgap(n) maxv,p
t(v,p1)-t(v,p) (max length of period t(v,p)
that some processor v stays in some pulse p)
Tgap(n)
24Synchronizer gaps (cont)
- How large could Tgap be for
- synchronizer a
- synchronizer b
- synchronizer g
- For synchronizer a, design a scenario realizing
the worst-case waiting time, Tgap(a)
253-coloring bounded-degree graphs
Goal Color arbitrary bounded degree G
(D(G)O(1)) with D1 colors in time O(logn)
26Consistent 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.
27Consistent orientation and MIS
- Show that algorithm might fail if the ring does
not enjoy consistent orientation - Prove that on an anonymous ring (no IDs) without
a consistent orientation, - it is impossible to deterministically 3-color
the nodes, even given an MIS. - 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.)
28Consistent orientation and MIS
- 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). - 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?