有解数独的公式吗?
最后更新
没有公式。Sudoku不是一个数学问题——它是一个恰好使用数字的逻辑谜题。没有方程或算术公式直接产生答案。有效的是系统约束消除。
为什么数学不能解决它
The digits 1-9 in Sudoku are just symbols. You could replace them with letters or colours and the puzzle would be identical. What matters is uniqueness within units - Each symbol appears exactly once in every row, column, and box. There is no arithmetic relationship between cells that a formula can exploit.
真正有效的方法 - Constraint Propagation
Sudoku is a constraint-satisfaction problem. You start with 81 cells, each constrained by its row, column, and box. Placing one digit propagates new constraints - That digit is eliminated from 20 other cells. The chain reaction continues until the puzzle is solved or a more complex technique is needed.
The technique hierarchy, simplest to hardest:
- Naked singles - 一个cell中剩余一个candidate
- Hidden singles - 一个digit在unit中的一个位置
- Naked and hidden pairs, triples
- X-Wing, Swordfish
- Chains and multi-step logic
计算机取而代之的做法
计算机使用回溯搜索解决数独——尝试一个数字,传播约束,如果达到矛盾则反转。对人类来说,这等同于猜测,既不令人满意也没有教育意义。人类解题总是偏好无需任何试错就能保证正确性的演绎技巧。