React 15-puzzle

background
6
12
4
15
3
11
14
5
13
9
2
7
8
1
10

A classic 8 or 15 puzzle that I built with React that has interactive sliding tiles. The ai solver uses the fringe search algorithm and manhattan distance heuristic, which is sufficient for the 8 piece puzzle. For the 15 piece a non-optimal but short solution is found by breaking up the problem and stringing together those solutions, an idea based on this paper by Ian Parberry.

While most configurations of the 15 puzzle are solved within a few seconds, the hardest can take up from 30 to 50 seconds. For this reason the solution is carried out in a web worker so the browser doesn't lock up. This puzzle works great on mobile devices due to the responsive design of the layout and memory efficient ai.