# P（复杂性）

**P** 是确定性图灵机在输入长度的多项式时间内可判定的判定问题类，形式上是所有指数 k 上 DTIME[n^k] 的并集。P 是否等于 NP 这一问题常被称为理论计算机科学中最重要的未解问题。<sup>[1](https://plato.stanford.edu/entries/computational-complexity/)</sup>

| 关键事实 | 详情 |
|---|---|
| 定义 | P = ∪（k = 1 到 ∞）DTIME[n^k]：即对某个固定 k，可由确定性多带图灵机在 O(n^k) 步内接受的语言类<sup>[2](https://encyclopediaofmath.org/wiki/Computational_complexity_classes)</sup> |
| 稳健性 | 图灵机模拟多带机器或无界随机存取存储器时至多使运行时间平方或立方，因此 P 不依赖于机器模型<sup>[3](https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf)</sup> |
| 标志性成员 | 线性规划（哈奇扬，1979）、一般图上的最大匹配（埃德蒙兹，1965）以及素性检测（AKS）<sup>[4](https://complexityzoo.net/Complexity_Zoo:P)</sup> |
| 已证包含关系 | L ⊆ NL ⊆ P ⊆ NP ⊆ PSPACE ⊆ EXP，且 P 严格包含于 EXP<sup>[1](https://plato.stanford.edu/entries/computational-complexity/)</sup> |
| 未解状态 | P 是否真包含于 NP 尚未解决<sup>[1](https://plato.stanford.edu/entries/computational-complexity/)</sup> |
| 证明障碍 | 相对化（1975）、自然证明（拉兹博罗夫–鲁迪奇）与代数化（阿伦森–维格德森）各自排除了广泛的技术族<sup>[5](https://www.scottaaronson.com/papers/algstoc.pdf)</sup> |
| 近期算法记录 | 矩阵乘法指数 ω ≤ 2.371552；精确最大流在 n^(2+o(1)) log U 时间内（2024）<sup>[6](https://ar5iv.labs.arxiv.org/html/2307.07970)</sup><sup> • </sup><sup>[7](https://arxiv.org/html/2406.03648)</sup> |

## 定义与形式基础

P 是图灵机 M 在多项式时间内运行所接受的语言 L(M) 的类：存在一个固定常数 k，使得对每个长度为 n 的输入，机器在 n^k 步内停机。<sup>[3](https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf)</sup> 等价地，P = ∪（k = 1 到 ∞）DTIME[n^k]，即所有多项式时间界内可判定类的并集。<sup>[2](https://encyclopediaofmath.org/wiki/Computational_complexity_classes)</sup> 该类包含许多常见计算任务的判定版本：在网络中寻找最短路径、解析上下文无关语言、排序、矩阵乘法以及线性规划。<sup>[8](https://people.cs.rutgers.edu/~allender/papers/ALR12.pdf)</sup>

**跨模型的稳健性。** 如果定义依赖于所使用的具体机器，那它就会很脆弱。事实并非如此：单带图灵机可以通过至多平方或立方计算时间来模拟更高效的模型，例如多带机器或无界随机存取存储器，而多项式界在此类模拟之后仍然是多项式界。<sup>[3](https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf)</sup> 因此，当用随机存取机器或其他顺序计算模型来定义时，P 仍然是同一个类。<sup>[8](https://people.cs.rutgers.edu/~allender/papers/ALR12.pdf)</sup> 这种模型无关性是复杂性理论家将多项式时间确定为效率的形式化概念的原因之一。<sup>[9](https://www.cs.toronto.edu/~bor/373s20/docs/williams-survey-fine-grained.pdf)</sup>

**通过检验定义 NP。** NP 可以在不使用非确定性的情况下定义：一个语言属于 NP，如果其肯定实例具有多项式长度的证书，且该证书可由多项式时间关系 R 检验，使得 w 属于该语言当且仅当存在某个证书 y 使 R(w,y) 成立。配对语言 { w#y | R(w,y) } 属于 P。NP 最初是用非确定性机器定义的，而这两种定义是重合的。<sup>[3](https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf)</sup> 粗略地说，P 由可以高效求解的问题组成，而 NP 包含那些答案可以毫不费力地验证的问题——数独就是一个熟悉的例子；因为任何容易求解的问题也容易验证，所以每个属于 P 的问题也属于 NP。<sup>[10](https://www.quantamagazine.org/complexity-theorys-50-year-journey-to-the-limits-of-knowledge-20230817/)</sup>

## 为什么多项式时间意味着“高效”

复杂性理论将多项式时间视为可行计算的形式边界，原因有三。第一，该类足够抽象，能够跨机器模型保持稳健，这一立场被概括为扩展丘奇–图灵论题。第二，多项式在复合下封闭，因此该类能够捕捉子过程：一个调用多项式多个多项式时间子程序的多项式时间算法仍然属于 P。第三，与指数函数相比，多项式函数表现出温和的增长，而最坏情况多项式界给出了通用的性能保证。<sup>[11](https://www.cl.cam.ac.uk/teaching/2526/Complexity/lecture2.pdf)</sup><sup> • </sup><sup>[12](https://cacm.acm.org/opinion/the-moral-hazard-of-complexity-theoretic-assumptions/)</sup>

**抽象的局限。** 该定义在其使用者所承认的意义上是不完美的：一个运行时间为 Θ(n^100) 的算法在形式上是多项式的，但在实践中并不可行。<sup>[11](https://www.cl.cam.ac.uk/teaching/2526/Complexity/lecture2.pdf)</sup> 最坏情况分析对每个输入都给出通用的性能保证。<sup>[12](https://cacm.acm.org/opinion/the-moral-hazard-of-complexity-theoretic-assumptions/)</sup>

## P 中的标志性问题

P 包含一些其成员资格曾经极不确定的问题，而解决这些问题的算法是计算机科学中最著名的成果之一。

**线性规划。** 丹齐格于 1947 年提出的单纯形法在大多数情况下能快速求解线性规划，但它不是多项式时间算法。1979 年，哈奇扬使用椭球法证明了线性规划属于 P；1984 年，卡马卡提出了一种在理论和实践中都很快的内点法。<sup>[13](https://www.cs.umd.edu/~gasarch/COURSES/452/F14/mysurvey.pdf)</sup>

**匹配。** 根据埃德蒙兹 1965 年的工作，在一般图中寻找最大匹配属于 P，这一结果被引用为该类中高度非平凡的自然问题的典范例子。<sup>[4](https://complexityzoo.net/Complexity_Zoo:P)</sup>

**素性。** 检验一个整数是否为素数，是高斯确实曾向数学界提出挑战、要求高效解决的问题，而它花了两百年才得以解决。<sup>[14](https://www.math.ias.edu/~avi/PUBLICATIONS/MYPAPERS/W06/w06.pdf)</sup> 阿格拉沃尔、卡亚尔和萨克塞纳提出的 AKS 素性测试给出了一个无条件的多项式时间判定算法，改进了此前需要假设广义黎曼猜想的证明。<sup>[4](https://complexityzoo.net/Complexity_Zoo:P)</sup> 各来源对该结果的纪年不同：《斯坦福哲学百科全书》说是 2004 年，<sup>[1](https://plato.stanford.edu/entries/computational-complexity/)</sup> 而复杂性动物园引用为 [AKS02]。

**小指数成员。** P 中具有小指数的自然问题包括排序、矩阵求逆、模式匹配、网络流、图连通性、最短路径、最小生成树、强连通分量、平面性测试以及凸包。<sup>[2](https://encyclopediaofmath.org/wiki/Computational_complexity_classes)</sup> 这一研究方向持续压低指数：一种新算法在具有 m 条边以及多项式有界整数需求、成本和容量的有向图上，以 m^(1+o(1)) 时间精确求解最大流和最小费用流问题——这是最小费用流首次在几乎线性时间内求解——并且通过标准归约，首次给出了二部图匹配、工人分配以及带负长度单源最短路径的 m^(1+o(1)) 算法。<sup>[15](https://cacm.acm.org/research-highlights/almost-linear-time-algorithms-for-maximum-flow-and-minimum-cost-flow/)</sup>

## 复杂性图景中的 P

已证的包含链是 L ⊆ NL ⊆ P ⊆ NP ⊆ PSPACE ⊆ EXP ⊆ NEXP ⊆ EXPSPACE，并且可以形式化地证明 P 与 EXP 不同，因此 P 与 EXP 之间的包含关系中至少有一个是严格的。<sup>[1](https://plato.stanford.edu/entries/computational-complexity/)</sup> 由空间层次定理，NC 以及因此 NL 和 L 都严格包含于 PSPACE。<sup>[2](https://encyclopediaofmath.org/wiki/Computational_complexity_classes)</sup> 除此之外，该链内部包含关系的严格性，包括 P 是否真包含于 NP，均未解决；在这些类被引入三十年后，L ⊆ NL ⊆ NC ⊆ P ⊆ NP ⊆ PH ⊆ PSPACE 之间的其他不等式（包括 L ≠ PH）均未知。<sup>[2](https://encyclopediaofmath.org/wiki/Computational_complexity_classes)</sup>

**子类与推广。** P 的重要子类包括 L、NL、NC 和 SC。<sup>[4](https://complexityzoo.net/Complexity_Zoo:P)</sup> 随机化和量子计算推广了该类：推广 P 的努力产生了 BPP（有界错误概率多项式时间）和 BQP（有界错误量子多项式时间），且有 BPP ⊆ BQP ⊆ PP。人们普遍不认为量子计算机能够快速求解 NP 完全问题。<sup>[8](https://people.cs.rutgers.edu/~allender/papers/ALR12.pdf)</sup>

**拉德纳定理。** 如果 P ≠ NP，这一间隙并非没有自然结构：拉德纳定理（1975）指出，P ≠ NP 当且仅当存在一个属于 NP − P 且不是 NP 完全的语言，即 NP 中间语言。<sup>[8](https://people.cs.rutgers.edu/~allender/papers/ALR12.pdf)</sup> 对角线化证明所产生的中间语言是人为的，但具有现实重要性的问题——尤其是在密码学、代数和数论中——被认为属于 NP 中间，而 P ≠ NP 的证明可能无法确定它们的精确地位；P = NP 的证明则会完全消除 NP 中间问题。<sup>[16](https://scottaaronson.com/papers/pnp.pdf)</sup>

## P 与 NP：利害、现状与障碍

在其官方陈述中，克莱数学研究所将这一问题表述为：是否每一种能由非确定性算法在多项式时间内接受的语言，也都能由确定性算法在多项式时间内接受。<sup>[3](https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf)</sup> P ≠ NP 这一猜想足够精确，以至于能够进行数学证明，然而尽管尚未找到证明，大多数计算机科学家仍相信它。<sup>[17](https://www.cambridge.org/core/journals/canadian-journal-of-philosophy/article/abs/computational-tractability-and-conceptual-coherence-why-do-computer-scientists-believe-that-pnp/AFA51D3D2033B141447B9DE64509CFBA)</sup>

**NP 完全性。** 1972 年，理查德·卡普在斯蒂芬·库克的工作基础上（列昂尼德·莱文也独立得出了类似结果），证明了许多自然判定问题是等价的：它们都能在多项式时间内求解当且仅当 P = NP。这类问题被称为 NP 完全。<sup>[18](https://www.pnas.org/doi/10.1073/pnas.1416954111)</sup> 证明该猜想已困扰计算机科学家和数学家近半个世纪，至今仍是数学中最深刻的未解问题之一。<sup>[18](https://www.pnas.org/doi/10.1073/pnas.1416954111)</sup>

**三大障碍。** 该问题的顽固性不仅仅是失败尝试的累积；具体的定理排除了整类技术。

- **相对化**。1975 年，贝克、吉尔和索洛韦证明了借用自逻辑和可计算性理论的技术（如对角线化）无法解决 P 与 NP 问题：存在预言机 A 和 B 使得 P^A = NP^A 且 P^B ≠ NP^B，因此任何证明都必须使用非相对化技术。<sup>[5](https://www.scottaaronson.com/papers/algstoc.pdf)</sup><sup> • </sup><sup>[8](https://people.cs.rutgers.edu/~allender/papers/ALR12.pdf)</sup>
- **自然证明**。拉兹博罗夫和鲁迪奇证明了，已知的电路下界技术如果能够用于证明 P ≠ NP 这样的分离，就可以被反过来用于获得更快区分随机函数与伪随机函数的方法，而这本身将是一项重大算法突破。<sup>[5](https://www.scottaaronson.com/papers/algstoc.pdf)</sup>
- **代数化**。代数化障碍表明，任何对 P 与 NP 问题的解决都需要使用非代数化技术；即使对于更狭窄的目标，如去随机化 RP 或将 NEXP 与 P/poly 分离，也需要非代数化技术。<sup>[5](https://www.scottaaronson.com/papers/algstoc.pdf)</sup>

## 数字记录

多项式时间算法学的定量记录显示，指数在持续压力下不断下降。

**矩阵乘法。** 已知最佳的指数 ω 界已从之前的 ω ≤ 2.371866 改进为 ω ≤ 2.371552，矩形乘法的对偶指数 α 改进为 α ≥ 0.321334。<sup>[6](https://ar5iv.labs.arxiv.org/html/2307.07970)</sup> 在此改进之前，记录为 ω < 2.37287（勒加尔，2014），而自 1986 年以来所有关于 ω 的界都是使用所谓的激光法获得的。<sup>[19](https://theoretics.episciences.org/14213)</sup> 已知的局限性结果表明，激光法及其变体无法证明 ω < 2.3078，因此要达到 ω = 2 将需要新技术。<sup>[6](https://ar5iv.labs.arxiv.org/html/2307.07970)</sup> 在矩形方面，2025 年的一项障碍结果证明，通过大库珀史密斯–维诺格拉德张量获得的 α 的任何下界都不能超过 0.6218。<sup>[20](https://link.springer.com/article/10.1007/s00037-025-00264-9)</sup> 此前，2012 年的一项结果将 α 从库珀史密斯（1997）先前记录的 0.29462 提高到 0.30298 以上，从而给出了在具有小整数权重的有向图上计算全对最短路径的 O(n^2.5302) 算法。<sup>[21](https://ar5iv.labs.arxiv.org/html/1204.1111)</sup>

**推论。** 新的界可推广到其他问题：兹维克的算法在有向无权图上以 O(n^2.527661) 时间计算全对最短路径，而检测一个 4-团需要 O(n^3.250385) 时间。<sup>[6](https://ar5iv.labs.arxiv.org/html/2307.07970)</sup>

这些数字具体地框定了指数问题。与此同时，多项式函数表现出温和增长这一抽象是一种建模选择，而 Θ(n^100) 的思想实验标明了它不再追踪实践的界限。<sup>[12](https://cacm.acm.org/opinion/the-moral-hazard-of-complexity-theoretic-assumptions/)</sup>

## 近期进展

算法进步在多个前沿持续推进。矩阵乘法的界 ω ≤ 2.371552 和 α ≥ 0.321334 晚于 2023 年，<sup>[6](https://ar5iv.labs.arxiv.org/html/2307.07970)</sup> 而 2025 年通过大库珀史密斯–维诺格拉德张量获得的矩形乘法障碍为这些技术所能证明的内容设定了 0.6218 的上限。<sup>[20](https://link.springer.com/article/10.1007/s00037-025-00264-9)</sup> 在最大流方面，2024 年的一种组合算法在具有 n 个顶点、容量来自 {1,…,U} 的有向图上以 n^(2+o(1)) log U 时间计算精确最大流，这在稠密图中几乎是最优的。<sup>[7](https://arxiv.org/html/2406.03648)</sup> 在单位容量图中，当图具有 m = ω(n^(4/3)) 条边时，这打破了卡尔扎诺夫（1973）以及埃文和塔扬（1975）长期保持的 O(m · min{√m, n^(2/3)}) 界，且运行时间与丘日伊和坎纳（STOC 2024）关于最大二部图匹配的 n^(2+o(1)) 界相匹配。<sup>[7](https://arxiv.org/html/2406.03648)</sup>

**声称的解决方案。** P 与 NP 问题本身仍未解决。2026 年的一篇 arXiv 预印本声称 P = NP，其方式是证明谱系多面体的成员问题可在强多项式时间内求解，所声称的证明链已在 Lean 4 中机器验证（36 个文件，2968 个构建目标）；该声称尚未被复杂性理论界接受或独立验证。<sup>[22](https://arxiv.org/abs/2606.03194)</sup> 截至 2026 年 6 月，复杂性理论家认为相对化表明模拟和对角线化无法解决 P 与 NP 问题，并且进一步的多项式时间研究方法——其中包括电路复杂性、证明复杂性和代数几何——都已陷入停滞，远远未能捕捉到多项式时间计算的全部力量。<sup>[23](https://blog.computationalcomplexity.org/2026/06/respect-p-v-np-problem.html)</sup>

## 实际意义与精细化

**P 完全性与并行性。** 一个判定问题是 P 完全的，如果它属于 P 且 P 中的每个问题都可在对数空间内归约到它；典型的 P 完全问题是电路求值。<sup>[4](https://complexityzoo.net/Complexity_Zoo:P)</sup> P 完全问题引人注目，因为它们似乎都不适合高度并行计算：尽管付出了大量努力，研究者仍未能构造出 NC 算法——即在输入大小的多对数时间内运行、仅使用多项式数量处理器的有效并行方法。P 完全性理论的核心问题是 P 是否等于 NC。<sup>[24](https://homes.cs.washington.edu/~ruzzo/papers/limits.pdf)</sup> NC（尼克类）由多项式多个并行处理器能在多对数时间内解决的问题组成；NC 包含于 P，但反向包含仍是一个重大未解问题，而在 NC 中找到哪怕一个 P 完全问题都将意味着 P = NC，从而为每个多项式时间问题提供高效并行算法。<sup>[25](https://yancouto.github.io/p-completeness-compendium/about/)</sup> 反之，如果一个 P 完全问题能在 CREW PRAM 上以多项式多个处理器在多对数时间内求解，那么 P 中的所有问题都可以完全并行化，而这被认为不太可能。<sup>[26](https://cs.brown.edu/people/jsavage/book/pdfs/ModelsOfComputation_Chapter8.pdf)</sup> 这一区分也体现在实际问题中：线性规划和最大流是 P 完全的，而最大匹配具有可行的高度并行概率算法，且诸如双变量线性规划和 0-1 最大流等限制情形确实具有高度并行的解。<sup>[24](https://homes.cs.washington.edu/~ruzzo/papers/limits.pdf)</sup>

**比 P/非 P 二分更精细的工具。** 即使 P = NP，仍可能发生这样的情况：每个 NP 问题都只能用对“大多数”输入有效的多项式时间算法求解，这种可能性会使密码学不可能实现，并推动了莱文的平均情况完全性理论。<sup>[3](https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf)</sup> 精细复杂性在 P 内部锐化了图景：CNF-SAT 可以在 O(2^n · c^(n/k)) 时间内求解，其中各种常数 c 独立于 n 和 k，随着 k 增大，这相对于朴素的 2^n 运行时间呈指数级改进。<sup>[9](https://www.cs.toronto.edu/~bor/373s20/docs/williams-survey-fine-grained.pdf)</sup> 此类精细下界背后的假设很强：SETH，即强指数时间假设，是一个比 P ≠ NP 强得多的假设。<sup>[12](https://cacm.acm.org/opinion/the-moral-hazard-of-complexity-theoretic-assumptions/)</sup>

## References

1. [Computational Complexity Theory, Stanford Encyclopedia of Philosophy.](https://plato.stanford.edu/entries/computational-complexity/)
2. [Computational complexity classes, Encyclopedia of Mathematics.](https://encyclopediaofmath.org/wiki/Computational_complexity_classes)
3. [Stephen Cook. The P versus NP Problem, Clay Mathematics Institute official problem statement.](https://www.claymath.org/wp-content/uploads/2022/06/pvsnp.pdf)
4. [Complexity Zoo: P.](https://complexityzoo.net/Complexity_Zoo:P)
5. [Scott Aaronson and Avi Wigderson. Algebrization: A New Barrier in Complexity Theory, STOC.](https://www.scottaaronson.com/papers/algstoc.pdf)
6. [New Bounds for Matrix Multiplication: from Alpha to Omega.](https://ar5iv.labs.arxiv.org/html/2307.07970)
7. [Maximum Flow by Augmenting Paths in n^(2+o(1)) Time.](https://arxiv.org/html/2406.03648)
8. [Eric Allender, Michael Loui, Kenneth Regan. Complexity Theory, handbook chapter.](https://people.cs.rutgers.edu/~allender/papers/ALR12.pdf)
9. [Virginia Vassilevska Williams. On some fine-grained questions in algorithms and complexity.](https://www.cs.toronto.edu/~bor/373s20/docs/williams-survey-fine-grained.pdf)
10. [Complexity Theory's 50-Year Journey to the Limits of Knowledge, Quanta Magazine.](https://www.quantamagazine.org/complexity-theorys-50-year-journey-to-the-limits-of-knowledge-20230817/)
11. [Complexity Theory Lecture 2: The Class P, University of Cambridge.](https://www.cl.cam.ac.uk/teaching/2526/Complexity/lecture2.pdf)
12. [Richard Lipton. The Moral Hazard of Complexity-Theoretic Assumptions, CACM.](https://cacm.acm.org/opinion/the-moral-hazard-of-complexity-theoretic-assumptions/)
13. [William Gasarch. Computational Complexity survey, University of Maryland.](https://www.cs.umd.edu/~gasarch/COURSES/452/F14/mysurvey.pdf)
14. [Avi Wigderson. Mathematics and Computation: a computational complexity perspective.](https://www.math.ias.edu/~avi/PUBLICATIONS/MYPAPERS/W06/w06.pdf)
15. [Almost-Linear-Time Algorithms for Maximum Flow and Minimum-Cost Flow, CACM Research Highlights.](https://cacm.acm.org/research-highlights/almost-linear-time-algorithms-for-maximum-flow-and-minimum-cost-flow/)
16. [Scott Aaronson. P=?NP survey.](https://scottaaronson.com/papers/pnp.pdf)
17. [Computational Tractability and Conceptual Coherence: Why Do Computer Scientists Believe that P≠NP?, Canadian Journal of Philosophy.](https://www.cambridge.org/core/journals/canadian-journal-of-philosophy/article/abs/computational-tractability-and-conceptual-coherence-why-do-computer-scientists-believe-that-pnp/AFA51D3D2033B141447B9DE64509CFBA)
18. [PNAS survey on P versus NP.](https://www.pnas.org/doi/10.1073/pnas.1416954111)
19. [A Refined Laser Method and Faster Matrix Multiplication, TheoretiCS.](https://theoretics.episciences.org/14213)
20. [Barriers for rectangular matrix multiplication, Computational Complexity (Springer, 2025).](https://link.springer.com/article/10.1007/s00037-025-00264-9)
21. [Faster Algorithms for Rectangular Matrix Multiplication.](https://ar5iv.labs.arxiv.org/html/1204.1111)
22. [Lean 4 Machine-Verified Proof of P = NP via the Pedigree Polytope Membership Problem (claimed, unrefereed preprint).](https://arxiv.org/abs/2606.03194)
23. [Respect the P v NP Problem, Computational Complexity blog (Fortnow/Gasarch), June 2026.](https://blog.computationalcomplexity.org/2026/06/respect-p-v-np-problem.html)
24. [Raymond Greenlaw, H. James Hoover, Walter Ruzzo. Limits to Parallel Computation: P-Completeness Theory.](https://homes.cs.washington.edu/~ruzzo/papers/limits.pdf)
25. [P-completeness Compendium: About.](https://yancouto.github.io/p-completeness-compendium/about/)
26. [Models of Computation, Chapter 8, John Savage.](https://cs.brown.edu/people/jsavage/book/pdfs/ModelsOfComputation_Chapter8.pdf)

---
*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 › Models of computation and computability formalisms

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/p-complexity

English original: https://www.edgepedia.org/p-complexity
