Frequently Asked Questions
Find answers to common questions about our Sliding Puzzle Solver, its algorithms, and how to get the most out of this tool.
Algorithm Performance
How long does it take to solve a puzzle?
Solution time varies based on puzzle size, complexity, and the algorithm chosen:
- 8 Puzzle (3×3): Typically solves in under 1 second with most algorithms
- 15 Puzzle (4×4):
- Pattern Solving: 1-2 seconds
- A* with Manhattan Distance: 3-10 seconds
- A* with Linear Conflict: 10-30 seconds
- IDA*: 30-120 seconds for optimal solutions
- Larger puzzles (5×5 and above): Pattern solving becomes essential, as other algorithms may take minutes or even hours
Which algorithm should I choose?
The best algorithm depends on your specific needs:
- Pattern Solving: Fastest for all puzzle sizes but may not provide the shortest solution path
- A* with Manhattan Distance: Good balance of speed and solution quality for 8 and 15 puzzles
- A* with Linear Conflict: Better solution quality than Manhattan, but slower
- IDA*: Guarantees the shortest solution but significantly slower for larger puzzles
- Bidirectional BFS: Very effective for 8 puzzles but memory-intensive for larger puzzles
For beginners, we recommend starting with Pattern Solving or A* with Manhattan Distance.
Why do solution times vary so much?
Solution times depend on several factors:
- Puzzle complexity: The further from the solution, the longer it takes
- Algorithm choice: Different algorithms have different time-space tradeoffs
- Puzzle size: Larger puzzles have exponentially larger state spaces
- Your device: Faster devices will compute solutions more quickly
A 15 puzzle has approximately 10^13 possible states, while an 8 puzzle has only about 10^5, making the 15 puzzle significantly more challenging to solve.
Technical Information
How do the algorithms work?
Our solver implements several advanced search algorithms:
- Pattern Solving: A strategic approach that solves the puzzle row by row and column by column, similar to how humans typically solve these puzzles
- A* Search: An informed search algorithm that uses heuristics to guide its search toward the goal state. We offer several heuristics:
- Manhattan Distance: Calculates the sum of horizontal and vertical distances each tile is from its goal position
- Misplaced Tiles: Counts how many tiles are not in their correct position
- Linear Conflict: Enhances Manhattan distance by accounting for tiles that are in the correct row/column but in the wrong order
- IDA* (Iterative Deepening A*): A memory-efficient variant of A* that guarantees an optimal solution
- Bidirectional BFS: Searches simultaneously from both the initial state and goal state, meeting in the middle
Are all puzzle configurations solvable?
No, not all configurations of sliding puzzles are solvable. Exactly half of all possible arrangements are unsolvable.
Whether a puzzle is solvable depends on a mathematical property called "parity" or "inversion count":
- For odd-sized grids (3×3, 5×5, etc.), a puzzle is solvable if the number of inversions is even
- For even-sized grids (4×4, 6×6, etc.), a puzzle is solvable if:
- The number of inversions is even and the blank is on an odd row (counting from the bottom)
- Or, the number of inversions is odd and the blank is on an even row
Our solver automatically detects unsolvable configurations and will inform you if a solution is not possible.
What is the maximum puzzle size supported?
Our solver supports puzzles from 2×2 up to 9×9 sizes, though solving times increase significantly for larger puzzles:
- 2×2 to 4×4: All algorithms work efficiently
- 5×5 to 6×6: Pattern solving recommended; A* algorithms may work for moderately scrambled puzzles
- 7×7 to 9×9: Only pattern solving is practical; other algorithms may time out
For puzzles larger than 5×5, we recommend using the pattern solving algorithm exclusively, as it scales much better to larger puzzle sizes.
Using the Solver
How do I input my own puzzle configuration?
To input your own puzzle configuration:
- Set the appropriate grid size using the rows/columns selectors
- Click on "Reset" to clear the grid to its solved state
- Click on tiles to select them, then click on another tile to swap their positions
- Repeat until your puzzle matches your real-world configuration
- Click "Solve" to find the solution
Alternatively, you can use the "Shuffle" button to create a random configuration.
Can I speed up or slow down the solution animation?
Yes, you can control the animation speed:
- Use the "Speed Up" button to make the animation faster
- Use the "Slow Down" button to make the animation slower
- The animation speed settings persist between sessions
Slowing down the animation can be particularly helpful for educational purposes or when you want to carefully observe each step of the solution.
What if the solver says "No solution found"?
If the solver indicates "No solution found," it means one of two things:
- The puzzle configuration is unsolvable (mathematically impossible)
- The selected algorithm reached its resource limits (time or memory)
For complex configurations on larger puzzles, try switching to the Pattern Solving algorithm, which is more efficient but may produce slightly longer solution paths.
If you believe your puzzle should be solvable but keeps failing, double-check that you've entered it correctly. A single misplaced tile can make a solvable puzzle unsolvable.