screeps-clockwork

Dijkstra’s Algorithm

There’s a great explanation of Dijkstra’s algorithm at Red Blob Games.

Unlike breadth-first search, Dijkstra’s algorithm takes terrain cost into account. It’s the go-to for computing flow fields and distance maps.