Dijkstra Algorithm
Dijkstra Algorithm
u A B C D E
π N N N N N
Cont…
Cont…
u A B C D E
π N A A N N
Cont…
u A B C D E
π N A A N N
Cont…
u A B C D E
π N C A C C
Cont…
u A B C D E
π N C A C C
Cont…
u A B C D E
π N C A C C
Cont…
u A B C D E
π N C A B C
Cont…
u A B C D E
π N C A B C
Cont…
u A B C D E
π N C A B C
Cont…
Shortest Path
u A B C D E
π N C A B C
Running Times
• The simplest implementation is to store
vertices in an array or linked list. This will
produce a running time of
• For any graphs with very few edges and many
nodes or vertices, it can be implemented more
efficiently storing the graph in an adjacency
list using a binary heap or priority queue. This
will produce a running time of
Time Complexity: Using Linked list