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.

Level: intermediateTopic: Data structures algorithms

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

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.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.