![Page 1: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/1.jpg)
Building MST with Õ(n) bits of communication in a Distributed Network
1
Valerie King, University of VictoriaJoint work with Mikkel Thorup and Shay Kutten
![Page 2: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/2.jpg)
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
![Page 3: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/3.jpg)
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
![Page 4: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/4.jpg)
A network maintains a subgraph if its edges are marked by their
endpoints
J
H
G
F
C
D EA
![Page 5: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/5.jpg)
ST (or MST) Problem: Build a tree or MST
G
F
C
D EA
![Page 6: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/6.jpg)
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
![Page 7: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/7.jpg)
“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”
![Page 8: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/8.jpg)
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
![Page 9: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/9.jpg)
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
![Page 10: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/10.jpg)
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
![Page 11: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/11.jpg)
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
![Page 12: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/12.jpg)
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.
![Page 13: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/13.jpg)
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
![Page 14: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/14.jpg)
Basic problem:find edge leaving a marked tree
in a marked forest
G
F
C
D EA
![Page 15: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/15.jpg)
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
![Page 16: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/16.jpg)
Ideas came from
• Dynamic Connectivity data structure Kapron, King, Mountjoy 2013
• Graph Sketching Ahn, Guha, McGregor 2012• Sitting in Simons Institute
![Page 17: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/17.jpg)
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)
![Page 18: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/18.jpg)
We use: basic communication step:broadcast-and-echo over known tree edges
J
H
G
F
C
D EA
![Page 19: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/19.jpg)
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
![Page 20: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/20.jpg)
• 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
![Page 21: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/21.jpg)
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
![Page 22: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/22.jpg)
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
![Page 23: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/23.jpg)
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
![Page 24: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/24.jpg)
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
![Page 25: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/25.jpg)
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.
![Page 26: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/26.jpg)
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.
![Page 27: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/27.jpg)
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
![Page 28: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/28.jpg)
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…
![Page 29: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/29.jpg)
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
![Page 30: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/30.jpg)
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
![Page 31: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/31.jpg)
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.
![Page 32: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/32.jpg)
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)
![Page 33: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/33.jpg)
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
![Page 34: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/34.jpg)
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
![Page 35: Building MST with Õ(n) bits of communication in a Distributed Network Building MST with Õ(n) bits of communication in a Distributed Network 1 Valerie King,](https://reader030.vdocuments.us/reader030/viewer/2022032800/56649d305503460f94a08ffb/html5/thumbnails/35.jpg)
“Impromptu”=Only local info maintained by
node betw updates
J
H
G
F
C
D EA