Original Post
What are some methods for solving arbitrary N sized N puzzles ? How can I determine unsolvable configurations?
[ 1] [ 2] [ 3] [15]
[ x] [ x] [ ] [ 4]
[ x] [ x] [ x] [ x]
[ x] [ x] [ x] [ x]
Have you ever actually tried to do one of these puzzles? That strategy doesn't work. Ex 15-puzzle:
[ 1] [ 2] [ 3] [15]
[ x] [ x] [ ] [ 4]
[ x] [ x] [ x] [ x]
[ x] [ x] [ x] [ x]
There is no way to move 4 into place without moving 3.
1) Your post distinctly said "while keeping the previous tiles at the correct position." If you need to move a previous tile in an intermediary step, then that isn't the same algorithm you originally said would work.
2) An N-puzzle is solvable if the parity is even. A puzzle can be change in parity from odd to even or vice versa by swapping the values of two adjacent tiles. Since the value of 8 positions are left unspecified then that puzzle configuration can map to any number of solvable puzzles.
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more