AI engineering glossary · Data structures algorithms
What is dijkstra's algorithm?
Dijkstra's algorithm: An algorithm that finds the shortest paths from one start vertex to all others in a graph with non-negative edge weights. It repeatedly picks the unfinished vertex with the smallest known distance, using a priority queue, and updates its neighbours.
Dijkstra's algorithm: an example
From Delhi, it finalises the nearest city first, then relaxes routes through it, giving the shortest road distance to every other city.
Related terms
More Data structures algorithms terms
- Directed acyclic graph
- Divide and conquer
- Doubly linked list
- Dynamic array
- Dynamic programming
- Edit distance
- Fenwick tree
- Floyd-Warshall algorithm
Where you learn it
Dijkstra's algorithm is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.