Breadth-first search on a graph that is never stored: the states of a puzzle, with each state’s moves made when it leaves the queue. A visited set keeps every state to one visit, and the layer a state lands in is its distance.
This interactive visualization needs JavaScript.