All algorithms

Uninformed search · 6 min read

Breadth-First Search

Fewest ticks, no sense of danger. A first-in-first-out queue over space-time states that guarantees fewest ticks, with no goal heuristic and no soft sense of risk.

Why this category

Real search over space-time states, but blind to where the exit is. Order comes only from the frontier structure (queue, stack, or iterative deepening), not from a goal heuristic.

How it explores

Exploring: 2 of 47 states checked

expandedwallhazardroute

Why it is Uninformed

Breadth-First Search is the simplest correct answer to find a shortest route. It is Uninformed: it searches the full (x, y, tick) graph systematically, but it has no hint about which direction the exit lies, and no cost beyond one tick per step.

Uninformed does not mean dumb. It means the expansion order does not peek at the goal. Breadth-First Search expands every state one tick away, then two ticks away, and so on. That is exactly why the first time it reaches the exit, the path has the fewest ticks among legal states.

How it picks the next move

Planning happens before the walk. Put the entrance at tick 0 in a first-in-first-out queue. Pop the oldest state. If it is the exit, reconstruct the path and stop. For each orthogonal neighbour at tick + 1, skip walls, skip visited space-time keys, and skip any "x,y,phase" in the learned death set. Push surviving neighbours onto the queue. When planning finishes, walk the reconstructed path against real vision cones.

Soft patrol proximity is not part of the priority in Breadth-First Search. If the shortest legal route brushes a guard lane, Breadth-First Search takes it.

What it stores after a fail

A catch at tick T adds every cell in that guard's cone as "x,y,T % period". The next Breadth-First Search run treats those as walls in time. Same square at a different phase can still be used. That is how a later attempt can cross a kill tile safely: it arrives when the calendar says the slot is free.

Breadth-First Search does not store confirmed-safe tiles. Anything not blacklisted is assumed walkable until a later death proves otherwise.

More uninformed search

Try it live

Run this algorithm on a built-in level, or paint your own grid and guards.