用计算机解决问题时,我们总希望算法足够快,因为任何时候资源都是相对不足的,特别是时间资源。
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的更多相关文章

  1. 转载 什么是P问题、NP问题和NPC问题

    原文地址http://www.matrix67.com/blog/archives/105 这或许是众多OIer最大的误区之一.    你会经常看到网上出现“这怎么做,这不是NP问题吗”.“这个只有搜 ...

  2. HDU1760 A New Tetris Game NP态

    A New Tetris Game Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others ...

  3. P与NP问题

    Polynomial Nondeterministic Polynomial P问题: 一个问题可以在多项式时间复杂度内解决 NP问题: 一个问题可以在多项式时间内证实或者证伪 NP-Hard问题: ...

  4. 浅谈P NP NPC

    P问题:多项式时间内可以找到解的问题,这个解可以在多项式时间内验证. NP问题:有多项式时间内可以验证的解的问题,而并不能保证可以在多项式时间内找到这个解. 比如汉密尔顿回路,如果找到,在多项式时间内 ...

  5. (数学)P、NP、NPC、NP hard问题

    概念定义: P问题:能在多项式时间内解决的问题: NP问题:(Nondeterministic Polynomial time Problem)不能在多项式时间内解决或不确定能不能在多项式时间内解决, ...

  6. P,NP,NP_hard,NP_complete问题定义

    背景:在看李航的<统计学习方法时>提到了NP完全问题,于是摆之. 问题解答:以下是让我豁然开朗的解答的摘抄: 最简单的解释:P:算起来很快的问题NP:算起来不一定快,但对于任何答案我们都可 ...

  7. P和NP问题

    1. 通俗详细地讲解什么是P和NP问题 http://blog.sciencenet.cn/blog-327757-531546.html   NP----非定常多项式(英语:non-determin ...

  8. P,NP,NPC,NPC-HARD

    P: 能在多项式时间内解决的问题 NP: 不能在多项式时间内解决或不确定能不能在多项式时间内解决,但能在多项式时间验证的问题 NPC: NP完全问题,所有NP问题在多项式时间内都能约化(Reducib ...

  9. NP完全问题 NP-Completeness

    原创翻译加学习笔记,方便国人学习算法知识! 原文链接http://www.geeksforgeeks.org/np-completeness-set-1/ 我们已经找到很多很高效的算法来解决很难得问题 ...

  10. np问题

    NP(np) Time Limit:1000ms Memory Limit:64MB 题目描述 LYK 喜欢研究一些比较困难的问题,比如 np 问题.这次它又遇到一个棘手的 np 问题.问题是这个样子 ...

随机推荐

  1. 用js实现匹配文本中的电话号、固定电话号

    思路: 1.用正则取出所有数字串 说起来容易,做起来难,开始只是简单的/D+/,后边发现这样做会将固定电话分成两段数字串,后经百度找到解决办法 /[^0-9/-]/ 意思是非数字不包括-作为分割 2. ...

  2. Java基础29-子父类中的成员变量

    /* 成员: 1.成员变量 2.函数 3.构造函数 变量: this 代表当前对象的引用 this.变量 首先在本类中找所需要的变量,如果没有找到再父类中找. super 用于访问当前对象的父类成员, ...

  3. 理解restful 架构 && RESTful API设计指南

    restful是前端和后端接口中都会使用的设计思想. 网站即软件,我们也常说的webapp,这种互联网软件采用的是“客户端/服务器”模式,建立在分布式体系上. 网站开发,也可以完全采用软件开发的模式, ...

  4. MySQL对结果进行排序order by

    order by {col_name | expr | position} [ASC | DESC] 查询结果     排序条件的顺序  决定   排序条件   的优先级 如果同一条件下值相等,那么启 ...

  5. IE11在使用get方式提交没有进行请求的bug问题

    在做iemsc项目的时候,测试提交了一个bug问题,在发布新闻成功后,自动刷新列表的时候,不进行刷新,但是在谷歌上面又不会出现这种问题, 原因: 发现请求的时候用的get请求,因为不同的浏览器的请求机 ...

  6. 4、在Shell程序中的使用变量

    学习目标变量的赋值变量的访问变量的输入 12-4-1 变量的赋值在Shell编程中,所有的变量名都由字符串组成,并且不需要对变量进行声明.要赋值给一个变量,其格式如下:变量名=值.注意:等号(=)前后 ...

  7. Bash编程(6) String操作

    1. 拼接 1) 简单的字符串拼接如:PATH=$PATH:$HOME/bin.如果拼接的字符串包含空格或特殊字符,需要使用双引号括起,如: var=$HOME/bin # 注释并不是赋值的一部分 v ...

  8. Python爬取电影天堂指定电视剧或者电影

    1.分析搜索请求 一位高人曾经说过,想爬取数据,要先分析网站 今天我们爬取电影天堂,有好看的美剧我在上面都能找到,算是很全了. 这个网站的广告出奇的多,用过都知道,点一下搜索就会弹出个窗口,伴随着滑稽 ...

  9. sublime text 3 PHP 所需插件

    1. PHP代码语法验证插件:SublimeLinter 2.Bracket Highlighter 用于匹配括号,引号和html标签.对于很长的代码很有用.安装好之后,不需要设置插件会自动生效 3. ...

  10. angular 之 jquery-autocomplete

    自动完成还是原来的 bassistance.de 好用,详细用法参考官网. angular的js paths配置及依赖关系不多说: 'jquery': 'static/jquery-1.11.3/jq ...