How we found your shortest path
- Shortest path
- moves
- Starting distance estimate
- Arrangements expanded
- Search time
- Check that the target is reachable. We compare the order of the numbered tiles, leaving out the blank. For a 3 × 3 puzzle, the inversion parity must match the target.
- Estimate the remaining work. Manhattan distance adds up how many rows and columns each tile is from its target cell. The blank is excluded. This is a lower bound, because real moves may need extra steps to get other tiles out of the way.
- Explore the most promising moves. A-star prioritizes arrangements by moves so far + estimated moves remaining. Each step slides one neighboring tile into the blank. An arrangement is revisited only when a shorter route to it is found.
- Confirm the shortest path. Manhattan distance never overestimates the remaining moves. When A-star selects the target from its priority queue, no unexplored route can produce a shorter solution. Multiple equally short paths may exist.
- Play the route from your photo. The search runs from your arranged target back to the original photo layout, then reverses the moves for playback. Every slide is reversible, so reversing the route preserves its shortest length.
Arrangements expanded counts the boards whose next moves were examined. Search time measures the server’s search, excluding photo processing, network transfer, and animation.