Overview
The Lee Algorithm is a breadth-first grid routing method that labels cells by distance from the start.
Finds shortest paths on a grid by expanding wavefront distances.
Compact metadata for implementation and discovery.
The Lee Algorithm is a breadth-first grid routing method that labels cells by distance from the start.
Quick facts
Runtime and memory behavior at a glance.
Best
O(w h)
Average
O(w h)
Worst
O(w h)
Space
O(w h)
distance[neighbor] = distance[current] + 1Assigns each newly reached grid cell the next distance from the source.
Show distance labels spreading across a grid from the start.
Lee Algorithm operates in O(w h) time and O(w h) space within the Wavefront Pathfinding family. Key governing relation: distance[neighbor] = distance[current] + 1. Often compared with Breadth-First Search and Jump Point Search.
What each reference supports for this entry.
Original reference for wavefront grid routing and shortest path expansion in mazes.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Lee routing is a grid-based breadth-first search for shortest paths in unweighted grids.