Skip to content

Dijkstra's algorithm

Dijkstra's algorithm is a greedy algorithm that can be used to find, in a graph, the shortest path from a chosen vertices among all the other vertices.

![Animation of Dijkstra's algorithm](../assets/dijkstra.gif 'Dijkstra's algorithm - Wikipedia')

Complexity

Time complexity: O(|E|+|V|log|V|)

Resources