Talk:Dijkstra's algorithm: Difference between revisions

Content deleted Content added
Shrddr (talk | contribs)
Line 53:
== Pseudocode improvement ==
 
In first pseudocode block, on line 15, dist[u] is checked for not being INFINITY. But if it is INFINITY at this point, the code will continue useless looping, because all remaining vertices will also have dist[u]=INFINITY and not influence the result. Maybe move the INFINITY check to line 11 and break out of while block, it would be more human readable too I think --[[SpecialUser:Contributions/78.63.123.129Shrddr|78.63.123.129Shrddr]] ([[User talk:78.63.123.129Shrddr|talk]]) 20:4344, 20 August 2022 (UTC)