You are on page 1of 9

Shortest Path Algorithms: Part 4

Gaurav S. Kasbekar
Dept. of Electrical Engineering
IIT Bombay

1-1
References
1) Slides by Kurose and Ross available at:
http://ctas.poly.asu.edu/millard/CET459/lectno/K%
20-%20R%20stuff/index.html
2) Bertsekas and Gallager, Chapter 5.

1-2
Recall: Bellman’s Equation
 Let D(v): cost of shortest path from v to u
 Shortest path costs satisfy 𝐷 𝑣 =
𝑚𝑖𝑛𝑤 (𝑐 𝑣, 𝑤 + 𝐷 𝑤 )
 called Bellman’s equation
 Bellman’s equations (along with D(u) = 0) can be
viewed as a system of N equations in N unknowns
 If all cycles have positive cost, then this system
has a unique solution (shortest path costs)
 Basis behind distributed implementation of
Bellman-Ford

5-3
Distributed Asynchronous
Bellman-Ford Algorithm
Assumptions:
1) If link (v,w) exists, then link (w,v) also
exists
2) All link costs are positive

5-4
Distributed Asynchronous Bellman-Ford Algorithm
 Each node v maintains D(v): current estimate of
cost of shortest path from itself to destination u
 D(u) = 0 (does not change)
Algorithm at Node vu:
 Initialization: D(v) = c(v,u) if edge (v,u) exists,
else ∞. Node v sends D(v) to each of its
neighbors
 Whenever an estimate D(.) is received from a
neighbor:
1) Update D(v) using D v = 𝑚𝑖𝑛𝑤 (𝑐 𝑣, 𝑤 + 𝐷 𝑤 )
2) If D(v) changes, node v sends updated value to
each neighbor
Example
D(v) D(w) D(x) D(y) D(z)
1    6
2
3
4
5

D(v) D(w) D(x) D(y) D(z) D(v) D(w) D(x) D(y) D(z)
1    6 1    6
7 2
8 7
2 3
3 4
4 5
5
Convergence to Shortest Path
Costs
 Theorem: The estimates D(v) at all nodes
converge to the correct shortest path
costs 𝐷∗ v after execution of a finite
number of updates and do not change
thereafter
 true regardless of the order in which
different nodes perform updates and
exchange messages
 After convergence, the minimizers w in the
update equation provide shortest paths

5-7
Uniqueness of Solution to System of
Bellman’s Equations
1) 𝐷 v = 𝑚𝑖𝑛𝑤 𝑐 𝑣, 𝑤 + 𝐷 𝑤 , 𝑣 ≠ 𝑢
2) 𝐷 𝑢 =0
 Theorem: If all cycles have positive costs, then above
system has a unique solution (the shortest path costs 𝐷 ∗ v )
Proof:
❑ For each 𝑣 ≠ 𝑢, let 𝑤𝑣 be a node that achieves the minimum
in 1)
 Lemma: The sub-graph consisting of the 𝑁 − 1 edges
𝑣, 𝑤𝑣 , 𝑣 ≠ 𝑢, is a spanning tree, say 𝑇, that connects every
node 𝑣 to node 𝑢
 The cost of the path in 𝑇 that connects 𝑣 to 𝑢 is:
 𝐷(𝑣)
 So 𝐷(𝑣) ≥ 𝐷 ∗ v for all 𝑣
 Also, 𝐷(𝑣) ≤ 𝐷 ∗ v 5-8
Proof of Convergence
 Theorem: The estimates D(v) at all nodes converge to the
correct shortest path costs 𝐷∗ v after execution of a finite
number of updates and do not change thereafter
Proof:
1) Update rule at node v is 𝐷 v = 𝑚𝑖𝑛𝑤 𝑐 𝑣, 𝑤 + 𝐷 𝑤
 Lemma: Algorithm cannot terminate unless 𝐷 𝑣 = 𝐷 ∗ 𝑣 for all
v
 else above eqn. would not be satisfied for at least one node v; its D(v)
would change, resulting in changes in D(.) of its neighbors, etc.
 Lemma: For each node v, 𝐷 v is a decreasing function of time
 Lemma: 𝐷 𝑣 never decreases below 𝐷 ∗ 𝑣 for any 𝑣 (exercise)
 Lemma: For each node v, 𝐷 𝑣 decreases to its final value
𝐷 𝑣 = 𝐷 ∗ 𝑣 after a finite number of updates

5-9

You might also like