X. Random generate and check whether solvable.
http://www.codeproject.com/Articles/332458/Puzzle
X. Move or change from solution.
http://gamedev.stackexchange.com/questions/42096/creating-practically-solvable-15-puzzle-inputs
KISS
Just start with finished puzzle, and then make let's say 10 random moves (1 for every second) of tiles to make sure the puzzle is both solvable and can be done in 10 moves. Make sure your moves don't negate previous, e.g. moving 3 tiles in "circle" or moving a tile back where it was before previous move.
http://www.codeproject.com/Articles/332458/Puzzle
X. Move or change from solution.
http://gamedev.stackexchange.com/questions/42096/creating-practically-solvable-15-puzzle-inputs
KISS
Just start with finished puzzle, and then make let's say 10 random moves (1 for every second) of tiles to make sure the puzzle is both solvable and can be done in 10 moves. Make sure your moves don't negate previous, e.g. moving 3 tiles in "circle" or moving a tile back where it was before previous move.