Page 1 of 1

Suppose we changed line 4 of Dijkstra's algorithm to: 4 while el > 1 This change causes the while loop to execute [V] -

Posted: Sun May 15, 2022 8:50 am
by answerhappygod
Suppose We Changed Line 4 Of Dijkstra S Algorithm To 4 While El 1 This Change Causes The While Loop To Execute V 1
Suppose We Changed Line 4 Of Dijkstra S Algorithm To 4 While El 1 This Change Causes The While Loop To Execute V 1 (126.95 KiB) Viewed 39 times
Suppose we changed line 4 of Dijkstra's algorithm to: 4 while el > 1 This change causes the while loop to execute [V] - 1 times. Assuming a simple graph with no negative weight edges, will the distances to every vertex be correct when this modified algorithm finishes? DIJKSTRA (G, W,s) 1 INITIALIZE-SINGLE-SOURCE (G, S) 2 S= 3 Q = G.V 4 while 9 70 5 u = EXTRACT-MIN(Q) 6 S= SU{u} 7 for each vertex v € G. Adj 8 RELAX(u, v, w) True False