Model a puzzle as a graph
Challenge · Multiple choice · about 8 min
A sliding puzzle has a 2 × 3 board with five numbered tiles and one blank. One move slides a tile next to the blank into the blank. You want the fewest moves to reach the solved board.
Which graph lets breadth-first search answer this?
Learn the idea first: Implicit graphs: grids, states and puzzles, a visual lesson.
More Implicit graphs: grids, states and puzzles problems
- Neighbors of a cell Warm-up
- Count islands preview Warm-up
- Knight moves Standard
- Fewest operations Standard
- Fewest knight moves Standard