Title: Dijkstra animation
1Dijkstra animation
2Dijkstas Algorithm(Shortest Path Between 2
Nodes)
2 Phasesinitializationiteration Initialization
1. Included(Boolean) 2. Distance(Weight)
initialize to 0 if START
weight if an edge from START
to index 8 if no
edge (not adjacent) 3. Path(node) Contains
immediate predecessor initialize to START
if adjacent undefined if
not adjacent
3Dijkstras Algorithm
Iteration repeat find node j with
smallest distance, not already included for
each R not included and adjacent to J if
distancejedgeweight(J,R)ltdistanceR then
distanceRdistanceJedgeweight(J,R)
PathRJ endif until
destination node is included
4Dijkstra
t
f
t
f
t
f
t
B
F
f
t
10
9
B
f
t
8
Give the shortest path tree for node A for
this graph using Dijkstras shortest path
algorithm. Show your work with the 3 arrays given
and draw the resultant shortest path tree with
edge weights included.