用计算机解决问题时,我们总希望算法足够快,因为任何时候资源都是相对不足的,特别是时间资源。
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. leetcode有意思的题目总结

    231. 2的幂 2^3=8 得  8是2的幂 判断一个整数是不是2的幂,可根据二进制来分析.2的幂如2,4,8,等有一个特点: 二进制数首位为1,其他位为0,如2为10,4为100 2&(2 ...

  2. [JAVA]Apache FTPClient操作“卡死”问题的分析和解决

    最近在和一个第三方的合作中不得已需要使用FTP文件接口.由于FTP Server由对方提供,而且双方背后各自的网络环境都很不单纯等等原因,造成测试环境无法模拟实际情况.测试环境中程序一切正常,但是在部 ...

  3. 《C++ Primer(第五版)》知识巩固

    运行平台:ubuntu 12.04/GCC 4.8.0 第二章:基本内置类型 1.decltype类型指示符 当我们从表达式的类型来推断要定义的类型时,可以使用decltype()来解析:declty ...

  4. 【Lua】关于遍历指定路径下所有目录及文件

    关于Lua中如何遍历指定文件路径下的所有文件,需要用到Lua的lfs库. 首先创建一个temp.lua文件,用编辑器打开: 要使用lfs库,首先需要把lfs库加载进来 require("lf ...

  5. 【javascript】jq之display:none与visible:hidden

    今天学习到jquery的hide()部分时,突然有一个想法,jquery中的隐藏/显示部分的实现是给目标元素附加一个"display: none"属性,那么如果在类似于下面的布局中 ...

  6. UML 依赖\泛化\关联\实现\聚合\组合的 Java实现

    在类图中,类与类之间的关系主要有一下几种: 泛化关系:(就是继承) public class Employee { } public class SaleEmployee extends Employ ...

  7. Java日记

    总结关于Java web一些知识 VisualVM性能分析    ——  更好的理解JVM中的参数 JVM初始    ——    理解JVM 自己的Java开发规范  ——  个人Java开发是遵循的 ...

  8. Ajax嵌套Ajax的模版

    引入 在开发中,难免会碰到需要发送两次ajax请求或者更多的情况 情境:我们需要resultB数据,后台提供的接口要先传入参数paramA,获取到resultA,然后resultA作为参数,调用另外一 ...

  9. PHP常用文件操作

    <?php $path = "/home/work/srccode/hello.go"; $dirName = dirname($path); $name = basenam ...

  10. Swift强制解析

    IDE:Xcode Version7.3.1 Swift中"数据类型?"表示这是可选类型,即 某个常量或者变量可能是一个类型,也可能什么都没有,不确定它是否有值,也许会是nil. ...