Distributed Computing 1. Lower bound for leader election on a complete graph Shmuel Zaks ©

Presentation on theme: "Distributed Computing 1. Lower bound for leader election on a complete graph Shmuel Zaks ©"— Presentation transcript:

Distributed Computing 1. Lower bound for leader election on a complete graph Shmuel Zaks zaks@cs.technion.ac.il ©

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

KMZ

f(n) – maximal number of messages for a complete network of size n Informal proof

n n 1

n n 1 f(n)

nn 1

n n 1 O(n)

A send event is identified with the triple (v,e,m), where v is the node sending message m on edge e. Formal proof v e Given an algorithm, consider only the events of sending messages.

SEND sequence For each execution of the algorithm: SEND = {send 1,send 2,…,send k } 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) = { new 1,new 2,…,new m } is the subsequence of SEND, where each new i 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) a b cd e f 1 4 3 2 a b cd f

1 43 21 43 2 SEND = { NEW = { a m 1 (1,a,m1),

1 43 21 43 2 SEND = {(1,a,m1), NEW = {(1,a,m1), b m 2 (4,b,m2),

1 43 21 43 2 SEND = {(1,a,m1),(4,b,m2), NEW= {(1,a,m1),(4,b,m2), a m 3 (2,a,m3),

1 43 21 43 2 SEND = {(1,a,m1),(4,b,m2),(2,a,m3), NEW= {(1,a,m1),(4,b,m2), d m 4 (4,d,m4)

1 43 21 43 2 SEND = {(1,a,m1),(4,b,m2),(2,a,m3),(4,d,m4), NEW= {(1,a,m1),(4,b,m2),(4,d,m4), f m 5 (2,f,m5),

1 43 21 43 2 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) d m 6 (1,d,m6) 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.

1 43 2 a b d f 1 43 2 a b d In the previous example: NEW ={(1,a,m1),(4,b,m2),(4,d,m4),(2,f,m5)} => G(NEW) is the following graph: 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

For the next axiom: A node cannot distinguish between unused edges

Axiom 3

v e e’ (v,e,m) (v,e’,m)

For the next axiom: So far – EX(A,G) could be empy. For global algorithms …

Axiom 4

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.

Lemma

U V-U

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).

Yes. Ex: give an example!

e(k) e(n) is the lower bound for edge complexity (and therefore for message complexity) of A.

So, we got execution that creates one connected component U of size 2k +1, and With the initial condition of e(1) = 0 we have for n = 2 t – 1:

n n 1 1 0

1 1 0 0 0 1 1 0

References E. Korach, S. Moran and S. Zaks Optimal lower bounds for some distributed algorithms for a complete network of processors, 1987