building mst with Õ(n) bits of communication in a distributed network building mst with Õ(n) bits...
TRANSCRIPT
Building MST with Õ(n) bits of communication in a Distributed Network
1
Valerie King, University of VictoriaJoint work with Mikkel Thorup and Shay Kutten
Network with n nodes, m edges Each node has local info: incident edges, wts,neighbors’ IDs Nodes have distinct IDs in [1,…,nc]
G
F
C
D EA
CONGEST model
Communication: Each node may send (different) messages of size O(log n ) to all its neighbors in a single step. Synchronous vs. Asynchronous
F
C
D EA
A network maintains a subgraph if its edges are marked by their
endpoints
J
H
G
F
C
D EA
ST (or MST) Problem: Build a tree or MST
G
F
C
D EA
Classic Result:1983: MST with O(m + nlogn)
messages
Gallager, Humblet and Spira (JACM)
• asychronous• works if starting with any number of nodes
wake• time O(n2), or O(n log n) if all nodes wake at
start
“Folk Theorem” Auerbuch, Goldreich, Peleg, Vainish( JACM 1990)
“If each proc knows only its ID and the IDs of its neighbors, then flooding is the best that can be done”
Auerbuch, Goldreich, Peleg, Vainish( JACM 1990)show:
Constructing a spanning tree requires Ω(m) messages
Even if• synchronous• nodes are all awake at the start• alg is Monte Carlo• nodes know the IDs of their immediate
neighbour• nodes know n, size of the network
Provided…
Constructing a spanning tree requires Ω(m) messages
Even if• synchronous• nodes are all awake at the start• alg is Monte Carlo• nodes know the IDs of their immediate
neighbour• nodes know the size of the network
• Provided IDs can only be compared
Without proviso, they show
Constructing a spanning tree requires Ω(m) messages
Even if• synchronous• nodes are all awake at the start
• alg is deterministic• the nodes know the IDs of their immediate
neighbour• nodes know the size of the network
• ID space is super poly
Another Lower BoundKutten, Pandurangan, Peleg, Robinson, Trehan (PODC2013)
Constructing a tree requires Ω(m) messages
Even if• synchronous• nodes are all initialized at the start• alg is Monte Carlo • nodes do not know the IDs of their
immediate neighbours• nodes know the size of the network
This workAn MST can be constructed in Õ(n) bits of communication and time (and O(log n) bits space per node) if • synchronous • the nodes are all initialized at the start• the alg is Monte Carlo • nodes know the IDs of their
immediate neighbours• nodes know n ?• Using operations which combine IDs.
The algorithm
Boruvka style parallel alg with lg n phases:• In each phase, w.h.p. each component finds
the lightest edge incident to it and merges.• Communications, Time of phase ~Õ(n)• Start a new phase only after time to finish
processing the largest cluster has passed.• End when no progress after log n tries
Basic problem:find edge leaving a marked tree
in a marked forest
G
F
C
D EA
Also solves MST updating problemPrevious method requires lots of memory
O(n) amortized messages per updateAwerbuch, Cidon, Kutten:1990, 2008
Local memory=O(n* degree of node*logn)(Each node stores a belief about each neighbor’s version of the forest (!))
Here we use only O(log n) local memory
Ideas came from
• Dynamic Connectivity data structure Kapron, King, Mountjoy 2013
• Graph Sketching Ahn, Guha, McGregor 2012• Sitting in Simons Institute
ideas from that work
1. Σ v in C deg(v) mod 2
= Σ e in ( C, V\C) deg(v) mod 2
because edges with both endpoints in C contribute 0. 2. If edges randomly sampled
Pr( Σ deg(v) mod 2 =1) = ½ iff (C,V\C) is nonempty
Else it’s always 0.3. XOR of edge names = name of edge leaving if there is exactly 1(Note: Edge name {u,v}=(u,v) iff u<v)
We use: basic communication step:broadcast-and-echo over known tree edges
J
H
G
F
C
D EA
We use: basic communication step:broadcast-and-echo over tree edges
J
H
G
F
C
D EA
Leader node sends to whole tree, Response composed from leaves back up to leader
• Find any edge leaving a componentuses O(1) expected broadcast-and echoes
• Find min-weight edge leaving a componentuses O(log n/loglog n) expected broadcast-and-echoes
Find Any: Parallel search packed in one word
• U ={edges}• Leader randomly chooses h, a 2-wise indep hash
h : U U
• Each node v computes b(v)= b 1 b 2 … b log n
bi(v) =| {(u,v) s. t. h(u,v) ≤ 2i}| mod 2
e.g. parity of hashed values in each range.
Hashed values
1 2 4
Find Any (cont’d):
1. XOR the b(v) over nodes v in tree
2. min first i ≠0
3. XOR names of edges incident to all v in tree with
h(edge) ≤ 2min
4. With constant prob, there is exactly one such edge which is leaving.
XOR =Name of edge leaving
Findmin weight edge leaving
Two Tests to see if there is an edge leaving a comp:
1. Constant prob. Test out: 1 broadcast, 1 1-bit echo2. High prob. HP-Test out: 1 broadcast, 1 log n-bit
echo
Findmin weight edge leaving
1. In parallel, with 1 Broadcast-and-echo
do log n-wise search on weights with
TestOut ‘s to find smallest wt interval
2. Verify its minimality with HP TestOut
3. Repeat if wrong or recurse on that interval
Testout
randomly choose a function F: edges{0,1}
s.t. for a nonempty set S, w. constant prob. >0, an ODD number of S’s elements map to 1.
Simple F (Thorup)
F has two parts,• a 2-wise indep.hash function
h: U U• t, a random element of U
F(s)=1 iff h(s) < t
F can be described in O(log |U|) bits.
Why it works
• h hashes UU, S subset of U• Imagine 2|S| equal sized intervals.
Exactly one x in I, in middle third
t lands in some I, in top third or bottom third
HP TestOut
• Repeat Testout in parallel O(log n) times to get prob error 1/nc ?
• Would need to send clog n hash functions
Or use deterministic amplification
Or…
Test 2: Set equality method to get HP-TestOut
A tree T is maximal iff
the set Out(T) of edges leaving all nodes in T
= the set In(T) of edges entering all nodes
in T
Test equality of two sets usingpolynomial ID-testing
O(log n) bits of communication
f(x)=Πa in Out (x-a)
g(x)=Πb in In (x-b)
Does f(x)=g(x)?
(Schwartz-Zippel):
Set x=random α in Zp, p be a prime, p > nc+2
compute over Zp:
Pr(f(α)-g(α))=0 if In ≠ Out
= Pr [α= root]
= #roots/p< n2 / p = 1/nc
Implementation (1 broadcast-and-echo)
• Leader broadcasts α
• Each node v computes fv(α) and gv(α) for its incident edges
• Starting at the leaves, pass to parent
fv(α) * πc fc(α), c child of v
g is computed similarly• Leader (root) computes f-g.
– If 0, Testout is true, else false.
In short
• build an MST in O(n log2 n/loglog n) messages and time.
• Can we build a ST in O(n log n) messages and time?
• repair an ST in O(n) expected message• repair an MST in O(n log/log log n)
messages w.h.p.
All using local memory O(log n)
Open problem and discussion
• Is Ω(m) communication required for building MST in asynchronous model?
• Lower bound for findmin• Time v. communication tradeoffs• Applications to map reduce etc.
• Thank you
Open problem and discussion
• Is Ω(m) communication required for building MST in asynchronous model?
• Lower bound for findmin• Time v. communication tradeoffs• Applications to map reduce etc.
• Thank you
“Impromptu”=Only local info maintained by
node betw updates
J
H
G
F
C
D EA