# 8-puzzle 可解性的证明 & 最优解性的证明

https://github.com/jasonlovescoding/Coursera-Princeton-Algorithm

1. Note that we do not count the blank square when computing the Hamming or Manhattan priorities.) Consequently, when the goal board is dequeued, we have discovered not only a sequence of moves from the initial board to the goal board, but one that makes the fewest number of moves. (Challenge for the mathematically inclined: prove this fact.)

2. Detecting unsolvable puzzles. Not all initial boards can lead to the goal board by a sequence of legal moves, including the two below:

1 2 3 1 2 3 4 4 5 6 5 6 7 8 8 7 9 10 11 12 13 15 14 unsolvable unsolvable
To detect such situations, use the fact that boards are divided into two equivalence classes with respect to reachability: (i) those that lead to the goal board and (ii) those that lead to the goal board if we modify the initial board by swapping any pair of blocks (the blank square is not a block). (Difficult challenge for the mathematically inclined: prove this fact.)

(,x,y,z,)(,y,z,x,)

。。。貌似要用到抽象代数的置换群等知识 等这学期学了再解释

http://www.cs.bham.ac.uk/~mdr/teaching/modules04/java2/TilesSolvability.html