Talk:Dijkstra's algorithm: Difference between revisions

 
(2 intermediate revisions by 2 users not shown)
Line 310:
 
Must specify explicitly that the python snippet solution should be at least in python 2.7 due to the dictionary comprehension feature used. And also, must replace the 'pushleft' with 'appendleft'.
 
Updated 'queue' to 'deque' and re-updated 'pushleft' to 'appendleft' and tested running in python 2.7 and python 3.5 on 1/19/2017
 
== Javascript version ==
Line 371 ⟶ 373:
return path.length > 0 ? path : null;
}
 
== Perl version faulty ==
 
The push_priority() function of the perl implementation is faulty. This can most clearly be seen by adding an edge from 'b' to 'e' of weight 1 making s-b-e the shortest path. Yet this new path is not picked up. The vertices appears to be dequeued from the function in their inserted order, rather than by priority. In the function the binary search comparison appears to be comparing hash addresses.
 
:Fixed. [[User:Trizen|Trizen]] ([[User talk:Trizen|talk]])
Anonymous user