P vs NP
用计算机解决问题时,我们总希望算法足够快,因为任何时候资源都是相对不足的,特别是时间资源。
P vs NP是信息科学的最高峰。
Complexity Class
计算复杂度理论中,一个复杂类(Complexity Class)是与基于资源的复杂性相关的一个问题集,也就是在某种资源的视角下对问题的类别划分。
In computational complexity theory, a complexity class is a set of problems of related resource-based complexity. A typical complexity class has a definition of the form:
the set of problems that can be solved by an abstract machine M using O(f(n)) of resource R, where n is the size of the input.
Computational problem
The most commonly used problems are decision problems. However, complexity classes can be defined based on function problems (an example is FP), counting problems (e.g. #P), optimization problems, promise problems, etc.
Decision Problems
选择问题(判定问题)是答案为yes或no的问题。
A decision problem is a problem that can be posed as a yes-no question of the input values.
Model of computation
DTM:确定性图灵机,每个符号和状态的组合在action table中只对应一个输出。也就是没有随机性。
The most common model of computation is the deterministic Turing machine, but many complexity classes are based on nondeterministic Turing machines(NDTM), boolean circuits, quantum Turing machines, monotone circuits, etc.
Time-complexity classes
Model of computation | Time constraint f(n) | Time constraint poly(n) | Time constraint 2^poly(n) |
---|---|---|---|
DTM | DTIME | p | EXPTIME |
NDTM | NTIME | NP | NEXPTIME |
Space-complexity classes
Model of computation | Space constraint f(n) | Space constraint O(log n) | Space constraint poly(n) | Space constraint 2^poly(n) |
---|---|---|---|---|
DTM | DSPACE | L | PSPACE | EXPSPACE |
NDTM | NSPACE | NL | NPSPACE | NEXPSPACE |
P, NP, co-NP, NPC, NP-hard
这些都是时间复杂度下的complexity class。
P
P包含所有使用DTM,在多项式时间(Polynomial Time)内可解的decision问题。
It contains all decision problems that can be solved by a deterministic Turing machine using a polynomial amount of computation time, or polynomial time.
P包含很多自然问题,包含decision版本的线性规划,求最大公约数,寻找最大配对。
P is known to contain many natural problems, including the decision versions of linear programming, calculating the greatest common divisor, and finding a maximum matching.
NP
NP是使用NDTM在多项式时间可解的decision问题集。
Equivalently, the formal definition of NP is the set of decision problems solvable in polynomial time by a theoretical non-deterministic Turing machine.
NP更直观的理解:该类问题可以先去猜测一个解,这个过程是非确定的(non-deterministic way),但可以用确定性算法去验证或拒绝(reject)这个解。
NP问题没有已知的快速解法(不是没有解法,也不确定就是没有快速解法,快速是指多项式级别),通常采用启发式(Heuristic)算法、近似、随机、参数化方法,或将问题限制在一定的条件下。
很多搜索和优化问题属于NP问题,所以有时候用启发式搜索,机器学习中用SGD训练算法。
co-NP
当且仅当一个decision问题的补(complement)属于NP时,该问题属于co-NP。也就是说,该类问题的否定回答可以在多项式时间内由NDTM验证为正确。
A decision problem is a member of co-NP if and only if its complement is in the complexity class NP. Equivalently, co-NP is the set of decision problems where the "no" instances can be accepted in polynomial time by a non-deterministic Turing machine.
举例:给定一个有限整数集,是否每个非空子集都有非零和。
An example of an NP-complete problem is the subset sum problem: given a finite set of integers, is there a non-empty subset that sums to zero? To give a proof of a "yes" instance, one must specify a non-empty subset that does sum to zero. The complementary problem is in co-NP and asks: "given a finite set of integers, does every non-empty subset have a non-zero sum?".
NPC
P包含在NP中,但是NP中有很多重要的问题,其中最困难的是NP-complete问题,其解决方法可以在多项式时间内应用到其他任何NP问题。
The complexity class P is contained in NP, but NP contains many important problems, the hardest of which are called NP-complete problems, whose solutions are sufficient to deal with any other NP problem in polynomial time.
"是否P=NP"是复杂性理论中最重要的开放性(未被证明)问题,它问的是NPC问题是否存在多项式时间的解法,而按照推论,等价于所有NP是否存在多项式时间的解法。普遍认为这是不可能的。(通用解法,这种东西,不存在的/smilence)
The most important open question in complexity theory, the P versus NP ("P=NP") problem, asks whether polynomial time algorithms actually exist for solving NP-complete, and by corollary, all NP problems. It is widely believed that this is not the case.
The complexity class NP (which have efficiently verifiable proofs where the answer is "yes") is also related to the complexity class co-NP (which have efficiently verifiable proofs where the answer is "no"). Whether or not NP = co-NP is another outstanding question in complexity theory.
NP-hard
NP-hard至少和NP问题一样困难,所有的NP问题都可以规约到(reduce to)它们,但NP-hard问题不一定可以在多项式时间内验证,也就是说不一定是NP的。
NP-hard problems are those at least as hard as NP problems, i.e., all NP problems can be reduced (in polynomial time) to them. NP-hard problems need not be in NP, i.e., they need not have solutions verifiable in polynomial time.
训练深度神经网络和很多机器学习系统都是NP-hard问题。(Sanjeev Arora, Aditya Bhaskara, Rong Ge, and Tengyu Ma. Provable bounds for learning some deep representations. CoRR, abs/1310.6343, 2013.)
Euler图
Reference
Decision problem
Complexity classes
P
NP
P vs NP
Heuristic
A sina blog about NP by xuelinger_2010
P vs NP的更多相关文章
- 转载 什么是P问题、NP问题和NPC问题
原文地址http://www.matrix67.com/blog/archives/105 这或许是众多OIer最大的误区之一. 你会经常看到网上出现“这怎么做,这不是NP问题吗”.“这个只有搜 ...
- HDU1760 A New Tetris Game NP态
A New Tetris Game Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others ...
- P与NP问题
Polynomial Nondeterministic Polynomial P问题: 一个问题可以在多项式时间复杂度内解决 NP问题: 一个问题可以在多项式时间内证实或者证伪 NP-Hard问题: ...
- 浅谈P NP NPC
P问题:多项式时间内可以找到解的问题,这个解可以在多项式时间内验证. NP问题:有多项式时间内可以验证的解的问题,而并不能保证可以在多项式时间内找到这个解. 比如汉密尔顿回路,如果找到,在多项式时间内 ...
- (数学)P、NP、NPC、NP hard问题
概念定义: P问题:能在多项式时间内解决的问题: NP问题:(Nondeterministic Polynomial time Problem)不能在多项式时间内解决或不确定能不能在多项式时间内解决, ...
- P,NP,NP_hard,NP_complete问题定义
背景:在看李航的<统计学习方法时>提到了NP完全问题,于是摆之. 问题解答:以下是让我豁然开朗的解答的摘抄: 最简单的解释:P:算起来很快的问题NP:算起来不一定快,但对于任何答案我们都可 ...
- P和NP问题
1. 通俗详细地讲解什么是P和NP问题 http://blog.sciencenet.cn/blog-327757-531546.html NP----非定常多项式(英语:non-determin ...
- P,NP,NPC,NPC-HARD
P: 能在多项式时间内解决的问题 NP: 不能在多项式时间内解决或不确定能不能在多项式时间内解决,但能在多项式时间验证的问题 NPC: NP完全问题,所有NP问题在多项式时间内都能约化(Reducib ...
- NP完全问题 NP-Completeness
原创翻译加学习笔记,方便国人学习算法知识! 原文链接http://www.geeksforgeeks.org/np-completeness-set-1/ 我们已经找到很多很高效的算法来解决很难得问题 ...
- np问题
NP(np) Time Limit:1000ms Memory Limit:64MB 题目描述 LYK 喜欢研究一些比较困难的问题,比如 np 问题.这次它又遇到一个棘手的 np 问题.问题是这个样子 ...
随机推荐
- Java .Net Byte数组存储差异以及解决方法
最近在Java与.Net服务Bytes数据交互碰到一个问题:.Net IntToBytes结果和Java IntToBytes结果是反序的,查了一下发现:Java stores things inte ...
- 谈 Python 程序和 C 程序的整合 (转载)
http://www.ibm.com/developerworks/cn/linux/l-cn-pythonandc/ 概览 Python 是一种用于快速开发软件的编程语言,它的语法比较简单,易于掌握 ...
- orcale 之 初识数据库一
数据库 数据库顾名思义数据的仓库,只不过这个仓库是在计算机的存储设备之中.一般来说,这些数据面向一个组织,部门或者整个企业,这些数据是按照一定的模型进行存放的数据集合,比如对于一个学生的管理系统来说, ...
- js事件绑定简单写法
$E.on = function (o, e, f) { return o.addEventListener ? o.addEventListener(e, f, false) : o.attachE ...
- [转].Net Core Web应用发布至IIS后报“An error occurred while starting the application”错误
本文转自:http://www.cnblogs.com/TomGui/p/6438686.html An error occurred while starting the application. ...
- .net core 第二篇控制台程序项目初步学习
1. 使用vscode 创建一个控制台程序 创建项目默认创建的项目名称为父级文件夹名称 后面学习下创建的命令各个参数说明 运行项目dotnet run 其他命令SDK 命令:add 将包或引用添加到 ...
- SQL update 多表连接方法
SQL Update多表联合更新的方法 () sqlite 多表更新方法 //---------------------------------- update t1 set col1=t2.col1 ...
- js实现页面跳转的八种方式
整理一下JavaScript八种跳转方式,欢迎评论补充! 第一种方法: <script> window.location.replace('http://www.cnblogs.com/c ...
- redis(4)事务
一.事务 一般来说,事务必须满足4个条件,也就是我们常说的ACID: 1)Atomicity 原子性:一个事务中的所有操作要么全部完成,要么全部不完成,不会结束在中间的某个环节.事务在执行过程中发生错 ...
- Eclipse使用快捷键总结
1.为方法添加注释:Alt + Shift + J