Skip to content

Dijkstra's Algorithm

Tomas Mazurkevic edited this page Feb 15, 2019 · 5 revisions

Overview

Between the two points,
Consider each node for weight,
And find short path

Dijkstra's algorithm is a graph-traversal algorithm often used for pathfinding. It was first described by Dijkstra in 1959 [1] and formed the basis for the A* pathfinding algorithm [2].

The algorithm is effective when finding the shortest path to go to another place so that the final path isn't considered too harmful. However, it lacks the computational optimisation introduced by A*, and since the workload of their implementation is similar, it is often preferable to use the latter [4]. This is especially true in time-intensive software such as games.

Example

Animated depiction of Dijkstra's algorithm
Animated depiction of Dijkstra's algorithm in play. Image from [3].

References

Clone this wiki locally