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 问题.问题是这个样子 ...
随机推荐
- 20164324王启元 Exp4恶意代码分析
一.实验要求 1.系统运行监控 使用如计划任务,每隔一分钟记录自己的电脑有哪些程序在联网,连接的外部IP是哪里.运行一段时间并分析该文件,综述一下分析结果. 安装配置sysinternals里的sys ...
- String数据转Matrix矩阵
String数据转Matrix矩阵 private Matrix String_To_Matrix(string str) { int[] Remove_Num = new int[10]; int ...
- html5实现判断拍照旋转角度等功能
https://www.aliyun.com/jiaocheng/857189.html base64图片编码上传,判断图片是否有旋转,若有旋转修正图片并保存至阿里 http://code.c ...
- springboot+redis实现缓存数据
在当前互联网环境下,缓存随处可见,利用缓存可以很好的提升系统性能,特别是对于查询操作,可以有效的减少数据库压力,Redis 是一个开源(BSD许可)的,内存中的数据结构存储系统,它可以用作数据库.缓存 ...
- sencha touch textarea 手机上不显示滚动条,且不能滚动
最近在项目中发现 sencha touch 中的 textarea 在手机上不显示滚动条,也不能滚动. 在浏览器中之所以能显示滚动条滚动,那是浏览器为 textarea 添加的滚动条. 但在手机中是不 ...
- 【c++】类中带默认参数的函数
反思两个问题 1. 带默认参数的函数,为何声明.定义不能同时有参数? 2. 带默认参数的函数, 为何带默认参数的参数靠后站? 上程序 #include <iostream> #includ ...
- sublime text 3 3143注册码
1.点击help->enter license: —– BEGIN LICENSE —– TwitterInc 200 User License EA7E-890007 1D77F72E 390 ...
- angular 与 layer 集成过程
layer 的提示框和弹层确实也好用,在使用angular的前提下,使用layer遇到诸多麻烦,记录下来. 在类型是1页面层,主要问题在遮罩方面,造成无法编辑. 开始:引入layer 样式,angul ...
- [转]oracle update set select from 关联更新
本文转自:http://blog.csdn.net/disiwei1012/article/details/52589181 http://www.blogjava.net/Jhonney/archi ...
- 告别Flash——那些年我们追过的FusionCharts
随着FusionCharts最终放弃Flash这块蛋糕,不.或者已经不能叫做蛋糕了,现在Flash图表控件就只剩下AnyChart这一个独苗了,到底Flash还能走多远?这是Flash的末路吗? 众说 ...