A nlog(n) lower bound for leader election in a clique

©
Distributed Computing
1. Lower bound for
leader election on a
complete graph
Shmuel Zaks
[email protected]
Model
 Asynchronous network G(V,E)
 |V| = n processors
 G is complete : every two processors
are connected
 Distinct ID’s
 Each processor knows only its ID
The algorithm
 The same algorithm to all processors
 The algorithm includes three types of
actions (events):
 Sending
a massage
 Receiving a massage
 Processing information
Theorem: The message complexity
of the leader election problem
on a complete network is W(n log n).
KMZ
Informal proof
f(n) –
maximal number of messages for a
complete network of size n
We show that
f(2n+1) і 2f(n) + O(n)
This implies that for infinitely many
n's f(n) і c nlogn for some c>0
hence
f(n) = W(n log n)
n
n
1
f(2n+1) і f(n)
n
n
f(n)
1
f(2n+1) і f(n) + f(n)
n
n
1
f(n)
f(2n+1) і f(n) + f(n) + O(n)
n
O(n)
1
n
Formal proof
Given an algorithm, consider only
the events of sending messages.
A send event is identified with the
triple (v,e,m) , where v is the node
sending message m on edge e.
v
e
SEND sequence
 For each execution of the algorithm:
SEND = {send1,send2,…,sendk}
is the sequence of send events that
occurred in the execution, in their
order.
 for each algorithm there are usually
many different executions, thus many
different SEND sequences.
NEW(SEND)
NEW(SEND) = {new1,new2,…,newm}
is the subsequence of SEND, where
each newi is a send event that uses an
unused edge.
(An edge is used if a message has already
been sent along it from either end )
SEND(t) –
the prefix of length t of SEND
NEW(t) –
the prefix in length t of NEW
SEND(t’), for t’>t, is an extension of
SEND(t)
SEND is a completion of SEND(t)
Example
V = (1,2,3,4)
E = (a,b,c,d,e,f)
1
a
d e
4
2
f
b
c
3
(1,a,m1),
m1
1
4
SEND = {
NEW = {
a
2
3
1
2
m2
4
(4,b,m2),
3
b
SEND = {(1,a,m1),
NEW = {(1,a,m1),
m3
1
4
a
2
(2,a,m3),
3
SEND = {(1,a,m1),(4,b,m2),
NEW= {(1,a,m1),(4,b,m2),
1
(4,d,m4)
d
2
m4
4
3
SEND = {(1,a,m1),(4,b,m2),(2,a,m3),
NEW= {(1,a,m1),(4,b,m2),
1
2
f
(2,f,m5),
m5
4
3
SEND = {(1,a,m1),(4,b,m2),(2,a,m3),(4,d,m4),
NEW= {(1,a,m1),(4,b,m2),(4,d,m4),
(1,d,m6)
1
d
2
m6
4
3
SEND =
{(1,a,m1),(4,b,m2),(2,a,m3),(4,d,m4),
(2,f,m5),
NEW =
{(1,a,m1),(4,b,m2),(4,d,m4),(2,f,m5)
end
So we got:
SEND=
{(1,a,m1),(4,b,m2),(2,a,m3),(4,d,m4),(2,f,
m5),(1,d,m6)}
= {send1, send2, send3, send4,
send5, send6}
NEW =
{send1, send2, send4, send5}
SEND(2) = {send1, send2}
NEW(3) = {send1, send2, send4}
SEND(0) = NEW(0) = { }
for every possible execution of A on G
there is NEW.
EX(A,G) is all the prefixes of all
possible NEWs.
Global algorithm
Given G, and an execution,
G(NEW(t)) is the graph with same
nodes but contains only edges that
were used in NEW(t).
Algorithm A is global if for every
execution of A, G(NEW) is connected.
Clearly, algorithm for leader election
must be global.
In the previous example:
NEW
={(1,a,m1),(4,b,m2),(4,d,m4),(2,f,m5)}
=> G(NEW) is the
following graph:
a
1
d
2
f
4
3
b
Can we say that A is a global algorithm?
Axioms
Some axioms hold for every algorithm
A and every graph G (not necessarily
complete).
For the next axiom:
How do we start?
Axiom 1
The empty sequence {} is in EX(A,G).
For the next axiom:
Asynchrony in the network
Axiom 2
If s 1 and s 2 do not
interfere with each other,
and s 1 , s 2 О EX(A,G),
then s 1 Чs 2 О EX(A,G).
s 1 and s 2 do not
interfere with each other
if no two edges in s 1 and s 2
share any endpoint.
For the next axiom:
A node cannot distinguish between
unused edges
Axiom 3
If s О EX(A,G), with a last
element (v,e,m) , and e' is an
used edge adjacent to v,
and s ' is obtained from s
by replacing (v,e,m) by (v,e',m),
then s ' О EX(A,G).
(v,e,m)
e
v
e’
(v,e’,m)
For the next axiom:
So far – EX(A,G) could be empy.
For global algorithms …
Axiom 4
If s О EX(A,G) and C a proper
subset of V containing all the
non-isolated nodes in G(s ),
then there is an extension s '
of s in which the first message
(v,e) in s '-s satisfies v О C.
v
C
Edge complexity, message complexity
The edge complexity e(A) of an algorithm A
(on a graph G) is the maximal length of
NEW, over all possible executions of A.
The message complexity m(A) of an algorithm
A (on a graph G) is the maximal length of
SEND, over all possible executions of A.
m (A) і e (A)
Lemma
Let A be a global algorithm for a complete
graph G(V,E), and let ЖМU МV .
№
№
Then there exists s О EX(A,G) such that
G( s ) has one connected component whose
set of vertices is U , and the vertices in
V-U are isolated
s
U
V-U
start with s =Ж.
repeat
extend the execution
s by a message from a node
in U (by axiom 4)
to a node in U (by axiom 3) .
until G(s ) contains one conected
component, whose vertices are U.
Extend s until the execution terminates
s
U
V-U
e(U)
By the lemma, for every subset U of V we can
find at least one execution of A that will
first make U a connected component and
leave all other nodes isolated.
From all the executions that do so we will
choose the one that uses the maximal
number of edges, and denote that number
e(U).
Is it possible that U=U'
but e(U) № e(U') ?
Yes.
Ex: give an example!
e(k)
e(k)= min(e(U)| U Н V, |U|=k)
e(n) is the lower bound for edge
complexity (and therefore for message
complexity) of A.
Claim:
n
For k< :
2
e(2k+1) і 2e(k) + k + 1
Proof:Let U be a disjoint union
U=U1 И U2 И {v }
s.t. |U1 |= |U2|=k and e(U)=e(2k+1).
So, we got execution that creates one
connected component U of size 2k +1, and
e (U ) і e (2k + 1) і 2e (k ) + k + 1
With the initial condition of e(1) = 0 we have
for n = 2t – 1:
1
n+1
e (n ) і
(n + 1)log(
) = W(n log n )
2
2
Ю e (m ) = W(n log n )
hence, finding a leader,
or a spanning tree, is W(n log n)
Also shown:
finding a minimum spanning tree
is W(n 2 )
n
n
0
1
1
0
1
1
1
0
0
0
1
References
E. Korach, S. Moran and S. Zaks
Optimal lower bounds for some distributed
algorithms for a complete network of
processors, 1987