# P与NP问题

P与NP问题问的是：是否每一个解可以被快速验证的判定问题，也能够被快速求解？用形式化的语言说，它问的是：每一个能在多项式时间内被非确定性算法识别的语言，是否同样能在多项式时间内被确定性算法识别<sup>[1](https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf)</sup>。它是克雷数学研究所（Clay Mathematics Institute）七大千禧年大奖难题之一，每道题悬赏100万美元，奖金池共700万美元，由该研究所设立这份难题清单时一并成立<sup>[2](https://www.claymath.org/wp-content/uploads/2022/02/MPPc.pdf)</sup>。大多数复杂性理论家认为P ≠ NP；然而截至2025年，还没有人找到一个多项式时间算法能解决哪怕一个NP完全问题，同样也没有人证明这样的算法不可能存在。<sup>[1](https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf)</sup><sup> • </sup><sup>[3](https://www.arxiv.org/pdf/2508.13166)</sup>

| 关键事实 | 详情 |
|---|---|
| 问题本身 | 是否每一个解可以被高效验证的问题（NP）也都可被高效求解（P）？形式化地说：每一个能在多项式时间内被非确定性接受的语言，是否也能在多项式时间内被确定性接受？<sup>[1](https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf)</sup><sup> • </sup><sup>[4](https://cacm.acm.org/research/the-status-of-the-p-versus-np-problem/)</sup> |
| 奖项状态 | 克雷千禧年大奖七大难题之一；每道题100万美元，奖金池共700万美元<sup>[2](https://www.claymath.org/wp-content/uploads/2022/02/MPPc.pdf)</sup> |
| 桥梁定理 | 库克（Cook，1971）证明：每一个非确定性多项式时间识别问题都可归约为命题重言式问题，由此创立了NP完全性理论<sup>[5](https://dl.acm.org/doi/10.1145/800157.805047)</sup> |
| 问题目录的规模 | 已知的例子包括团问题、三着色问题和旅行商问题<sup>[6](https://cacm.acm.org/research/fifty-years-of-p-vs-np-and-the-possibility-of-the-impossible/)</sup> |
| 3-SAT的已知上界 | 对于n个变量，约为1.5<sup>n</sup><sup>[1](https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf)</sup> |
| 实用求解器 | 竞赛级SAT求解器常常能判定含一百万个变量的公式的可满足性<sup>[4](https://cacm.acm.org/research/the-status-of-the-p-versus-np-problem/)</sup> |
| 专家信念 | 大多数复杂性理论家相信P ≠ NP<sup>[1](https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf)</sup> |
| 已知的障碍 | 相对化、自然证明和代数化均已被证明不足以解决该问题<sup>[3](https://www.arxiv.org/pdf/2508.13166)</sup> |

## 形式定义

**P** 是这样一类判定问题：它们可由某个算法在步数不超过输入长度的某个固定多项式的范围内求解，这一形式化建立在艾伦·图灵（Alan Turing）于1936年提出的图灵机模型之上<sup>[1](https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf)</sup>。等价地说，P是可由标准数字计算机在时间上界为输入长度的某个固定幂次的范围内求解的问题类<sup>[7](https://www.scottaaronson.com/papers/pnp.pdf)</sup>。杰克·埃德蒙兹（Jack Edmonds）在1965年给出一个高效的匹配算法时，提出了这种关于“高效计算”的形式定义<sup>[4](https://cacm.acm.org/research/the-status-of-the-p-versus-np-problem/)</sup>。

**NP** 是这样一类问题：如果答案为“是”，则存在一个多项式大小的证明，图灵机可在多项式时间内验证它；它也可以通过多项式时间检验关系来定义<sup>[7](https://www.scottaaronson.com/papers/pnp.pdf)</sup><sup> • </sup><sup>[1](https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf)</sup>。检验与求解之间的不对称是具体的：验证300个人构成一个团需要检查44,850对关系，这很快，而找出这样一个团却不知道是否属于P<sup>[6](https://cacm.acm.org/research/fifty-years-of-p-vs-np-and-the-possibility-of-the-impossible/)</sup>。显然有P ⊆ NP，所以问题就在于这个包含关系是否为真包含<sup>[7](https://www.scottaaronson.com/papers/pnp.pdf)</sup>。

一个问题如果是NP困难的，指的是针对它的算法可以通过多项式时间归约用来求解任何NP问题；一个问题如果既是NP的又是NP困难的，就是NP完全的<sup>[8](https://www.britannica.com/science/P-versus-NP-problem)</sup>。NP完全问题包括团问题、哈密顿回路问题和三着色问题：其中任何一个问题的高效算法都能给出整个NP类的高效算法<sup>[4](https://cacm.acm.org/research/the-status-of-the-p-versus-np-problem/)</sup>。库克1971年的STOC论文证明：任何由多项式时间有界非确定性图灵机解决的识别问题，都可归约为判定一个给定命题公式是否为重言式<sup>[5](https://dl.acm.org/doi/10.1145/800157.805047)</sup>。卡普（Karp）1971年的论文随后在21个组合问题之间建立了多项式时间可归约性，并引入了标准的P与NP记号<sup>[9](https://www.cs.cmu.edu/~15455/resources/Karp1971.pdf)</sup>。三种可设想的解决方式是：证明P ≠ NP，证明P = NP，或证明该命题独立于某个指定的形式系统<sup>[10](https://people.cs.rutgers.edu/~allender/papers/advances.in.computing.pdf)</sup>。

## 历史

1965年，杰克·埃德蒙兹给出了一个高效的匹配算法，并提出将高效计算形式化地定义为输入大小的某个固定多项式的时间，P类之名即由此而来<sup>[4](https://cacm.acm.org/research/the-status-of-the-p-versus-np-problem/)</sup>。库克、莱文（Levin）和卡普随后发展了NP完全性的初始理论，这项工作催生了多项ACM图灵奖；20世纪70年代，又有数百个问题被证明是NP完全的，由加里（Garey）和约翰逊（Johnson）整理成目录<sup>[4](https://cacm.acm.org/research/the-status-of-the-p-versus-np-problem/)</sup>。大卫·S·约翰逊（David S. Johnson）关于NP完全性（1954–2012）的历史记录下了奠基者们所获得的认可：1979年离散数学领域的富尔克森奖、1985年的ACM图灵奖，以及1990年的ORSA/TIMS冯·诺依曼理论奖<sup>[11](https://www.maths.tcd.ie/EMIS/journals/DMJDMV/vol-ismp/50_johnson-david.pdf)</sup>。克雷数学研究所于1998年9月25日注册成立，并设立了包括P与NP在内的七大千禧年大奖难题<sup>[2](https://www.claymath.org/wp-content/uploads/2022/02/MPPc.pdf)</sup>。2021年，这个问题满50岁了，而它的解决仍遥遥无期<sup>[6](https://cacm.acm.org/research/fifty-years-of-p-vs-np-and-the-possibility-of-the-impossible/)</sup>。

## 为何困难：已知的障碍

要证明P ≠ NP，只需证明某个NP完全问题不能由与门、或门和非门构成的多项式大小电路求解<sup>[4](https://cacm.acm.org/research/the-status-of-the-p-versus-np-problem/)</sup>。这条电路复杂性路线已经取得了受限的成功：2010年，瑞安·威廉姆斯（Ryan Williams）证明了NEXP不存在带模6门的小规模常数深度电路<sup>[6](https://cacm.acm.org/research/fifty-years-of-p-vs-np-and-the-possibility-of-the-impossible/)</sup>。但若干宽泛的证明路线已被证明是不够的。相对化证明——即在计算被赋予预言机访问权限时仍然有效的证明——本身无法解决P与NP之间的关系，这由贝克（Baker）、吉尔（Gill）和索洛韦（Solovay）证明<sup>[3](https://www.arxiv.org/pdf/2508.13166)</sup>。自然证明基于电路下界，在单向函数存在的假设下无法直接解决问题，这是拉兹博罗夫（Razborov）和鲁迪奇（Rudich）的结论<sup>[3](https://www.arxiv.org/pdf/2508.13166)</sup><sup> • </sup><sup>[4](https://cacm.acm.org/research/the-status-of-the-p-versus-np-problem/)</sup>。阿伦森（Aaronson）和维格德森（Wigderson）的代数化障碍表明，该问题也无法通过任何代数化的证明技术来解决<sup>[10](https://people.cs.rutgers.edu/~allender/papers/advances.in.computing.pdf)</sup>。在2009年那篇综述之前的20年里，没有出现任何显著新的电路下界<sup>[4](https://cacm.acm.org/research/the-status-of-the-p-versus-np-problem/)</sup>。针对悲观论调，斯科特·阿伦森（Scott Aaronson）论证道：鉴于弗斯特–萨克斯–西普瑟（Furst–Saxe–Sipser）、阿伊泰（Ajtai）、拉兹博罗夫和斯莫伦斯基（Smolensky）的电路下界，P与NP问题在形式上独立于强逻辑理论的可能性，并不比哥德巴赫猜想或黎曼猜想更大<sup>[12](https://scottaaronson.com/papers/indep.pdf)</sup>。

## 数字一览

求解3-SAT的算法的已知上界约为1.5<sup>n</sup>，其中n是输入公式中的变量数<sup>[1](https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf)</sup>。与这一最坏情况下的指数级相对，竞赛级SAT求解器常常能判定含一百万个变量的公式的可满足性<sup>[4](https://cacm.acm.org/research/the-status-of-the-p-versus-np-problem/)</sup>；而借助改进的启发式方法、快速处理器、专用硬件和分布式云计算，从业者常常能求解含数万个变量、数十万甚至数百万个约束的可满足性问题和混合整数规划实例<sup>[6](https://cacm.acm.org/research/fifty-years-of-p-vs-np-and-the-possibility-of-the-impossible/)</sup>。2024年一篇《自然》系期刊的文章列出了卡普21个NP完全问题各自的最佳经典算法，列出了SAT的Chaff、GRASP、GSAT和WalkSAT等求解器以及TSP的Concorde求解器<sup>[13](https://www.nature.com/articles/s44335-024-00015-z/tables/4)</sup>。已知的NP完全问题有很多<sup>[6](https://cacm.acm.org/research/fifty-years-of-p-vs-np-and-the-possibility-of-the-impossible/)</sup>。

## 与不可判定性及相关问题的比较

P与NP是一个关于效率而非可计算性的问题。复杂性理论将可行的可判定性定义为多项式时间可解，而P可以被形式化地证明与EXP（指数时间）不同；因此有些问题可被证明是不可行的，但并非不可判定<sup>[14](https://plato.stanford.edu/entries/computational-complexity/)</sup>。这就把该问题与不可判定性区分开来，后者关心的是究竟是否存在任何算法<sup>[14](https://plato.stanford.edu/entries/computational-complexity/)</sup>。已知的包含链是L ⊆ NL ⊆ P ⊆ NP ⊆ PSPACE ⊆ EXP ⊆ NEXP ⊆ EXPSPACE，这将P与NP问题置于一系列类似的复杂性类分离问题之中，例如P与PSPACE是否相等<sup>[14](https://plato.stanford.edu/entries/computational-complexity/)</sup>。

## 实际意义

**密码学。** 如果P = NP，那么公钥密码学就不可能存在；NP的一个高效算法将攻破所有密码系统，除了信息论上安全的系统，如一次性密码本和某些基于量子物理的方案<sup>[4](https://cacm.acm.org/research/the-status-of-the-p-versus-np-problem/)</sup><sup> • </sup><sup>[6](https://cacm.acm.org/research/fifty-years-of-p-vs-np-and-the-possibility-of-the-impossible/)</sup>。现代密码学依赖于这样一个假设：分解两个大素数的乘积不属于P：验证乘积在多项式时间内很容易，但计算出两个素因子却很难<sup>[8](https://www.britannica.com/science/P-versus-NP-problem)</sup>。仅仅假设P ≠ NP对公钥协议来说还不够；还需要关于分解或相关问题困难性的强平均情况假设<sup>[4](https://cacm.acm.org/research/the-status-of-the-p-versus-np-problem/)</sup>。证明密码学中用到的某个NP问题是超多项式困难的，其本身就会蕴含P ≠ NP，因此密码学必须依赖目前无法证明的困难性假设<sup>[15](https://pqcc.org/an-inconvenient-truth-about-modern-cryptography/)</sup>。还有一个微妙之处：尽管解决一个NP完全问题将能破解加密，但反过来并不成立，因为大多数加密方案背后的难解问题本身并不是NP完全的<sup>[16](https://www.scientificamerican.com/article/the-math-mystery-that-connects-sudoku-flight-schedules-and-protein-folding/)</sup>。

**优化与验证。** 算法和硬件的巨大进步使得许多NP完全问题得以攻克，而在破解密码系统方面却进展甚微<sup>[6](https://cacm.acm.org/research/fifty-years-of-p-vs-np-and-the-possibility-of-the-impossible/)</sup>。NP问题求解工具已被成功应用于电路与代码验证、计算生物学、系统安全、产品与包装设计、金融交易，以及求解困难的数学问题<sup>[6](https://cacm.acm.org/research/fifty-years-of-p-vs-np-and-the-possibility-of-the-impossible/)</sup>。

**为何快速求解器与P ≠ NP并存。** 最坏情况下的NP完全性并不决定典型情况的难度。说NP“在实践中”容易是错误的，同样，当实例具有已知的生成结构时，把NP困难性当作一个问题复杂性的最终结论也是错误的；理解典型情况复杂性以及启发式方法的能力与局限很重要<sup>[17](https://introtcs.org/public/lec_14_PvsNP.html)</sup>。现实世界中的密码攻击源于糟糕的实现、弱随机数生成器或人为错误，而非破解了密码学本身<sup>[6](https://cacm.acm.org/research/fifty-years-of-p-vs-np-and-the-possibility-of-the-impossible/)</sup>。

**如果P = NP。** 一个证明将给出那些拥有合理长度证明的定理的简短逻辑证明；如果该算法在实践中是高效的，人们就可以搜索其他千禧年猜想的形式化证明，从而实际上不仅解决一个千禧年难题，而是全部七个<sup>[4](https://cacm.acm.org/research/the-status-of-the-p-versus-np-problem/)</sup><sup> • </sup><sup>[7](https://www.scottaaronson.com/papers/pnp.pdf)</sup>。

## 量子计算与实际图景

洛夫·格罗弗（Lov Grover）发现了一种量子算法，可作用于一般的NP问题，但只实现了二次加速，且有证据表明这些技术不会走得更远<sup>[4](https://cacm.acm.org/research/the-status-of-the-p-versus-np-problem/)</sup>。另外，自肖尔（Shor）1994年的论文以来，分解和离散对数问题（包括椭圆曲线）在理论上可以在强大的量子计算机上高效求解；2016年，NIST启动了后量子密码学项目，以挑选抗量子算法<sup>[15](https://pqcc.org/an-inconvenient-truth-about-modern-cryptography/)</sup>。

## 近期进展

截至2025年，尚无被接受的解决方案<sup>[3](https://www.arxiv.org/pdf/2508.13166)</sup>。2024至2025年间，邓（Deng）的一篇论文声称给出了一个多项式时间算法，可判定最大度为4的图的三着色问题，这将蕴含P = NP；2025年一篇arXiv反驳文章指出了一个关键错误：该证明混淆了子图与诱导子图，从而使其失效<sup>[18](https://arxiv.org/pdf/2507.09018)</sup>。这一声称针对的是一个真正困难的情形：霍利尔（Holyer）在1981年证明，即使每个顶点的度至多为4，判定一个图是否可三着色仍是NP完全的<sup>[18](https://arxiv.org/pdf/2507.09018)</sup>。除了经过同行评审的工作之外，未经审查的声称不断出现：2025年一份自行发表在Zenodo上的记录声称通过柯尔莫哥洛夫复杂性见证不可压缩性给出了P ≠ NP的构造性证明，并宣称其能抵御相对化、自然证明和代数化；Zenodo上的存储内容不经过同行评审<sup>[19](https://zenodo.org/records/15529778)</sup>。正如2025年一篇综述所指出的，经过多年研究，还没有人找到求解任何NP完全问题的多项式时间方法，但也没有人证明这样的方法不可能存在<sup>[3](https://www.arxiv.org/pdf/2508.13166)</sup>。主流研究继续通过证明复杂性间接推进，其中库克和雷克豪（Reckhow）的结果——NP ≠ coNP当且仅当每个命题证明系统都有超多项式下界，包括扩展弗雷格系统——勾勒了通向分离的公认路径<sup>[20](https://dl.acm.org/doi/pdf/10.1145/3801091)</sup>。

## References

1. [Stephen Cook. The P versus NP Problem (official Clay Millennium problem statement), Clay Mathematics Institute.](https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf)
2. [The Millennium Prize Problems, Clay Mathematics Institute.](https://www.claymath.org/wp-content/uploads/2022/02/MPPc.pdf)
3. [Survey of proof techniques and barriers for the P versus NP question, arXiv (2025).](https://www.arxiv.org/pdf/2508.13166)
4. [The Status of the P versus NP Problem, Communications of the ACM (2009).](https://cacm.acm.org/research/the-status-of-the-p-versus-np-problem/)
5. [Stephen A. Cook (1971). The complexity of theorem-proving procedures, STOC.](https://dl.acm.org/doi/10.1145/800157.805047)
6. [Fifty Years of P vs. NP and the Possibility of the Impossible, Communications of the ACM (2021).](https://cacm.acm.org/research/fifty-years-of-p-vs-np-and-the-possibility-of-the-impossible/)
7. [Scott Aaronson. P ≟ NP (survey).](https://www.scottaaronson.com/papers/pnp.pdf)
8. [P versus NP problem, Encyclopaedia Britannica.](https://www.britannica.com/science/P-versus-NP-problem)
9. [Richard M. Karp (1971). Reducibility Among Combinatorial Problems.](https://www.cs.cmu.edu/~15455/resources/Karp1971.pdf)
10. [Eric Allender. A Status Report on the P versus NP Question.](https://people.cs.rutgers.edu/~allender/papers/advances.in.computing.pdf)
11. [David S. Johnson. A Brief History of NP-Completeness, 1954–2012.](https://www.maths.tcd.ie/EMIS/journals/DMJDMV/vol-ismp/50_johnson-david.pdf)
12. [Scott Aaronson. Is P vs. NP Formally Independent?](https://scottaaronson.com/papers/indep.pdf)
13. [Table 4: Best classical algorithms for Karp's 21 NP-complete problems, Nature npj Unconventional Computing (2024).](https://www.nature.com/articles/s44335-024-00015-z/tables/4)
14. [Computational Complexity Theory, Stanford Encyclopedia of Philosophy.](https://plato.stanford.edu/entries/computational-complexity/)
15. [An inconvenient truth about modern cryptography, Post-Quantum Cryptography Coalition.](https://pqcc.org/an-inconvenient-truth-about-modern-cryptography/)
16. [The math mystery that connects Sudoku, flight schedules and protein folding, Scientific American.](https://www.scientificamerican.com/article/the-math-mystery-that-connects-sudoku-flight-schedules-and-protein-folding/)
17. [Introduction to Theoretical Computer Science: What if P equals NP?](https://introtcs.org/public/lec_14_PvsNP.html)
18. [Critical examination of Deng's "P=NP" claim, arXiv (2025).](https://arxiv.org/pdf/2507.09018)
19. [A Minimal Constructive Proof That P ≠ NP via Witness Incompressibility, Zenodo (2025).](https://zenodo.org/records/15529778)
20. [Towards P≠NP from Extended Frege Lower Bounds, ACM (2025).](https://dl.acm.org/doi/pdf/10.1145/3801091)

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

Topic: 物质世界与数学 › 数学与统计学 › 逻辑与离散数学 › General discrete mathematics and discrete structures › Computability theory › Undecidability results and applications

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/p-versus-np-problem

English original: https://www.edgepedia.org/p-versus-np-problem
