Pathfinding Algorithms Explained
Published
26 July 2026
Most explanations of AI start with something abstract: a neural network diagram, a loss function, a wall of matrix notation. That is not where AI started, and it is not the easiest place to build intuition either. Long before anyone trained a model, computer science already had a working definition of intelligent behaviour: search a space of possible actions, and pick the one that gets you to a goal. Pathfinding is that idea in its purest, most watchable form.
Below is a small stealth puzzle. A grid, an entrance, an exit, and guards on fixed patrols with vision cones. An algorithm plans a route, walks it tick by tick, and if a guard spots it, the level resets and it tries again with that death remembered. Watch a few attempts before reading on.
Level
Signal Room
Level
10 × 7 grid · Small · Easy
One guard, one choke point. A gentle introduction to the space-time grid.
Algorithm
Exploring: 2 of 31 states checked
Informed search · Search that orders expansion using extra knowledge: path cost (including soft patrol risk), straight-line distance to the exit, jump pruning, or both.
Cost so far, plus distance to go. Informed by both halves: the cost-so-far from Dijkstra's Algorithm (including patrol proximity) plus the distance-to-exit from Greedy Best-First Search. Expanding the state that minimises the sum is why A* Search is the default here and in most games: fewer expansions than Dijkstra's Algorithm, still respectful of soft risk that plain Greedy Best-First Search ignores.
Run state
Attempt
1
Tick
0
Nodes explored
21
Status
Ready
Why this route
Avoiding
Nothing yet
Route vs shortest
9 / 9 ticks
Pick a level, pick an algorithm from the dropdown, and watch it go. Failed attempts leave faint trails. Switching algorithms clears that level's memory. For animations and full write-ups of each algorithm, open the algorithms index.
The problem is the clock, not just the maze
A static maze is easy. What makes this harder is that danger moves on a schedule. A tile that is safe at tick 6 may be lethal at tick 10. States are (x, y, tick), not just (x, y). You cannot stand still: every tick must spend itself on a real step.
Guards loop, so danger repeats every period ticks. Learned deaths are stored as "x,y,phase" where phase = tick % period. The same square can be banned at one phase and free at another. Surviving a square does not store a "safe" fact. Only deaths grow the calendar. A* Search has the clearest worked example of that retiming.
Three categories, and why they exist
Every option in the dropdown solves the same space-time problem. The category answers one question: what information shapes the next decision? Browse them all as a grid of animations on /algorithms.
Naive
No graph search. Each tick follows a local rule.
- Random Walk picks a safe neighbour at random.
- Wall Follower keeps a hand on the wall.
- Potential Fields rides attract/repel forces.
They can still respect learned death phases (those cells are simply not legal picks). They never plan a full route.
Uninformed search
Real search over space-time states, but blind to where the exit is. Order comes only from the frontier structure.
- Breadth-First Search uses a queue and finds the fewest-ticks legal path.
- Depth-First Search uses a stack, finds a route if one exists, and rarely finds a short one.
- Iterative Deepening Depth-First Search repeats depth-limited Depth-First Search with rising limits.
- Bidirectional Search searches from both ends and meets in the middle.
Informed search
Search that orders expansion using extra knowledge: path cost, distance to the exit, or both.
- Dijkstra's Algorithm expands lowest accumulated cost (including soft patrol risk), still without aiming at the exit.
- Greedy Best-First Search expands whatever looks closest to the exit and ignores sunk cost.
- A* Search combines cost-so-far with distance-to-go. That is the default for a reason.
- Jump Point Search skips boring straight runs on grids.
- Theta* allows any-angle shortcuts when line of sight is clear.
- D* Lite is built for replanning when the map of danger grows.
Sampling / stochastic
- RRT / RRT* grows a random tree through free space.
- Monte Carlo Tree Search scores moves by random rollouts.
Learning
- Learning Real-Time A* updates heuristics from what went wrong.
- Q-Learning learns action values across attempts.
Constraint search
- Conflict-Based Search adds bans when a plan conflicts with the death calendar, then replans.
Browse animations for all of them on /algorithms.
How learning feeds the next attempt
None of the planners get to read vision cones during planning. Attempt 1 assumes the walkable grid is safe. It plans, walks, and often dies. The engine then stores the catching cone at that patrol phase and runs the same algorithm again. Same rules, bigger blacklist.
That is why the attempt counter climbs: each fail buys calendar facts, not a different algorithm. Soft risk (Dijkstra's Algorithm / A* Search) is separate. It only nudges preferences. Hard bans from deaths remove edges entirely.
Build your own level
The pathfinding level editor lets you paint a grid, place entrance and exit, add guards with patrol or loop routes, pick an algorithm, and share the result as a link. The Learn more link next to each algorithm opens its page under /algorithms.
Similar articles

Production Agentic AI: Permissions, Observability, and Kill Switches
Putting an agentic AI system into production is a different engineering problem to putting it into staging. Once it is live, the governance question shifts from "will it behave?" to "how do we know if it stops behaving, and what do we do about it?" A practical guide to production permissions, observability architecture, and kill switches for Australian engineering leaders in regulated industries.
25 Sept 2026

What Australian CTOs Should Put in the AI Governance Pack
The board is asking. The regulator is watching. The CTO is the one who has to translate "AI governance" from a policy concept into a document set that actually governs something. Here is what a credible AI governance pack looks like for an Australian organisation in 2026, and what each section needs to do to survive scrutiny.
21 Sept 2026

Governing Agentic AI: Human-in-the-Loop Patterns When Tools Can Act (MCP Edition)
Agentic AI doesn't just recommend. It acts. That changes governance from a policy question into an engineering question: which patterns actually limit blast radius, satisfy a human reviewer, and survive scrutiny from a regulator or court? A practical playbook for MCP-connected agents, with a checklist for regulated industries.
16 Sept 2026

Vercel Can Do WebSockets Now. Here's Where a Chat Room Still Breaks It.
Vercel shipped native WebSocket support in 2026, so a Function really can hold a socket open. But the connection is still a function invocation with a duration ceiling and no fan-out. Here's where that's fine for a chat app, where it isn't, and how Supabase Realtime covers the gap.
15 Aug 2026
