Download presentation
Presentation is loading. Please wait.
1
1 Routing Algorithms
2
2 Outline zBellaman-Ford Algorithm zDijkstra Algorithm
3
3 Bellman-Ford Algorithm(1/3) 1 2 3 4 5 1 4 1 2 8 2 42 1 Source Node Shortest paths problem arcs lengths as indicated Definition is the shortest (≤h) path length from node 1 to node i Bellman-Ford Algorithm Initially, For each successive h≥0, Example I
4
4 Bellman-Ford Algorithm(2/3) 1 2 3 4 5 Shortest paths using at most 2 arcs 1 2 3 4 5 Shortest paths using at most 1 arcs
5
5 Bellman-Ford Algorithm(3/3) Final tree of shortest paths 1 2 3 4 5 1 2 3 4 5 Shortest paths using at most 3 arcs
6
6 Dijkstra’s Algorithm(1/3) Initially P={1}, D 1 =0, and Step1. (Find the closest node). Find such that Set. If P contains all nodes then stop ; the algorithm is complete Step2. (Updating of labels). For all set Go to Step1.
7
7 Dijkstra’s Algorithm(2/3) zExample of Dijkstra’s Algorithm 1 2 4 3 5 1 4 1 3 1 1 2 6 4
8
8 Dijkstra’s Algorithm(3/3) 1 2 4 3 5 P = {1,2} 1 2 4 3 5 6 P = {1,2,5} 1 2 4 3 5 6 P = {1,2,3,4,5}
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.