SARATH THARAYILST
WRITEUPSCONCEPTSPROJECTSLABABOUT
SARATH THARAYIL
മ
IGARATIPO: AMAZON TRIBUTARIES
/ SYSTEM

Building thoughtful software, writing notes, and shipping experiments across data, AI, and the web.

No cookies, no tracking. Preferences are stored locally in your browser. Anonymous view counts are kept server-side.

Hey, there's a story for the river above/© 2026 Sarath Tharayil/IST --:--:--
← LAB

Pathfinding

Jun 6, 2026

BFS expands in perfect circles of equal cost — it always finds the shortest path, but it looks in every direction. A* adds a heuristic (straight-line distance to the goal) that focuses the search. Same guarantee, far fewer cells visited on most inputs.

0 visited

Green = start · Orange = end · Dim = visited · Bright = path. Draw walls then hit RUN.

/ NOTES
ALGORITHMS
BFSExplores all cells at distance d before any at d+1. Guaranteed shortest path. No heuristic.
A*BFS plus a heuristic: f = g + h, where g is cost so far and h is estimated cost to goal. Faster in practice.
CONTROLS

Left drag: draw walls   Right drag: erase   S: place start   E: place end

WHAT TO TRY

Build a tight maze and run both algorithms. Compare visited cell counts. Place start and end far apart with a wall almost blocking the path — watch A* hug the heuristic gradient while BFS floods everything equally.