https://en.wikipedia.org/wiki/Time_complexity#Polynomial_time

An algorithm is said to be of polynomial time if its running time is upper bounded by a polynomial expression in the size of the input for the algorithm, i.e., T(n) = O(nk) for some constant k.[1][8] Problems for which a deterministic polynomial time algorithm exists belong to the complexity class P, which is central in the field of computational complexity theoryCobham's thesis states that polynomial time is a synonym for "tractable", "feasible", "efficient", or "fast".[9]

Some examples of polynomial time algorithms:

  • The selection sort sorting algorithm on n integers performs {\displaystyle An^{2}} operations for some constant A. Thus it runs in time {\displaystyle O(n^{2})} and is a polynomial time algorithm.
  • All the basic arithmetic operations (addition, subtraction, multiplication, division, and comparison) can be done in polynomial time.
  • Maximum matchings in graphs can be found in polynomial time.

Complexity classes[edit]

The concept of polynomial time leads to several complexity classes in computational complexity theory. Some important classes defined using polynomial time are the following.

  • P: The complexity class of decision problems that can be solved on a deterministic Turing machine in polynomial time.
  • NP: The complexity class of decision problems that can be solved on a non-deterministic Turing machine in polynomial time.
  • ZPP: The complexity class of decision problems that can be solved with zero error on a probabilistic Turing machine in polynomial time.
  • RP: The complexity class of decision problems that can be solved with 1-sided error on a probabilistic Turing machine in polynomial time.
  • BPP: The complexity class of decision problems that can be solved with 2-sided error on a probabilistic Turing machine in polynomial time.
  • BQP: The complexity class of decision problems that can be solved with 2-sided error on a quantum Turing machine in polynomial time.

P is the smallest time-complexity class on a deterministic machine which is robust in terms of machine model changes. (For example, a change from a single-tape Turing machine to a multi-tape machine can lead to a quadratic speedup, but any algorithm that runs in polynomial time under one model also does so on the other.) Any given abstract machinewill have a complexity class corresponding to the problems which can be solved in polynomial time on that machine.

复杂度类[编辑]

多项式时间的概念出发,在计算复杂度理论中可以得到一些复杂度类。以下是一些重要的例子。

  • P:包含可以使用确定型图灵机在多项式时间内解决的决定性问题
  • NP:包含可以使用非确定型图灵机在多项式时间内解决的决定性问题。
  • ZPP:包含可以使用概率图灵机在多项式时间内零错误解决的决定性问题。
  • RP:包含可以使用概率图灵机在多项式时间内解决的决定性问题,但它给出的两种答案中(是或否)只有一种答案是一定正确的,另一种则有几率不正确。
  • BPP:包含可以使用概率图灵机在多项式时间内解决的决定性问题,它给出的答案有错误的概率在某个小于0.5的常数之内。
  • BQP:包含可以使用量子图灵机在多项式时间内解决的决定性问题,它给出的答案有错误的概率在某个小于0.5的常数之内。

在机器模型可变的情况下,P在确定性机器上是最小的时间复杂度类。例如,将单带图灵机换成多带图灵机可以使算法运行速度以二次阶提升,但所有具有多项式时间的算法依然会以多项式时间运行。一种特定的抽象机器会有自己特定的复杂度类分类。

图灵机(英语:Turing machine),又称确定型图灵机,是英国数学家艾伦·图灵于1936年提出的一种抽象计算模型,其更抽象的意义为一种数学逻辑机,可以看作等价于任何有限逻辑数学过程的终极强大逻辑机器。

非确定型图灵机确定型图灵机的不同之处在于,在计算的每一时刻,根据当前状态和读写头所读的符号,机器存在多种状态转移方案,机器将任意地选择其中一种方案继续运作,直到最后停机为止。具体而言,其状态转移函数为

计算复杂性理论内,概率图灵机是一个非决定型图灵机,在每个转折点根据某种概率分布随机选择某种可行的转变(transition)。

要理解这几个概念,首先要明白几件事:

  1. 对于NP问题是否存在确定的多项式时间的解,目前还不清楚(即有可能有一天可以证明NP问题=P问题,但目前还证明不出来、也不能证明NP问题≠P问题,目前的结论只是NP问题集P问题集
  2. 问题之间可以规约,即如果某个NP问题存在确定的多项式时间解,那么另一个NP问题也存在确定的多项式时间解。这个过程是可以证明的、并且已经被证明。
  • NP困难问题(NP-hard problems)
是指这样的一类问题,它们本身的复杂度是多少无所谓(但由后面的论述可知至少是NP),但是只要这个问题找到确定的多项式时间的解,那么我们可以证明出所有的NP问题都一定存在确定的多项式时间的解。(简单叙述一下就是,只要有一个NP困难问题找到P解,那么所有NP问题都是P问题)
  • NP完全问题(NP-complete problems)
如果一个问题既是NP困难问题又是NP问题,我们称之为NP完全问题。

polynomial time的更多相关文章

  1. Polynomial Library in OpenCascade

    Polynomial Library in OpenCascade eryar@163.com 摘要Abstract:分析幂基曲线即多项式曲线在OpenCascade中的计算方法,以及利用OpenSc ...

  2. 周赛-Integration of Polynomial 分类: 比赛 2015-08-02 08:40 10人阅读 评论(0) 收藏

    Integration of Polynomial Time Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/O ...

  3. FZU 2215 Simple Polynomial Problem(简单多项式问题)

    Description 题目描述 You are given an polynomial of x consisting of only addition marks, multiplication ...

  4. Project Euler 101 :Optimum polynomial 最优多项式

    Optimum polynomial If we are presented with the first k terms of a sequence it is impossible to say ...

  5. 【数论】UVa 10586 - Polynomial Remains

    Problem F: Polynomial Remains Given the polynomial a(x) = an xn + ... + a1 x + a0, compute the remai ...

  6. 【CF493E】【数学】Vasya and Polynomial

    Vasya is studying in the last class of school and soon he will take exams. He decided to study polyn ...

  7. 一起啃PRML - 1.1 Example: Polynomial Curve Fitting 多项式曲线拟合

    一起啃PRML - 1.1 Example: Polynomial Curve Fitting @copyright 转载请注明出处 http://www.cnblogs.com/chxer/ 前言: ...

  8. 一元多项式Polynomial的C语言实现

    /* 编译器:Dev-c++ 5.4.0 文件名:Polynomial.cpp 代码版本号:1.0 时间:2015年10月9日21:53:26 */ /* 总结: 1.结构体指针指向的区域要手动分配内 ...

  9. uva 498 - Polly the Polynomial

    UVa 498: Polly the Polynomial | MathBlog #include <cstdio> #include <cstdlib> using name ...

  10. uva 10951 - Polynomial GCD(欧几里得)

    题目链接:uva 10951 - Polynomial GCD 题目大意:给出n和两个多项式,求两个多项式在全部操作均模n的情况下最大公约数是多少. 解题思路:欧几里得算法,就是为多项式这个数据类型重 ...

随机推荐

  1. postman(一)批量执行接口测试用例

    postman(一)批量执行接口测试用例 学习了:https://blog.csdn.net/github_36032947/article/details/78611405 还可以把collecti ...

  2. SpringMVC 下载XLS文档的设置

    页面设置参考上文.SpringMVC 下载文本文档的设置 此文是关于xls文档下载的,这个文档使用Apache的POI生成,需要的jar包可以从下面地址下载: http://pan.baidu.com ...

  3. 仿苹果电脑任务栏菜单&&拼图小游戏&&模拟表单控件

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  4. C++ 模板详解(二)(转)

    四.类模板的默认模板类型形参 1.可以为类模板的类型形参提供默认值,但不能为函数模板的类型形参提供默认值.函数模板和类模板都可以为模板的非类型形参提供默认值. 2.类模板的类型形参默认值形式为:tem ...

  5. 仿IOS中下拉刷新的“雨滴”效果

    在IOS中,有非常赞的"水滴"下拉效果.非常久之前也想在Android上实现,可是苦于能力有限,一直未能付诸行动.这几天趁着空隙时间.写了一版初步实现,基本达到了"水滴& ...

  6. Resharper快捷键及用法

    建议你使用 Reshaper 的快捷键,不要担心 Reshaper 会把你原来的快捷键设置给覆盖了,因为如果某个快捷键和 VS 是冲突的,Reshaper会让你自己选择需要使用 VS 还是 Resha ...

  7. 基于CentOS7的服务器搭建(LAMP环境)

    基于CentOS7的服务器环境搭建(LAMP环境) 一.安装MySQL组件 1.由于在CentOS7中,默认yum安装库中不含有mysql,我们可以下载mysql的分支MariaDB,如果必须要下my ...

  8. oracle海量数据中提升创建索引的速度

    基本信息情况: 数据库版本:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production 操作系统版本:Ce ...

  9. static 修饰的变量在程序中容易出现的问题

    package lianxi; public class StaticTest {    int a = 0;    static int b =0;    StaticTest(){         ...

  10. Android Studio 使用笔记:文件查询方法总结

    搜索单词 Windows: Ctrl + F Mac   : Cmd + F 会在当前激活的文件上查询输入的关键字,以高亮显示 跳转行 Windows: Ctrl + L Mac   : Cmd + ...