Skip to main content
1 of 2
Ashwin
  • 195
  • 1
  • 2
  • 7

Creating practically solvable 15 puzzle inputs

I am now developing a 15 puzzle game. I know the method to detect unsolvable puzzles. But unlike 8-puzzle, solution for 15-puzzle takes quite long time for some input states and can be solved within 5 seconds some other set of input states.
Now the problem is that I cannot give the user(the player), a problem for which the solution takes more than 10 seconds(if he/she chooses to see the solution). So what I want is that when I initially shuffle the puzzle, I want to only present those puzzles which can be solved within 10 seconds. There must be some way to determine the hardness of the puzzle. I tried searching the net but could not find it.
Does anyone know a way of determining the hardness of a puzzle?

NOTE : I am using A* algorithm to find out the solution on a computer with 3GB RAM and 2.27GHZ processor.

Ashwin
  • 195
  • 1
  • 2
  • 7