Question: table showing the intermediate distance values ( dist ( v ) ) and prev values of all the nodes at each iteration of the algorithm.

table showing the intermediate distance values (dist(v)) and prev values of all the nodes at each iteration of the algorithm. (b) Show the final shortest-path tree. (15')
8
procedure dijkstra (G.l.s)
Input: Graph G=(V,E), directed or undirected; positive edge lengths {le:einE}; vertex sinV
Output: For all vertices u reachable from s, dist (u) is set to the distance from s to u.
for all uinV
dist(u)=
prev(u)=nil
dist(s)=0
H= makequeue (V),(using dist-values as keys)
while H is not empty:
u= deletemin (H)
for all edges (u,v)inE:
if dist (v)>dist(u)+l(u,v):
dist (v)=dist(u)+l(u,v)
pirev (v)=u
decreasekey (H,v)
 table showing the intermediate distance values (dist(v)) and prev values of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!