This page looks best with JavaScript enabled

Getting Started with Pathfinding using Dijkstra's Algorithm

 ·   ·  ☕ 1 min read

Lets explore pathfinding by implementing Dijkstra’s Algorithm. Dijkstra’s Algorithm is a pathfinding algorithm that works by calculating the distance from any node in a graph to a target node. To find a path from any node in the graph to the target node you need to find the next adjacent node with the shortest remaining distance to the target. We’ll be implementing this for a dynamic graph of bi-directional nodes, however this can be implemented in a similar fashion for other areas like a tile system from a strategy game.

Wikipedia goes deeper into Dijkstra’s Algorithm implementation and includes visual examples and pseudo code:

Recently I’ve been streaming some of my longer projects and playing games on Twitch. You can find my streams at:

Join the World of Zero Discord Server:

Sam Wronski
Sam Wronski
Maker of things, currently helping build cloud things @ Google. World of Zero is a personal project disconnected from my professional work. Lets make something awesome together!