I'm working on 8 number puzzle, where 8 numbers are randomly generated and placed in 9 cell board. One cell at bottom right corner is kept empty where we can swap with adjacent (top-bottom-left-right) cells if any available.
The puzzle can be solved if all numbers are arranged in sequence starting from top left cell.
Now after some trials, I found that some arrangements of (randomly generated) numbers in starting of the game are not solvable.
I think, after generating random numbers, we can find mathematically that random numbers can be solved after placing on board or not.
Can anybody help to find the solution/algorithm/mathematical formula to determine that numbers can be solvable or not?