Dijkstra's algorithm: Difference between revisions

Content deleted Content added
m Algorithm: Typo correction
m Algorithm: Since the algorithm implementation refers to distance _from_ the start node, it makes sense to consistently caption the animation with reference to closeness _to_ the start node, not to the target node.
Line 18:
 
== Algorithm ==
[[File:Dijkstras_progress_animation.gif|thumb|Illustration of Dijkstra's algorithm finding a path from a start node (lower left, red) to a target node (upper right, green) in a [[Robotics|robot]] [[motion planning]] problem. Open nodes represent the "tentative" set (aka set of "unvisited" nodes). Filled nodes are the visited ones, with color representing the distance: the greenerredder, the closer (to the start node). Nodes in all the different directions are explored uniformly, appearing more-or-less as a circular [[wavefront]] as Dijkstra's algorithm uses a [[Consistent heuristic|heuristic]] of picking the shortest known path so far.]]
The algorithm requires a starting node, and node ''N,'' with a distance between the starting node and ''N''. Dijkstra's algorithm starts with infinite distances and tries to improve them step by step: