Jump to content

Dijkstra's algorithm: Difference between revisions

Line 1,324:
 
=={{header|Tcl}}==
 
This solution is incorrect. Since the path is directed and f is only a sink, f cannot be in the middle of a path.
 
Note that this code traverses the entire set of unrouted nodes at each step, as this is simpler than computing the subset that are reachable at each stage.
<lang tcl>proc dijkstra {graph origin} {
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.