Build with AI 中文 ▶ Subscribe
‹ Videos
Algorithms, Visualized · Nov 6, 2026

How a computer beats Water Sort level 9 in 0.1 s

It doesn't think. It tries every pour, skips boards it has seen, and traces back the shortest route. That's breadth-first search.

How a computer beats Water Sort level 9 in 0.1 s

Water Sort looks like a game of intuition. A computer solves it with none: from one board it lists every legal pour (14 on level 9), throws away the ones that lead to a board it has already seen, and repeats for every new board, one pour deeper each round.

That is breadth-first search. Because it explores all 1-pour boards before any 2-pour board, the first solved board it reaches is automatically a shortest one. Level 9 took 7,030 boards, 23 pours and 0.07 seconds.

The replay at the end is the real game playing back the route the search found. The 23 pours are pinned in the comments if you want to check your own answer.

#BFS#Water Sort#PlayDoz