🎉 October Learning Month — learn a new software term every day!
An interactive flashcard trainer for software engineering terms.

Dijkstra

In plain terms

An algorithm that finds the shortest path from a start point to all others.

Going deeper

Dijkstra's algorithm greedily expands the nearest unvisited node, updating the cheapest known distance to its neighbors, until all are settled. It powers routing in maps and networks (with non-negative weights).

Under the hood

Requires non-negative edge weights; a binary or Fibonacci heap brings it to O((V+E) log V). For negative edges use Bellman-Ford; for heuristics use A*.

Examples

GPS routing, network packet routing (OSPF), least-cost pathfinding in games.

Think of it like...

Like water flooding out from a source through pipes: it reaches each junction by the shortest possible route first.

Feedback & Bug Report