自1870年Sam Loyd提出了「14-15益智問題」之後,(n2-1)智慧盤問題也就隨之產生。問題的主要目標是有一個n x n大小的棋盤,上面只有(n2-1)顆次序錯亂的棋子,利用唯一的空格滑動四周的棋子,使這(n2-1)顆棋子能夠依照預期的順序歸回原位,找出以最少的次數完成的走法。 在本論文中,我們進一步改良了Ian Parrery的方法,利用分而治之(divide-and-conquer)和貪婪(greedy)演算法的技巧,使得能夠在最多13/3n3-59/4n2+263/12n-17次的移動中,將(n2-1)智慧盤問題解決。根據分析,在最壞情況的盤面時,至少需要n3-O(n2)次移動,因此我們的方法不會比這個數值多於13/3倍。此外,若以亂數產生的盤面而言,根據分析至少需2/3n3-2/3n2次移動,相較之下,我們的方法也不會超過其13/2倍。
The (n2-1)-puzzle has been studied by many researchers since Sam Loyd introduced the “14-15 puzzle” and its variants in 1870. Given an N x N chessboard with (n2-1) random-numbered tiles (leaving one blank block), the goal of the (n2-1)-puzzle is to rearrange all tiles in row-major order by sliding one tile adjacent to the blank repeatedly. In this paper, we improve the method proposed by Ian Parberry. Using divide- and-conquer and greedy techniques, we solve the (n2-1)-puzzle in at most 13/3n3-59/4n2+263/12n-17 moves. It has been known that the problem requires at least n3-O(n2) moves in the worst case, so our algorithm makes no more than 13/3 times more moves than necessary. Besides, our solution makes no more than 13/2 time more than the numbers it needs in the average case (at least 2/3n3-2/3n2 moves).