Solving the 8 Puzzle

The 8 Puzzle consists of a 3x3 board with eight numbered tiles and an empty spot. A tile adjacent to the empty spot can slide into that spot. The goal of the puzzle is to order all of the tiles numerically, leaving the empty spot in the lower-right corner.

Some browsers may not be ready for this code, if you don't see working examples, please check my page on enabling ECMAScript6. Many of these algorithms are also used on my map searches page. It's all in Git at my GitHub repo.

The Board

1
2
3
4
5
6
7
8
 

Note: not all tile arrangments are guaranteed to be solvable.

Choose an Algorithm

Results

Nodes used in search
0
Elapsed search time (ms)
0
Path Cost
0
Solution Path
...