Welcome to Tile Solver

The place that provides the steps to solve the sliding 8 tile puzzle.


Either slide the tiles to a dersired position or enter the positions manually. The number 9 represents the empty tile. Hit the "Find Optimal Solution" button to solve the puzzle in the smallest number of steps. The steps describe the movement of the empty tile.

    The algorithm used to solve the sliding 8 tile puzzle is a breadth first search algorithm. The benefits of this algorithm is that it ensures an optimal solution. A drawback is that all actions are explored before moving to the next step, meaning it may take longer to come to a solution especially when the solution has many steps. This example also uses a heuritic to help determine which path to explore first. Heuritics are general indicators of closeness to a solution. The algorithm here uses manhatten distance as a heuristic. Manhatten distance calculates how far each tile is from their target position. Intead of taking a direct line to their target position, manhatten distance calculates the diplacement along the horizontal and vertical dimensions. To increase the speed of this algorithm in the future, results are anonymously saved to a database. These results can then be used in the future to develop an improved heuristic to help determine which paths to explore first.