🕹 ENTERTAINMENT · the arcade · the algorithms behind the fun · kept by THE CABINET

A* PATHFINDING ◧ 2D · ◍ 3D · ◆ 4D · ◐ shadow · 👶 TAP

How does a ghost chase you through a maze? Not by guessing — by A*, which explores toward the goal using a hint (the straight-line distance) so it barely wanders. Slide the greed (or tap): trust the hint more and it finds a path faster, but risks a longer one.

◆ LIT▲ AMBER
◧ THE MEASURE · 2D
◍ THE FRONTIER · 3D · the search, in the round
◆ THE FOURTH · 4D · a tesseract turns
◐ THE SHADOW · one dimension down
👶 THE TODDLER CORNER — one fat tap
path length
cells explored
optimal?
reading

◆ LIT — exact / checkable

A* search on a grid. It expands the frontier cell with the lowest f = g + w·h, where g is the steps taken and h is the Manhattan distance to the goal (an admissible hint). At w=1 A* is guaranteed to find a SHORTEST path while exploring far fewer cells than a blind flood; raise the weight and it turns greedy — reaching the goal sooner but no longer guaranteed optimal. The path and every explored cell are computed live. A fail-loud self-check throws unless w=1 returns a path whose length equals the true shortest and a heavier weight explores fewer cells.

▲ AMBER — the figure

A small fixed maze and 4-connected moves (no diagonals); real pathfinders add weights, jump-point search, hierarchical graphs. The A* expansion, the g+w·h ordering and the path are computed exactly.

ENTERTAINMENT: every game is a loop that lies to you sixty times a second.  — THE CABINET
David Lee Wise / ROOT0 / TriPod LLC  ·  the arcade row, with AVAN