Professional Documents
Culture Documents
Lecture# 11 Shortest Path Problem
Lecture# 11 Shortest Path Problem
Lecture# 11 Shortest Path Problem
i. Set all vertices distances = infinity except for the source vertex.
ii. Set the source distance = 0
Dijkstra's algorithm
Dijkstra's algorithm
Working example 1
Relaxation
Dijkstra's algorithm
Working example 2
Dijkstra's algorithm
Working example 2
Dijkstra's algorithm
Working example 2
Dijkstra's algorithm
Working example 2
Dijkstra's algorithm
Working example 2
Dijkstra's algorithm
Working example 2
Dijkstra's algorithm
Working example 2
Dijkstra's algorithm
Working example 2
Dijkstra's algorithm
Working example 2
Dijkstra's algorithm
Disadvantages
Try yourself
Dijkstra's algorithm
Crucial acknowledgments
• As with all greedy algorithms, it is essential to make sure that a correct algorithm is
selected (e.g., it always returns the right solution if it is given correct input).
• This algorithm mainly calculates the shortest path to every vertex therefore,
anytime when an optimal path to some other vertex from a determined origin is
required, best to opt it.
Applications
• Traffic Information Systems are most prominent use
• - Mapping (Map Quest, Google Maps)
• - Routing Systems
Cessation