Dijkstra's algorithm: Difference between revisions

Content deleted Content added
Line 1,324: Line 1,324:


=={{header|Tcl}}==
=={{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.
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} {
<lang tcl>proc dijkstra {graph origin} {