20
1 Distributed Asynchronous Bellman-Ford Algorithm

1 Distributed Asynchronous Bellman-Ford Algorithm

Embed Size (px)

Citation preview

Page 1: 1 Distributed Asynchronous Bellman-Ford Algorithm

1

Distributed Asynchronous Bellman-Ford Algorithm

Page 2: 1 Distributed Asynchronous Bellman-Ford Algorithm

12-2 Topics

Shortest-Path Algorithms: Bellman-Ford Dijkstra Floyd-Warshall

Distributed Asynchronous Bellman-Ford Algorithm

Page 3: 1 Distributed Asynchronous Bellman-Ford Algorithm

12-3 Shortest-Path Routing

Shortest path routing: packets are delivered from source to destination along the shortest path from S to D

Shortest path from every node i to destination 1 can be found using the Bellman-Ford algorithm

Shortest paths are recomputed periodically, as link lengths might change over time due to:

varying traffic conditions link failures and repairs

Shortest-path algorithm can be implemented as: Centralized: all computations are performed by a single network entity and

the shortest-path updates are communicated to all nodes Decentralized or Distributed: each node performs part of the computation

task in order to determine its own distance from node 1 and its corresponding outgoing link

Page 4: 1 Distributed Asynchronous Bellman-Ford Algorithm

12-4 Computation of Shortest Paths

Assumptions: All cycles have positive length Strongly connected network: if (i, j) is a link, then (j, i) is also a link

Problem: find the shortest distance Di from each node i to destination 1

These shortest distances are the unique solution of Bellman’s equation

where N(i) is the set of neighbors of i – nodes j for which link (i, j) exists Bellman-Ford algorithm:

We established convergence to the correct shortest distances for initial conditions:

( )

1

min{ }, 1

0

i ij jj N i

D d D i

D

1

( )1

1

min{ }, 1

0

h hi ij j

j N ih

D d D i

D

0

01

, 10

iD iD

Page 5: 1 Distributed Asynchronous Bellman-Ford Algorithm

12-5 Distributed Computation of Shortest Paths

Bellman-Ford iteration can be executed at node i in parallel with every other node

Distributed computation of shortest paths. Node i

Knows the length dij of each outgoing link (i, j)

Receives the estimates Djh from each neighbor jN(i)

Updates its shortest distance estimate according to the Bellman-Ford Iteration

Communicates the new estimate Dih+1 to all nodes k, for which iN(k)

Each node computes its own shortest distance based only on local information: lengths of its outgoing links shortest distance estimates for each of its neighbors

1

( )1

1

min{ }, 1

0

h hi ij j

j N ih

D d D i

D

Page 6: 1 Distributed Asynchronous Bellman-Ford Algorithm

12-6 Distributed vs. Centralized Network Algorithms

Reduced computational complexity

Local vs. global information

Scalability as the “size” of the network increases: addition of a node does not increase the computational load for the other nodes

Survivability: if a node fails and no longer performs the algorithm, the computation is curried by the remaining nodes and the network remains operational

Convergence: does the distributed algorithm converge to the correct solution? How fast?

Efficiency: distributed versions of “optimal” network algorithms – flow control, routing – lead in suboptimal solutions

Page 7: 1 Distributed Asynchronous Bellman-Ford Algorithm

12-7

Distributed Algorithms: Synchronous vs. Asynchronous

Distributed Bellman-Ford algorithm:

Synchronous Implementation: the nodes update their distance estimates in an orderly, predetermined manner. For instance:

Each iteration h is executed simultaneously by all nodes Node i updates Dih using shortest distance estimates Djh-1 from the previous iteration Iteration h+1 starts only after every node i has executed iteration h and has updated its

shortest distance estimate Dih

Asynchronous Implementation: There is no predetermined manner according to which the nodes update their distance estimates. A node does not necessarily have the latest updates for the estimates for all its neighbors. Some nodes might not update their estimates immediately after they receive updates from their neighbors.

1

( )1

1

min{ }, 1

0

h hi ij j

j N ih

D d D i

D

Page 8: 1 Distributed Asynchronous Bellman-Ford Algorithm

12-8

Distributed Algorithms: Synchronous vs. Asynchronous

Synchronous Bellman-Ford algorithm:

with initial conditions:

Terminates after at most N iterations

with, each node i knowing both its shortest distance Di and its outgoing link on the shortest path to node 1

“Synchronization” mechanisms:

Getting all nodes to agree to start the algorithm with the appropriate initial conditions

Abort and restart the algorithm – e.g., when the length of a link changes

Complexity indicates that the centralized algorithm is preferable to the synchronous distributed version

Asynchronous Implementation:

No need to synchronize the nodes

Does not require specific initial conditions

1

( )1

1

min{ }, 1

0

h hi ij j

j N ih

D d D i

D

0

01

, 10

iD iD

Page 9: 1 Distributed Asynchronous Bellman-Ford Algorithm

12-9 Asynchronous Bellman-Ford Algorithm

Operates indefinitely, by executing from time to time at each i≠1 iteration:

Dj: last estimate received from neighbor

dij: latest known length of outgoing link (i, j)

Node i transmits from time to time its latest estimate Di to all its neighbors Neither the iterations, nor the transmission of updates need be synchronized No assumptions are made on the initial values of Dj, jN(i) available at node i

Under a set of rather general assumptions the asynchronous Bellman-Ford algorithm finds the correct shortest distance of every node within finite time

If a number of changes in the link lengths occur up to time t0 and no other changes occur subsequently, the algorithm finds the shortest distances within finite time from t0. It is not necessary to re-initialize the algorithm after each link length change

( )min{ }i ij jj N i

D d D

Page 10: 1 Distributed Asynchronous Bellman-Ford Algorithm

12-10 Asynchronous Bellman-Ford Algorithm

Assume that the lengths of all links are constant after time 0t

Node i has available the length ijd of every link ( , ),i j where ( )j N i

( ) :ijD t estimate of the shortest distance of ( )j N i which was last (before t) communicated

to node i

( ) :iD t estimate of the shortest distance of node i computed last (before t) based on the

Bellman-Ford iteration

Distance estimates for node 1:

1 0

1 0

( ) 0,

( ) 0, , and such that 1 ( )i

D t t t

D t t t i N i

Distance estimates are changed at times: 0 1 2, , ,...t t t , where

0 1 2 ..., and mt t t t

Page 11: 1 Distributed Asynchronous Bellman-Ford Algorithm

12-11 Asynchronous Bellman-Ford Algorithm

At each time such time mt one of three events happens at node i≠1 :

1. Node i updates ( )iD t according to

( )

( ) : min{ ( )}i ij jj N i

D t d D t

and leaves estimates ( ), ( ),ijD t j N i unchanged

2. Node i receives from some ( )j N i the value of jD computed at j at some earlier time,

updates ( )ijD t and leaves all other estimates unchanged

3. Node i is idle and all its available estimates remain unchanged

:iT set of times mt at which node i updates ( )iD t – event 1 occurs at the node

:ijT set of times mt at which an update is received at node i from node j – as in event 2

Assumption 1: Nodes never stop updating their own estimates or receiving messages from their neighbors – i.e., and i i

jT T have an infinite number of elements

Assumption 2: Old distance information is eventually updated within finite time – i.e., given any time 0t t , there exists time t t , such that the estimate of jD received by any neighbor i

has been computed at node j after time t

Page 12: 1 Distributed Asynchronous Bellman-Ford Algorithm

12-12 Asynchronous Bellman-Ford Algorithm

Theorem: Consider the asynchronous Bellman-Ford algorithm for a network where all cycles have positive length. For every node i≠1, the initial estimates 0( )iD t and 0( ), ( )i

jD t j N i are

arbitrary numbers. Under Assumptions 1 and 2, there exists some time Mt such that

( ) , , 2,3,...,i i MD t D t t i N

Proof Outline:

1. Construct for every node i two sequences { : 0}, and { : 0}k ki iD k D k , such that:

1k k

i iD D – increasing sequence

1k k

i iD D – decreasing sequence

, 0k ki i iD D D k

0,k ki i iD D D k k

2. Choose the sequences in (1), so that the estimate ( )iD t determined by the asynchronous

Bellman-Ford algorithm is bounded between and k ki iD D , i.e., for any k, there exist t(k):

( ) , ( )k ki i iD D t D t t k

Page 13: 1 Distributed Asynchronous Bellman-Ford Algorithm

12-13 Asynchronous Bellman-Ford Algorithm

kiD

1kiD

1kiD

kiD

iD

1 1

0,

k k k ki i i i i

k ki i i

D D D D D

D D D k k

0iD

0iD

Page 14: 1 Distributed Asynchronous Bellman-Ford Algorithm

12-14 Asynchronous Bellman-Ford Algorithm

kiD

1kiD

1kiD

kiD

iD

( )t k ( 1)t k

( )iD t

t

( ) , ( )k ki i iD D t D t t k

Page 15: 1 Distributed Asynchronous Bellman-Ford Algorithm

12-15 Asynchronous Bellman-Ford Algorithm

Step 1: Construction of sequences{ : 0}, and { : 0}k ki iD k D k

Each sequence is generated by the Bellman-Ford iteration for a given set of initial conditions

Choose initial conditions 0 0 , all i i iD D D i

Show that both sequences converge to the same solution – the correct shortest distances – after a finite number of iterations

Monotonicity: from the monotonicity property of the Bellman-Ford iteration

Lemma 1 [Monotonicity of Bellman-Ford Iteration]:

1. If , for all ( ),j j j N i then ( ) ( )

min{ } min{ }ij j ij jj N i j N i

d d

2. Let { : 1}kiD k be the sequence generated by the B-F iteration with initial conditions

0 , 1,2,...,iD i N . Then:

0 1 1

0 1 1

, , ,

, , ,

k ki i i i

k ki i i i

D D i D D k i

D D i D D k i

Page 16: 1 Distributed Asynchronous Bellman-Ford Algorithm

12-16 Asynchronous Bellman-Ford Algorithm

Step 1: Construction of sequences{ : 0}, and { : 0}k ki iD k D k

Bellman-Ford algorithm:

1

( )

11

min{ }, 1

0

k ki ij j

j N i

k

D d D i

D

, 1,..., :kiD i N k-th iterate of the algorithm with initial condition:

0

01

, 1

0

iD i

D

, 1,..., :kiD i N k-th iterate of the algorithm with initial condition:

0

01

, 1

0

i iD D i

D

where 0 is sufficiently large, so that 0iD is less than:

1. initial estimates 0( )iD t and 0( ), ( )ijD t j N i

2. all estimates of iD communicated before 0t that will be received by its neighbors after 0t

Page 17: 1 Distributed Asynchronous Bellman-Ford Algorithm

12-17 Asynchronous Bellman-Ford Algorithm

Lemma 2: Sequences { : 0}, and { : 0}k ki iD k D k defined above satisfy:

1. 1, 0k ki iD D k

2. 1, 0k ki iD D k

3. , 0k ki i iD D D k

4. 0,k ki i iD D D k k

Proof:

1. 0 1 1, 0k ki i i iD D D D k [Lemma 1]

2. 0 1 1, 0k ki i i i i iD D D D D D k [Lemma 1]

3. Initial conditions 0 0 ,i i iD D D and the monotonicity of the B-F iteration imply

, 0k ki i iD D D k

4. The convergence analysis of the standard Bellman-Ford algorithm with initial conditions

0 01, 1; 0iD i D

established that for all i:

, 1ki iD D k N

To complete the proof we need to show that ,ki iD D for k sufficiently large.

Page 18: 1 Distributed Asynchronous Bellman-Ford Algorithm

12-18 Asynchronous Bellman-Ford Algorithm

To complete the proof we need to show that ,ki iD D for k sufficiently large. But for all k:

0( , )ki jD L i k D

where ( , )L i k is the length of a walk of at most k hops from i to j. Let ( , )n i k be the number of links of that walk. Note that as k , ( , )n i k must be bounded. Indeed if ( , )n i k the walk contains an infinite number of cycles, each with positive length, in which case

( , ) kiL i k D

which is a contradiction, since ,ki iD D for all k.

Since ( , )n i k is bounded, there is only a finite number of values that kiD can take, for all

1,2,..., , and 0,1,...i N k In view of monotonicity property (1), this implies that there exists some h, such that:

1 ,h hi iD D i

Therefore, hiD satisfy Bellman’s equation, which has a unique solution when the length of

any cycle is positive. Therefore: , ,k

i iD D i k h

Page 19: 1 Distributed Asynchronous Bellman-Ford Algorithm

12-19 Asynchronous Bellman-Ford AlgorithmLemma 3: For every k, there exists a time t(k), such that for all t ≥ t(k):

( ) , 2,...,

( ) , 2,..., , ( )

k ki i i

k i kj j j

D D t D i N

D D t D i N j N i

and for all , ( ) :ijt T t t k

( ) , 2,..., , ( )k i i kj j j jD D t D i N j N i

where ( )ij t was the last time estimate ( )i

jD t was computed at node j.

Proof: By induction. The result holds for k=0, with t(0) = t0, due to the appropriate chose of initial conditions – sufficiently large δ in step 1. Assuming that the result holds for any k, we will show that there exists t(k+1) with the required properties. The second inequality implies that for any , ( ) :it T t t k

( ) ( ) ( )

1 1

min{ } min{ ( )} min{ }

( )

k i kij j ij j ij jj N i j N i j N i

k ki i i

d D d D t d D

D D t D

Let ( )t k be the smallest , with ( ) :it T t t k

1 1( ) , , ( )k ki i iD D t D i t t k

Page 20: 1 Distributed Asynchronous Bellman-Ford Algorithm

12-20 Asynchronous Bellman-Ford Algorithm

Let ( )t k be the smallest , with ( ) :it T t t k

1 1( ) , , ( )k ki i iD D t D i t t k

Since ( ) , as ij t t , we can choose time ( 1) ( ),t k t k so that ( ) ( )i

j t t k for all

, ( ),i j N i and ( 1).t t k Then for all ( 1) :t t k

1 1

1 1

( ) , 2,...,

( ) , 2,..., , ( )

k ki i i

k i kj j j

D D t D i N

D D t D i N j N i

and for all , ( 1) :ijt T t t k

1 1( ) , 2,..., , ( )k i i kj j j jD D t D i N j N i