# 15数码难题

15数码难题是一种滑块拼图，由15块标有数字的方形滑块和一个4×4的框架组成，框架中留有一个空格；玩家每次将一块滑块滑入空格，目标是达到有序排列。在所有可能的初始排列中，恰好有一半是可解的。目标状态为按阅读顺序从1到15排列滑块，空格位于右下角。<sup>[1](https://www.shapedoku.com/articles/sliding-tile-puzzles-explained)</sup>

| 关键事实 | 详情 |
|---|---|
| 棋盘 | 4×4方框内有15块标号滑块，16个位置中有一个为空；只有与空格相邻的滑块可以移动<sup>[2](https://mathworld.wolfram.com/15Puzzle.html)</sup> |
| 可解性 | 奇排列无法解出（Johnson 1879）；所有偶排列均可解（Story 1879）<sup>[2](https://mathworld.wolfram.com/15Puzzle.html)</sup> |
| 状态空间 | 16!/2 = 10,461,394,944,000个可达状态<sup>[3](https://www.mdpi.com/2073-431X/12/1/11)</sup><sup> • </sup><sup>[11](https://kociemba.org/themen/fifteen/fifteensolver.html)</sup> |
| 最难实例 | n×n推广在n = 1、2、3、4时的最大移动步数分别为0、6、31、80<sup>[2](https://mathworld.wolfram.com/15Puzzle.html)</sup> |
| 平均最优长度 | 最优解长度平均为53步<sup>[4](https://tjhsst.edu/~rlatimer/ai2007/Korf-slides.pdf)</sup> |
| 归属 | 通常被错误地归功于萨姆·劳埃德（Sam Loyd）；实际发明者是纽约州卡纳斯托塔（Canastota）的邮政局长诺伊斯·查普曼（Noyes Chapman），他于1880年3月申请了专利<sup>[2](https://mathworld.wolfram.com/15Puzzle.html)</sup> |
| 风潮时间 | 1880年1月始于美国，1880年4月传到欧洲；1880年7月结束<sup>[2](https://mathworld.wolfram.com/15Puzzle.html)</sup> |

## 规则与玩法

框架内装有编号1到15的滑块，恰好留有一个空格。滑块不能被取出；只有紧邻空格的滑块才能滑入空格，空格则移到该滑块原来的位置。<sup>[1](https://www.shapedoku.com/articles/sliding-tile-puzzles-explained)</sup>因此每走一步都既安置了一块滑块，又扰动了它旁边的滑块，所以推进一块滑块往往会打乱另一块。<sup>[1](https://www.shapedoku.com/articles/sliding-tile-puzzles-explained)</sup>一些商业版本在滑块上印有图片碎片而非数字，拼好后构成一幅完整图像。<sup>[5](https://inventwithpython.com/recursion/chapter12.html)</sup>

## 历史与劳埃德神话

这款拼图普遍被归功于美国谜题设计师萨姆·劳埃德，但拼图历史学家杰里·斯洛克姆（Jerry Slocum）和迪克·索内费尔德（Dic Sonneveld）（2006）的研究表明，劳埃德并未发明15数码难题，也与推广或普及它毫无关系。<sup>[2](https://mathworld.wolfram.com/15Puzzle.html)</sup>劳埃德于1891年首次声称自己是发明者，并一直坚持这一说法直到去世，这是一场长达20年的冒名运动。<sup>[2](https://mathworld.wolfram.com/15Puzzle.html)</sup>斯洛克姆和索内费尔德2006年的著作《15数码难题：它如何让世界疯狂》（*The 15 Puzzle: How It Drove the World Crazy*）整理了当时的一手资料，证明这一说法是持续了115年的捏造。<sup>[6](https://puzzlebyrinth.com/en/articles/fifteen-puzzle-1880)</sup>

真正的发明者是纽约州卡纳斯托塔的邮政局长诺伊斯·查普曼，他于1880年3月申请了专利。<sup>[2](https://mathworld.wolfram.com/15Puzzle.html)</sup>这款拼图引发的风潮于1880年1月在美国开始，4月传到欧洲，到1880年7月结束。<sup>[2](https://mathworld.wolfram.com/15Puzzle.html)</sup>风潮期间，富有的美国人悬赏高达1000美元，征求所谓的14-15难题的解法——即交换了14号和15号滑块的一种打乱局面。<sup>[7](https://theses.liacs.nl/pdf/LucEdixhoven.pdf)</sup>没有人能领到赏金，因为该局面无解。

## 可解性与奇偶不变量

并非所有排列都可解。W. Woolsey Johnson和William E. Story在1879年12月《美国数学杂志》第2卷第4期第397-404页的《关于“15”难题的注记》一文中确立了判定标准。<sup>[8](https://www.jstor.org/stable/2369492)</sup>Johnson用奇偶性论证证明了，任何滑动序列都无法达到对滑块标号施加奇排列所得到的构型；Story则证明了所有偶排列均可解。<sup>[2](https://mathworld.wolfram.com/15Puzzle.html)</sup>所有可能的初始构型中只有一半可解，而另一半构型只有交换两块滑块后才能解出。<sup>[9](https://playboardgames.org/how-to-play/15-puzzle)</sup>

该不变量的原理如下。按顺序读取滑块，统计顺序错误的配对数目，得到逆序数N。横向滑动不改变N。在4×4棋盘上，纵向滑动使一块滑块越过另外三块，使N改变一个奇数，同时使空格移动一行。因此在宽度为四的棋盘上，逆序数加上空格从底部数的行号的奇偶性是恒定的；当这个和为奇数时，局面可解。<sup>[9](https://playboardgames.org/how-to-play/15-puzzle)</sup><sup> • </sup><sup>[12](https://slidepuzzle.app/15-puzzle-parity/)</sup>交换两块滑块——如著名的14-15局面——会改变每次滑动都保持的那个奇偶性，因此无论滑动多少次都无法还原。<sup>[9](https://playboardgames.org/how-to-play/15-puzzle)</sup>Johnson的证明可以用交错群形式化，Herstein和Kaplansky（1978）曾指出似乎无人知道简单证明，后来Archer（1999）给出了一个简单证明。<sup>[2](https://mathworld.wolfram.com/15Puzzle.html)</sup>

该结果可以推广。Wilson（1974）证明，对于n个节点上的任意连通图，除环图C<sub>n</sub>和theta<sub>0</sub>图外，通过滑动标号恰好可以得到全部n!种标号的一半或全部，取决于该图是否为二部图（节点可分为两个不相邻组的图）。<sup>[2](https://mathworld.wolfram.com/15Puzzle.html)</sup>

## 计算难度与求解算法

状态空间包含10,461,394,944,000个状态，这使得寻找最优解代价高昂，也使该拼图成为启发式搜索的标准测试平台。<sup>[3](https://www.mdpi.com/2073-431X/12/1/11)</sup><sup> • </sup><sup>[11](https://kociemba.org/themen/fifteen/fifteensolver.html)</sup>Ratner和Warmuth在《符号计算杂志》10, 111-137（1990）中证明，为15数码难题的（N×N）推广寻找最短解是难解的。<sup>[2](https://mathworld.wolfram.com/15Puzzle.html)</sup>

**启发式搜索**是标准方法。最常见的启发式包括错位滑块数、[曼哈顿距离](https://www.edgepedia.org/zh/manhattan-distance)（每块滑块距其目标位置的网格距离之和）、线性冲突（每对处于正确行或列但顺序错误的滑块加两步）、步行距离，以及模式数据库——存储滑块子集精确距离的查找表。<sup>[3](https://www.mdpi.com/2073-431X/12/1/11)</sup>使用曼哈顿距离的IDA*（迭代加深A*）算法能为随机实例找到最优解，最优解长度平均为53步。<sup>[4](https://tjhsst.edu/~rlatimer/ai2007/Korf-slides.pdf)</sup>模式数据库能大幅改进：7-8加性模式数据库很有效，但内存占用大，约575兆字节，<sup>[3](https://www.mdpi.com/2073-431X/12/1/11)</sup>而在标准100个局面上使用模式数据库配合IDA*，搜索节点数减少了一千倍以上。<sup>[10](https://doi.org/10.1007/3-540-61291-2_68)</sup>一个78块划分的模式数据库平均能在几毫秒内解出随机实例。<sup>[11](https://kociemba.org/themen/fifteen/fifteensolver.html)</sup>

最坏情况已精确确定。n×n推广在n = 1、2、3、4时所需的最大移动步数分别为0、6、31和80步（OEIS A087725；Brüngger等1999），因此即使最难的15数码难题也能在80步内解出。<sup>[2](https://mathworld.wolfram.com/15Puzzle.html)</sup><sup> • </sup><sup>[5](https://inventwithpython.com/recursion/chapter12.html)</sup>

## References

1. [Sliding Tile Puzzles, Explained, Shapedoku](https://www.shapedoku.com/articles/sliding-tile-puzzles-explained)
2. [15 Puzzle, Wolfram MathWorld](https://mathworld.wolfram.com/15Puzzle.html)
3. [The Fifteen Puzzle: A New Approach through Hybridizing Three Heuristics Methods, Computers (MDPI) 12(1):11, 2023](https://www.mdpi.com/2073-431X/12/1/11)
4. [Recent Progress in the Design and Analysis of Admissible Heuristic Functions, R. E. Korf slides](https://tjhsst.edu/~rlatimer/ai2007/Korf-slides.pdf)
5. [Chapter 12: Sliding-Tile Solver, The Recursive Book of Recursion](https://inventwithpython.com/recursion/chapter12.html)
6. [The 15 Puzzle (1880), Puzzlebyrinth](https://puzzlebyrinth.com/en/articles/fifteen-puzzle-1880)
7. [Universiteit Leiden thesis citing the 14-15 puzzle prizes](https://theses.liacs.nl/pdf/LucEdixhoven.pdf)
8. [Johnson, W. W. and Story, W. E. (1879). Notes on the "15" Puzzle. American Journal of Mathematics 2(4), 397-404, JSTOR](https://www.jstor.org/stable/2369492)
9. [15 Puzzle: Rules, Solvability and a Method That Always Works, Play Board Games](https://playboardgames.org/how-to-play/15-puzzle)
10. [Searching with Pattern Databases (1996), Culberson and Schaeffer, SciSpace](https://doi.org/10.1007/3-540-61291-2_68)
11. [Fifteen Puzzle Optimal Solver, Herbert Kociemba](https://kociemba.org/themen/fifteen/fifteensolver.html)
12. [15 Puzzle Parity, The Proof of Why Some Configurations Are Unsolvable · Slide Puzzle](https://slidepuzzle.app/15-puzzle-parity/)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 19, 2026; Oct 21, 2026 · Edited: Sep 19, 2026; Oct 21, 2026 · Last review: Oct 21, 2026*

Topic: 体育、游戏与休闲 › 棋牌与益智游戏 › 益智游戏 › Physical, logic, and word puzzles › Sliding, interlocking, and disentanglement puzzles

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/15-puzzle

English original: https://www.edgepedia.org/15-puzzle
