# 数独的数学

数独的数学是描述这一经典9×9逻辑谜题的一系列组合、代数与计算结果：在一个网格中，每一行、每一列以及九个3×3宫中的每一个，都必须恰好包含数字1到9各一次。尽管谜题使用数字，求解它却不需要算术；这些数字充当九个不同的符号，而数学上的兴趣在于计数网格、刻画对称性、建模约束，以及衡量谜题求解的难度。<sup>[1](https://mathworld.wolfram.com/Sudoku.html)</sup><sup> • </sup><sup>[2](https://www.cs.virginia.edu/~robins/The_Science_Behind_SudoKu.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 结构 | 一个完成的经典数独是一个9×9拉丁方，外加要求每个3×3宫恰好包含1–9各一次<sup>[1](https://mathworld.wolfram.com/Sudoku.html)</sup> |
| 完成网格数 | 6,670,903,752,021,072,936,960个有效的9×9解网格（费尔根豪尔（Felgenhauer）与贾维斯（Jarvis），2005）<sup>[2](https://www.cs.virginia.edu/~robins/The_Science_Behind_SudoKu.pdf)</sup> |
| 本质不同网格数 | 在把重新标记、旋转、反射以及行、列、块置换等因素排除后，有5,472,730,538个网格<sup>[2](https://www.cs.virginia.edu/~robins/The_Science_Behind_SudoKu.pdf)</sup> |
| 最少提示数 | 17条提示足以得到唯一解，而穷举计算机搜索证明不存在16条提示的谜题<sup>[3](https://arxiv.org/abs/1201.0749)</sup> |
| 精确覆盖规模 | 324个约束（单元格、行-数字、列-数字和宫-数字要求各81个），候选赋值最多729个<sup>[4](https://veyraplay.com/guides/sudoku/theory/sudoku-and-mathematics/)</sup> |
| 复杂度 | 广义n²×n²数独是NP完全的；固定的9×9谜题是一个有限问题<sup>[5](https://prism.nicofortuin.com/algorithms/sudoku/)</sup> |
| 已知17提示数谜题 | 戈登·罗伊尔（Gordon Royle）在2005年至2009年间收集了49,151个两两不同构的17提示数谜题<sup>[6](https://journals.sagepub.com/doi/10.3233/ICG-2013-36302)</sup> |

## 数独作为带宫约束的拉丁方

n阶拉丁方是一个n×n阵列，填入n个符号，使得任何一行或一列中都没有符号重复；[莱昂哈德·欧拉](https://www.edgepedia.org/zh/leonhard-euler)（Leonhard Euler）在18世纪命名并研究了这些网格。一个完成的数独网格，常被称为解网格，是一个9阶拉丁方，并带有一个附加条件：九个3×3子网格中的每一个也必须恰好包含数字1到9各一次。<sup>[2](https://www.cs.virginia.edu/~robins/The_Science_Behind_SudoKu.pdf)</sup> 康奈尔数学探索者俱乐部将其推广为秩n数独，即一个n²×n²网格，细分为n²个大小为n×n的块，填入数字1到n²，并在行、列和块上遵循同一条“规则”。<sup>[7](https://pi.math.cornell.edu/~mec/Summer2009/Mahmood/Intro.html)</sup>

[拉丁方](https://www.edgepedia.org/zh/latin-square)的血统解释了为什么数字本身可以互换。把每个数字一致地替换为另一个符号，例如1换成A，2换成B，等等，谜题的结构保持不变，这就是为什么加法或乘法从来不会对解题者有帮助。<sup>[2](https://www.cs.virginia.edu/~robins/The_Science_Behind_SudoKu.pdf)</sup><sup> • </sup><sup>[4](https://veyraplay.com/guides/sudoku/theory/sudoku-and-mathematics/)</sup> 宫约束正是数独与其祖先的区别所在：每个数独网格都是拉丁方，但由于附加的子网格条件，数独网格的数量要小得多。<sup>[2](https://www.cs.virginia.edu/~robins/The_Science_Behind_SudoKu.pdf)</sup>

## 计数网格

**总数。** 德累斯顿工业大学的贝特拉姆·费尔根豪尔与[谢菲尔德大学](https://www.edgepedia.org/zh/university-of-sheffield)的弗雷泽·贾维斯于2005年确定，有效的完成9×9数独网格数为6,670,903,752,021,072,936,960，这一结果此后被多次验证。<sup>[2](https://www.cs.virginia.edu/~robins/The_Science_Behind_SudoKu.pdf)</sup> 作为比较，9阶拉丁方的数量为5,524,751,496,156,892,842,531,225,600；若只计约化形式，则为377,597,570,964,258,816，这一结果由斯坦利·E·巴梅尔（Stanley E. Bammel）与杰罗姆·罗思坦（Jerome Rothstein）于1975年发表在《[离散数学](https://www.edgepedia.org/zh/discrete-mathematics-journal)》（*Discrete Mathematics*）上。<sup>[2](https://www.cs.virginia.edu/~robins/The_Science_Behind_SudoKu.pdf)</sup>

**等价与对称。** [群论](https://www.edgepedia.org/zh/group-theory)识别出仅通过平凡变换而不同的网格：重新标记数字，反射或旋转网格，置换列带1–3、4–6和7–9或对应的行带，以及在带内置换行或列。每个等价类只计一次，总数便降至5,472,730,538个本质不同的网格，这一数字由拉塞尔（Russell）与贾维斯计算得出，略低于世界人口。<sup>[2](https://www.cs.virginia.edu/~robins/The_Science_Behind_SudoKu.pdf)</sup> 这样的等价类中字典序最小的网格称为最小字典序形式（minlex form），是枚举与搜索工作中使用的一种规范表示。<sup>[8](https://www.sciencedirect.com/science/article/pii/S0167637724000415)</sup>

## 最少提示数

一个谜题通过填入一些单元格来呈现，这些单元格称为已知数或提示数，而谜题的核心计数问题是：少到多少条提示仍然能强制得到唯一解。标准9×9谜题的答案是17：存在带有17条提示且具有唯一解的有效谜题，而不存在16条提示的谜题。<sup>[3](https://arxiv.org/abs/1201.0749)</sup>

**无16提示数的证明。** 都柏林大学学院的加里·麦圭尔（Gary McGuire）与巴斯蒂安·图格曼（Bastian Tugemann）、吉勒·西瓦里奥（Gilles Civario）一起，通过穷举计算机搜索解决了这个问题，结果发表在2012年的论文《不存在16条提示的数独：求解数独最少提示数问题》中。该搜索检查了可能的16提示数谜题空间，没有发现任何具有唯一解的谜题，从而证明17是真正的最小值。<sup>[3](https://arxiv.org/abs/1201.0749)</sup><sup> • </sup><sup>[9](https://sudokustreak.com/en/school/how-many-clues-sudoku/)</sup> 该方法依赖于不可避免集，即若干单元格的集合，如果要使完成的网格具有唯一解，其中至少有一个单元格必须携带提示；围绕这些集合组织候选提示布局，将搜索缩减到可行的规模。<sup>[10](https://soddoo.com/blog/seventeen-clues-are-enough/)</sup>

**最少与极小。** 最少提示数谜题使用尽可能少的提示数，对标准网格而言是17。极小谜题是另一个概念：不能移除任何单条提示而不破坏唯一性，而极小谜题可以拥有远多于17条提示。<sup>[10](https://soddoo.com/blog/seventeen-clues-are-enough/)</sup> 提示数也不是难度评级；一个17提示数谜题可能容易也可能困难，取决于提示如何排列。<sup>[9](https://sudokustreak.com/en/school/how-many-clues-sudoku/)</sup><sup> • </sup><sup>[10](https://soddoo.com/blog/seventeen-clues-are-enough/)</sup>

**细化。** 戈登·罗伊尔在2005年至2009年间收集了49,151个17提示数谜题，其中没有两个同构；后来林宏轩（Hung-Hsuan Lin）、吴毅成（I-Chen Wu）与魏廷翰（Tinghan Wei）的工作提出了基于最上方9×3单元格中提示数来寻找17提示数谜题的算法。<sup>[6](https://journals.sagepub.com/doi/10.3233/ICG-2013-36302)</sup> 2024年《运筹学快报》（*Operations Research Letters*）上的一篇论文，由根尼萨雷特·丘西拉（Gennesaret Tjusila）、马蒂厄·贝桑松（Mathieu Besançon）、马克·特纳（Mark Turner）与托尔斯滕·科赫（Thorsten Koch）撰写，研究了更具体的“最小数独提示问题”，即求最少的提示数，使其唯一解为一个给定的完成网格；他们将其表述为二元双层线性规划，并将50个测试实例中的95%求解到最优。<sup>[8](https://www.sciencedirect.com/science/article/pii/S0167637724000415)</sup> 对于广义数独规模，最少提示数问题在诸如2×4数独等情形中仍然开放。<sup>[11](https://www.researchgate.net/publication/257909952_Minimal_number_of_clues_for_Sudokus)</sup>

## 精确覆盖与算法

经典数独可以编码为一个精确覆盖问题。一个完成的解必须满足四类要求：每个单元格恰好包含一个数字，每一行恰好包含每个数字一次，每一列恰好包含每个数字一次，每个宫恰好包含每个数字一次。这就给出81个单元格要求、81个行-数字要求、81个列-数字要求和81个宫-数字要求，总共324个约束。在应用已知数之前，最多有729个候选的行-列-数字赋值，而一个有效解是选择一组赋值，使每个约束恰好被覆盖一次。<sup>[4](https://veyraplay.com/guides/sudoku/theory/sudoku-and-mathematics/)</sup>

这种表示将谜题与唐纳德·克努特（Donald Knuth）的算法X联系起来，通常用他的舞蹈链（Dancing Links）数据结构实现，该结构高效地支持覆盖与取消覆盖操作；同样的方法可以找到一个解，或枚举足够多的解来检验唯一性。<sup>[4](https://veyraplay.com/guides/sudoku/theory/sudoku-and-mathematics/)</sup><sup> • </sup><sup>[12](https://veyraplay.com/guides/sudoku/theory/how-computers-solve-sudoku/)</sup> 数独也是约束满足问题的标准例子：每个单元格有一个小定义域，每一行、每一列和每个宫都是一个全不同组，而带有约束传播的回溯利用这些性质。同样的结构支持图着色模型，其中单元格是顶点，约束添加边，而数独变体中的任何额外约束只是向图中添加更多边。<sup>[5](https://prism.nicofortuin.com/algorithms/sudoku/)</sup><sup> • </sup><sup>[13](https://finalsudoku.com/math-sudoku)</sup>

## 计算复杂度

对于固定的9×9棋盘，求解是一个有限问题，精确覆盖搜索可以快速处理。复杂度陈述适用于整个族：广义n²×n²数独是NP完全的，这一结果由八户隆之（Takayuki Yato）与濑田隆弘（Takahiro Seta）于2003年得出，因此对于一般情形，尚不知道有任何多项式时间算法。<sup>[5](https://prism.nicofortuin.com/algorithms/sudoku/)</sup><sup> • </sup><sup>[14](https://github.com/trifle-labs/howtowin.games/blob/main/games/sudoku.md)</sup>

## 谜题及其研究的历史

现代形式的这一谜题由美国人霍华德·加恩斯（Howard Garns）创造，并于1979年5月由戴尔铅笔谜题与文字游戏（Dell Pencil Puzzles and Word Games）以“数字位置”（Number Place）为名匿名首次发表。1984年，日本谜题公司尼科利（Nikoli）出版了它，并给它取名为数独，大致意为“单个数字”；由于尼科利在日本将该名称注册为商标，日本出版物便用其英文名称来称呼这个谜题，而英语使用者则使用日文名称。新西兰人韦恩·古尔德（Wayne Gould）编写了一个生成程序，并从2004年末起在伦敦《泰晤士报》（*Times*）上刊登谜题，此后该谜题于2005年通过世界各地的报纸传播开来。<sup>[2](https://www.cs.virginia.edu/~robins/The_Science_Behind_SudoKu.pdf)</sup><sup> • </sup><sup>[7](https://pi.math.cornell.edu/~mec/Summer2009/Mahmood/Intro.html)</sup> 由欧拉命名的拉丁方的数学血统，与谜题的出版历史是两条独立的线索，而谜题的祖先是拉丁方，而不是幻方。<sup>[2](https://www.cs.virginia.edu/~robins/The_Science_Behind_SudoKu.pdf)</sup><sup> • </sup><sup>[4](https://veyraplay.com/guides/sudoku/theory/sudoku-and-mathematics/)</sup>

## References

1. [Sudoku, Wolfram MathWorld](https://mathworld.wolfram.com/Sudoku.html)
2. [Jean-Paul Delahaye, "The Science behind Sudoku," Scientific American (2006)](https://www.cs.virginia.edu/~robins/The_Science_Behind_SudoKu.pdf)
3. [Gary McGuire, Bastian Tugemann, Gilles Civario, "There is no 16-Clue Sudoku: Solving the Sudoku Minimum Number of Clues Problem," arXiv:1201.0749](https://arxiv.org/abs/1201.0749)
4. [Sudoku and Mathematics: Latin Squares, Constraints & Counting, Veyra Play](https://veyraplay.com/guides/sudoku/theory/sudoku-and-mathematics/)
5. [Sudoku solver, visualized, explained, Prism](https://prism.nicofortuin.com/algorithms/sudoku/)
6. [Hung-Hsuan Lin, I-Chen Wu, Tinghan Wei, "On Specific 17-clue Sudoku Puzzles," ICGA Journal (2013)](https://journals.sagepub.com/doi/10.3233/ICG-2013-36302)
7. [The Math Behind Sudoku: Introduction to Sudoku, Cornell Math Explorers' Club](https://pi.math.cornell.edu/~mec/Summer2009/Mahmood/Intro.html)
8. [Tjusila, Besançon, Turner, Koch, "How many clues to give? A bilevel formulation for the minimum Sudoku clue problem," Operations Research Letters 54 (2024)](https://www.sciencedirect.com/science/article/pii/S0167637724000415)
9. [how many clues does a sudoku need? (the answer is 17) - sudokustreak](https://sudokustreak.com/en/school/how-many-clues-sudoku/)
10. [Seventeen clues are enough, Soddoo](https://soddoo.com/blog/seventeen-clues-are-enough/)
11. [Minimal number of clues for Sudokus, ResearchGate](https://www.researchgate.net/publication/257909952_Minimal_number_of_clues_for_Sudokus)
12. [How Computers Solve Sudoku: Algorithms, Backtracking and Exact Cover, Veyra Play](https://veyraplay.com/guides/sudoku/theory/how-computers-solve-sudoku/)
13. [Math Sudoku, The Mathematics Behind Sudoku Puzzles, Final Sudoku](https://finalsudoku.com/math-sudoku)
14. [howtowin.games Sudoku reference notes, GitHub](https://github.com/trifle-labs/howtowin.games/blob/main/games/sudoku.md)

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

Topic: 体育、游戏与休闲 › 棋牌与益智游戏 › 益智游戏 › 实体、逻辑与文字益智游戏 › 数独及其数学

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/mathematics-of-sudoku

English original: https://www.edgepedia.org/mathematics-of-sudoku
