更改

跳到导航 跳到搜索
删除89,065字节 、 2020年10月25日 (日) 17:44
第1行: 第1行: −
此词条暂由彩云小译翻译,未经人工整理和审校,带来阅读不便,请见谅。{{short description|Study of inherent difficulty of computational problems}}
+
此词条暂由彩云小译翻译,翻译字数共739,未经人工整理和审校,带来阅读不便,请见谅。
 
      +
{{short description|Study of inherent difficulty of computational problems}}
    
{{Use mdy dates|date=September 2017}}
 
{{Use mdy dates|date=September 2017}}
    +
[[Computational complexity]] theory focuses on classifying [[computational problem]]s according to their resource usage, and relating these classes to each other. A computational problem is a task solved by a computer. A computation problem is solvable by mechanical application of mathematical steps, such as an [[algorithm]].
    +
Computational complexity theory focuses on classifying computational problems according to their resource usage, and relating these classes to each other. A computational problem is a task solved by a computer. A computation problem is solvable by mechanical application of mathematical steps, such as an algorithm.
   −
'''Computational complexity theory''' focuses on classifying computational problems according to their inherent difficulty, and relating these classes to each other. A computational problem is a task solved by a computer. A computation problem is solvable by mechanical application of mathematical steps, such as an [[algorithm]].
+
计算复杂性理论的重点是根据计算问题的资源使用情况对其进行分类,并将这些类彼此关联。计算问题是一个由计算机解决的任务。计算问题是可以通过机械应用的数学步骤,如算法来解决的。
 
  −
Computational complexity theory focuses on classifying computational problems according to their inherent difficulty, and relating these classes to each other. A computational problem is a task solved by a computer. A computation problem is solvable by mechanical application of mathematical steps, such as an algorithm.
  −
 
  −
计算复杂性理论集中于根据计算问题的固有难度对其进行分类,并将这些类相互关联。计算问题是一个由计算机解决的任务。一个计算问题是可以通过机械应用的数学步骤,如算法来解决的。
  −
 
  −
 
        第21行: 第17行:  
A problem is regarded as inherently difficult if its solution requires significant resources, whatever the algorithm used. The theory formalizes this intuition, by introducing mathematical models of computation to study these problems and quantifying their computational complexity, i.e., the amount of resources needed to solve them, such as time and storage. Other measures of complexity are also used, such as the amount of communication (used in communication complexity), the number of gates in a circuit (used in circuit complexity) and the number of processors (used in parallel computing). One of the roles of computational complexity theory is to determine the practical limits on what computers can and cannot do. The P versus NP problem, one of the seven Millennium Prize Problems, is dedicated to the field of computational complexity.
 
A problem is regarded as inherently difficult if its solution requires significant resources, whatever the algorithm used. The theory formalizes this intuition, by introducing mathematical models of computation to study these problems and quantifying their computational complexity, i.e., the amount of resources needed to solve them, such as time and storage. Other measures of complexity are also used, such as the amount of communication (used in communication complexity), the number of gates in a circuit (used in circuit complexity) and the number of processors (used in parallel computing). One of the roles of computational complexity theory is to determine the practical limits on what computers can and cannot do. The P versus NP problem, one of the seven Millennium Prize Problems, is dedicated to the field of computational complexity.
   −
如果一个问题的解决需要大量的资源,无论使用什么算法,那么这个问题本身就被认为是困难的。该理论通过引入计算的数学模型来研究这些问题,并量化它们的计算复杂性,即解决这些问题所需的资源量,如时间和存储量,将这种直觉形式化。复杂性的其他度量也被使用,例如通信量(用于通信复杂性) ,电路中的门数(用于电路复杂性)和处理器数(用于并行计算)。计算复杂性理论的作用之一是确定计算机能做什么和不能做什么的实际限制。P/NP问题计算复杂性研究所是7个千禧年大奖难题之一,致力于计算复杂性领域的研究。
+
如果一个问题的解决需要大量的资源,无论使用什么算法,那么这个问题本身就被认为是困难的。该理论通过引入计算的数学模型来研究这些问题,并量化它们的计算复杂性,即解决这些问题所需的资源量,如时间和存储量,将这种直觉形式化。复杂性的其他度量也被使用,例如通信量(用于通信复杂性) ,电路中的门数(用于电路复杂性)和处理器数(用于并行计算)。计算复杂性理论的一个作用是确定计算机能做什么和不能做什么的实际限制。P/NP问题计算复杂性研究所是7个千禧年大奖难题计算复杂性研究所之一,致力于计算复杂性研究领域。
          +
Closely related fields in theoretical computer science are [[analysis of algorithms]] and [[computability theory]]. A key distinction between analysis of algorithms and computational complexity theory is that the former is devoted to analyzing the amount of resources needed by a particular algorithm to solve a problem, whereas the latter asks a more general question about all possible algorithms that could be used to solve the same problem. More precisely, computational complexity theory tries to classify problems that can or cannot be solved with appropriately restricted resources. In turn, imposing restrictions on the available resources is what distinguishes computational complexity from computability theory: the latter theory asks what kinds of problems can, in principle, be solved algorithmically.
      −
Closely related fields in theoretical computer science are [[analysis of algorithms]] and [[computability theory]]. A key distinction between analysis of algorithms and computational complexity theory is that the former is devoted to analyzing the amount of resources needed by a particular algorithm to solve a problem, whereas the latter asks a more general question about all possible algorithms that could be used to solve the same problem. More precisely, computational complexity theory tries to classify problems that can or cannot be solved with appropriately restricted resources. In turn, imposing restrictions on the available resources is what distinguishes computational complexity from computability theory: the latter theory asks what kind of problems can, in principle, be solved algorithmically.
     −
Closely related fields in theoretical computer science are analysis of algorithms and computability theory. A key distinction between analysis of algorithms and computational complexity theory is that the former is devoted to analyzing the amount of resources needed by a particular algorithm to solve a problem, whereas the latter asks a more general question about all possible algorithms that could be used to solve the same problem. More precisely, computational complexity theory tries to classify problems that can or cannot be solved with appropriately restricted resources. In turn, imposing restrictions on the available resources is what distinguishes computational complexity from computability theory: the latter theory asks what kind of problems can, in principle, be solved algorithmically.
+
Diagram of complexity classes provided that P ≠ NP. The existence of problems in NP outside both P and NP-complete in this case was established by Ladner. Such problems are called [[NP-intermediate problems. The graph isomorphism problem, the discrete logarithm problem and the integer factorization problem are examples of problems believed to be NP-intermediate. They are some of the very few NP problems not known to be in P or to be NP-complete.
   −
理论计算机科学中密切相关的领域是算法分析和可计算性理论分析。算法分析和计算复杂性理论分析之间的一个关键区别是,前者致力于分析一个特定算法解决问题所需的资源量,而后者则提出了一个关于所有可能用于解决同一问题的算法的更普遍的问题。更准确地说,计算复杂性理论试图将能够或不能用适当限制的资源解决的问题进行分类。反过来,对可用资源施加限制是区分计算复杂性和可计算性理论复杂性的关键: 后者的理论提出,原则上,什么样的问题可以通过算法解决。
+
在 p ≠ NP 的情况下,复杂性类的图表。在这种情况下,p 和 NP 完全以外的 NP 问题的存在性是由拉德纳建立的。这类问题称为[ np 中间问题。图同构问题、离散对数问题和整数分解问题就是被认为是 np 中间问题的例子。它们是极少数几个 NP 问题中的一些,不知道是 p 或 NP 完全问题。
 
  −
 
  −
 
  −
 
  −
 
  −
==Computational problems==
      
==Computational problems==
 
==Computational problems==
  −
计算问题
      
[[Image:TSP Deutschland 3.png|thumb|upright=1.5|A traveling salesman tour through 14 German cities.]]
 
[[Image:TSP Deutschland 3.png|thumb|upright=1.5|A traveling salesman tour through 14 German cities.]]
   −
A traveling salesman tour through 14 German cities.
+
The graph isomorphism problem is the computational problem of determining whether two finite graphs are isomorphic. An important unsolved problem in complexity theory is whether the graph isomorphism problem is in P, NP-complete, or NP-intermediate. The answer is not known, but it is believed that the problem is at least not NP-complete. John Myhill's definition of linear bounded automata (Myhill 1960), Raymond Smullyan's study of rudimentary sets (1961), as well as Hisao Yamada's paper on real-time computations (1962). Somewhat earlier, Boris Trakhtenbrot (1956), a pioneer in the field from the USSR, studied another specific complexity measure. As he remembers:
 
  −
一个旅行推销员游览了14个德国城市。
  −
 
  −
 
      +
图同构问题是判定两个有限图是否同构的计算问题。复杂性理论中一个尚未解决的重要问题是图的同构问题是在 p、 np 完全还是 np 中间。答案不得而知,但是人们相信这个问题至少不是 np 完全问题。线性有界自动机的定义(Myhill 1960) ,雷蒙·史慕扬对不完备集的研究(1961) ,以及 Hisao Yamada 关于实时计算的论文(1962)。更早些时候,Boris Trakhtenbrot (1956) ,苏联在这一领域的先驱,研究了另一个具体的复杂性度量。他回忆道:
      −
===Problem instances===
      
===Problem instances===
 
===Problem instances===
  −
问题实例
      
A [[computational problem]] can be viewed as an infinite collection of ''instances'' together with a ''solution'' for every instance. The input string for a computational problem is referred to as a problem instance, and should not be confused with the problem itself. In computational complexity theory, a problem refers to the abstract question to be solved. In contrast, an instance of this problem is a rather concrete utterance, which can serve as the input for a decision problem. For example, consider the problem of [[primality testing]]. The instance is a number (e.g., 15) and the solution is "yes" if the number is prime and "no" otherwise (in this case, 15 is not prime and the answer is "no"). Stated another way, the ''instance'' is a particular input to the problem, and the ''solution'' is the output corresponding to the given input.
 
A [[computational problem]] can be viewed as an infinite collection of ''instances'' together with a ''solution'' for every instance. The input string for a computational problem is referred to as a problem instance, and should not be confused with the problem itself. In computational complexity theory, a problem refers to the abstract question to be solved. In contrast, an instance of this problem is a rather concrete utterance, which can serve as the input for a decision problem. For example, consider the problem of [[primality testing]]. The instance is a number (e.g., 15) and the solution is "yes" if the number is prime and "no" otherwise (in this case, 15 is not prime and the answer is "no"). Stated another way, the ''instance'' is a particular input to the problem, and the ''solution'' is the output corresponding to the given input.
  −
A computational problem can be viewed as an infinite collection of instances together with a solution for every instance. The input string for a computational problem is referred to as a problem instance, and should not be confused with the problem itself. In computational complexity theory, a problem refers to the abstract question to be solved. In contrast, an instance of this problem is a rather concrete utterance, which can serve as the input for a decision problem. For example, consider the problem of primality testing. The instance is a number (e.g., 15) and the solution is "yes" if the number is prime and "no" otherwise (in this case, 15 is not prime and the answer is "no"). Stated another way, the instance is a particular input to the problem, and the solution is the output corresponding to the given input.
  −
  −
计算问题可以被看作是实例的无限集合和每个实例的解决方案。计算问题的输入字符串被称为问题实例,不应与问题本身混淆。在计算复杂性理论,问题指的是要解决的抽象问题。相比之下,这个问题的实例是一个相当具体的表述,可以作为决策问题的输入。例如,考虑素性测试的问题。实例是一个数字(例如,15) ,如果数字是质数,解决方案是“是” ,否则是“否”(在这种情况下,15不是质数,答案是“否”)。换句话说,实例是问题的特定输入,解决方案是与给定输入对应的输出。
            +
In 1967, Manuel Blum formulated a set of axioms (now known as Blum axioms) specifying desirable properties of complexity measures on the set of computable functions and proved an important result, the so-called speed-up theorem. The field began to flourish in 1971 when the Stephen Cook and Leonid Levin proved the existence of practically relevant problems that are NP-complete. In 1972, Richard Karp took this idea a leap forward with his landmark paper, "Reducibility Among Combinatorial Problems", in which he showed that 21 diverse combinatorial and graph theoretical problems, each infamous for its computational intractability, are NP-complete.
    +
1967年,Manuel Blum 提出了一组公理(现在称为 Blum 公理) ,在可计算函数集上指定了复杂度量的理想性质,并证明了一个重要的结果,即所谓的加速定理。这个领域在1971年开始蓬勃发展,当时史蒂芬 · 库克和莱昂尼德 · 莱文证明了存在实际上相关的 np 完全问题。1972年,理查德 · 卡普在他具有里程碑意义的论文《组合问题中的可约性》中,向我们展示了21个不同的组合和图论问题,每个问题都因其难于计算而臭名昭著,这是 np 完全问题。
    
To further highlight the difference between a problem and an instance, consider the following instance of the decision version of the [[traveling salesman problem]]: Is there a route of at most 2000 kilometres passing through all of Germany's 15 largest cities? The quantitative answer to this particular problem instance is of little use for solving other instances of the problem, such as asking for a round trip through all sites in [[Milan]] whose total length is at most 10 km. For this reason, complexity theory addresses computational problems and not particular problem instances.
 
To further highlight the difference between a problem and an instance, consider the following instance of the decision version of the [[traveling salesman problem]]: Is there a route of at most 2000 kilometres passing through all of Germany's 15 largest cities? The quantitative answer to this particular problem instance is of little use for solving other instances of the problem, such as asking for a round trip through all sites in [[Milan]] whose total length is at most 10 km. For this reason, complexity theory addresses computational problems and not particular problem instances.
   −
To further highlight the difference between a problem and an instance, consider the following instance of the decision version of the traveling salesman problem: Is there a route of at most 2000 kilometres passing through all of Germany's 15 largest cities? The quantitative answer to this particular problem instance is of little use for solving other instances of the problem, such as asking for a round trip through all sites in Milan whose total length is at most 10 km. For this reason, complexity theory addresses computational problems and not particular problem instances.
     −
为了进一步突出问题和实例之间的区别,考虑以下关于旅行推销员问题的决策版本: 是否有一条最多2000公里的路线穿过德国所有15个最大的城市?这个特殊问题的定量答案对于解决这个问题的其他实例没有什么用处,例如要求在米兰的所有地点进行往返旅行,这些地点的总长度最多不超过10公里。基于这个原因,复杂性理论解决的是计算问题而不是特定的问题实例。
      +
In the 1980s, much work was done on the average difficulty of solving NP-complete problems—both exactly and approximately. At that time, computational complexity theory was at its height, and it was widely believed that if a problem turned out to be NP-complete, then there was little chance of being able to work with the problem in a practical situation. However, it became increasingly clear that this is not always the case, and some authors claimed that general asymptotic results are often unimportant for typical problems arising in practice.
   −
 
+
20世纪80年代,人们在解决 np 完全问题的平均难度方面做了大量的工作。当时,计算复杂性理论正处于鼎盛时期,人们普遍认为,如果一个问题最终证明是 np 完全问题,那么在实际情况下处理这个问题的可能性就很小。然而,越来越清楚的是,情况并非总是如此,一些作者声称,对于实践中出现的典型问题,一般的渐近结果往往不重要。
 
  −
 
  −
===Representing problem instances===
      
===Representing problem instances===
 
===Representing problem instances===
  −
表示问题实例
      
When considering computational problems, a problem instance is a [[string (computer science)|string]] over an [[Alphabet (computer science)|alphabet]]. Usually, the alphabet is taken to be the binary alphabet (i.e., the set {0,1}), and thus the strings are [[bitstring]]s. As in a real-world [[computer]], mathematical objects other than bitstrings must be suitably encoded. For example, [[integer]]s can be represented in [[binary notation]], and [[graph (discrete mathematics)|graph]]s can be encoded directly via their [[adjacency matrix|adjacency matrices]], or by encoding their [[adjacency list]]s in binary.
 
When considering computational problems, a problem instance is a [[string (computer science)|string]] over an [[Alphabet (computer science)|alphabet]]. Usually, the alphabet is taken to be the binary alphabet (i.e., the set {0,1}), and thus the strings are [[bitstring]]s. As in a real-world [[computer]], mathematical objects other than bitstrings must be suitably encoded. For example, [[integer]]s can be represented in [[binary notation]], and [[graph (discrete mathematics)|graph]]s can be encoded directly via their [[adjacency matrix|adjacency matrices]], or by encoding their [[adjacency list]]s in binary.
   −
When considering computational problems, a problem instance is a string over an alphabet. Usually, the alphabet is taken to be the binary alphabet (i.e., the set {0,1}), and thus the strings are bitstrings. As in a real-world computer, mathematical objects other than bitstrings must be suitably encoded. For example, integers can be represented in binary notation, and graphs can be encoded directly via their adjacency matrices, or by encoding their adjacency lists in binary.
     −
在考虑计算问题时,问题实例是字母表上的字符串。通常,字母表被认为是二进制字母表(即集合{0,1}) ,因此字符串是位字符串。在现实世界的计算机中,除了位字符串以外的数学对象必须进行适当的编码。例如,整数可以用二进制表示法表示,图可以通过它们的邻接矩阵直接进行编码,或者用二进制编码它们的邻接列表。
  −
  −
  −
  −
  −
  −
Even though some proofs of complexity-theoretic theorems regularly assume some concrete choice of input encoding, one tries to keep the discussion abstract enough to be independent of the choice of encoding. This can be achieved by ensuring that different representations can be transformed into each other efficiently.
      
Even though some proofs of complexity-theoretic theorems regularly assume some concrete choice of input encoding, one tries to keep the discussion abstract enough to be independent of the choice of encoding. This can be achieved by ensuring that different representations can be transformed into each other efficiently.
 
Even though some proofs of complexity-theoretic theorems regularly assume some concrete choice of input encoding, one tries to keep the discussion abstract enough to be independent of the choice of encoding. This can be achieved by ensuring that different representations can be transformed into each other efficiently.
  −
尽管复杂性理论定理的一些证明通常假设输入编码的某些具体选择,但是有人试图使讨论足够抽象,使其与编码的选择无关。这可以通过确保不同的表示可以有效地相互转换来实现。
  −
  −
  −
        −
===Decision problems as formal languages===
      
===Decision problems as formal languages===
 
===Decision problems as formal languages===
  −
作为形式语言的决策问题
      
[[Image:Decision Problem.svg|thumb|A [[decision problem]] has only two possible outputs, ''yes'' or ''no'' (or alternately 1 or 0) on any input.]]
 
[[Image:Decision Problem.svg|thumb|A [[decision problem]] has only two possible outputs, ''yes'' or ''no'' (or alternately 1 or 0) on any input.]]
  −
A [[decision problem has only two possible outputs, yes or no (or alternately 1 or 0) on any input.]]
  −
  −
一个[决策问题对于任何输入只有两个可能的输出,是或否(或者选择1或0)]
      
[[Decision problem]]s are one of the central objects of study in computational complexity theory. A decision problem is a special type of computational problem whose answer is either ''yes'' or ''no'', or alternately either 1 or 0. A decision problem can be viewed as a [[formal language]], where the members of the language are instances whose output is yes, and the non-members are those instances whose output is no. The objective is to decide, with the aid of an [[algorithm]], whether a given input string is a member of the formal language under consideration. If the algorithm deciding this problem returns the answer ''yes'', the algorithm is said to accept the input string, otherwise it is said to reject the input.
 
[[Decision problem]]s are one of the central objects of study in computational complexity theory. A decision problem is a special type of computational problem whose answer is either ''yes'' or ''no'', or alternately either 1 or 0. A decision problem can be viewed as a [[formal language]], where the members of the language are instances whose output is yes, and the non-members are those instances whose output is no. The objective is to decide, with the aid of an [[algorithm]], whether a given input string is a member of the formal language under consideration. If the algorithm deciding this problem returns the answer ''yes'', the algorithm is said to accept the input string, otherwise it is said to reject the input.
  −
Decision problems are one of the central objects of study in computational complexity theory. A decision problem is a special type of computational problem whose answer is either yes or no, or alternately either 1 or 0. A decision problem can be viewed as a formal language, where the members of the language are instances whose output is yes, and the non-members are those instances whose output is no. The objective is to decide, with the aid of an algorithm, whether a given input string is a member of the formal language under consideration. If the algorithm deciding this problem returns the answer yes, the algorithm is said to accept the input string, otherwise it is said to reject the input.
  −
  −
决策问题是计算复杂性理论的中心研究对象之一。决策问题是一种特殊类型的计算问题问题,它的答案要么是是或否,要么是1或0。决策问题可以看作是一种形式语言,其中语言的成员是其输出为 yes 的实例,而非成员是其输出为 no 的实例。其目的是借助算法来决定一个给定的输入字符串是否是所考虑的形式语言的成员。如果决定这个问题的算法返回的答案是肯定的,那么就说算法接受输入字符串,否则就说算法拒绝输入。
  −
  −
            
An example of a decision problem is the following. The input is an arbitrary [[graph (discrete mathematics)|graph]]. The problem consists in deciding whether the given graph is [[connectivity (graph theory)|connected]] or not. The formal language associated with this decision problem is then the set of all connected graphs — to obtain a precise definition of this language, one has to decide how graphs are encoded as binary strings.
 
An example of a decision problem is the following. The input is an arbitrary [[graph (discrete mathematics)|graph]]. The problem consists in deciding whether the given graph is [[connectivity (graph theory)|connected]] or not. The formal language associated with this decision problem is then the set of all connected graphs — to obtain a precise definition of this language, one has to decide how graphs are encoded as binary strings.
  −
An example of a decision problem is the following. The input is an arbitrary graph. The problem consists in deciding whether the given graph is connected or not. The formal language associated with this decision problem is then the set of all connected graphs — to obtain a precise definition of this language, one has to decide how graphs are encoded as binary strings.
  −
  −
决策问题的一个例子如下。输入是一个任意的图。问题在于判断给定的图是否连通。与这个决策问题相关的形式语言是所有连通图的集合ーー为了获得这种语言的精确定义,必须决定图是如何编码成二进制字符串的。
  −
  −
            
===Function problems===
 
===Function problems===
  −
===Function problems===
  −
  −
功能问题
      
A [[function problem]] is a computational problem where a single output (of a [[total function]]) is expected for every input, but the output is more complex than that of a [[decision problem]]—that is, the output isn't just yes or no. Notable examples include the [[traveling salesman problem]] and the [[integer factorization problem]].
 
A [[function problem]] is a computational problem where a single output (of a [[total function]]) is expected for every input, but the output is more complex than that of a [[decision problem]]—that is, the output isn't just yes or no. Notable examples include the [[traveling salesman problem]] and the [[integer factorization problem]].
  −
A function problem is a computational problem where a single output (of a total function) is expected for every input, but the output is more complex than that of a decision problem—that is, the output isn't just yes or no. Notable examples include the traveling salesman problem and the integer factorization problem.
  −
  −
函数问题是一个计算问题问题,在这个问题中,每个输入都需要一个单独的输出,但是输出要比决策问题复杂得多---- 也就是说,输出不仅仅是是或否。值得注意的例子包括旅行推销员问题和整数分解问题。
  −
  −
            
It is tempting to think that the notion of function problems is much richer than the notion of decision problems. However, this is not really the case, since function problems can be recast as decision problems. For example, the multiplication of two integers can be expressed as the set of triples (''a'', ''b'', ''c'') such that the relation ''a'' × ''b'' = ''c'' holds. Deciding whether a given triple is a member of this set corresponds to solving the problem of multiplying two numbers.
 
It is tempting to think that the notion of function problems is much richer than the notion of decision problems. However, this is not really the case, since function problems can be recast as decision problems. For example, the multiplication of two integers can be expressed as the set of triples (''a'', ''b'', ''c'') such that the relation ''a'' × ''b'' = ''c'' holds. Deciding whether a given triple is a member of this set corresponds to solving the problem of multiplying two numbers.
  −
It is tempting to think that the notion of function problems is much richer than the notion of decision problems. However, this is not really the case, since function problems can be recast as decision problems. For example, the multiplication of two integers can be expressed as the set of triples (a, b, c) such that the relation a × b = c holds. Deciding whether a given triple is a member of this set corresponds to solving the problem of multiplying two numbers.
  −
  −
人们很容易认为函数问题的概念比决策问题的概念要丰富得多。然而,实际情况并非如此,因为函数问题可以被重写为决策问题。例如,两个整数的乘法可以表示为三元组的集合(a,b,c) ,这样,关系 a b c 就成立了。判断一个给定的三元组是否是该集合的一个成员,相当于解决了两个数相乘的问题。
  −
  −
            
===Measuring the size of an instance===
 
===Measuring the size of an instance===
  −
===Measuring the size of an instance===
  −
  −
测量实例的大小
      
To measure the difficulty of solving a computational problem, one may wish to see how much time the best algorithm requires to solve the problem. However, the running time may, in general, depend on the instance. In particular, larger instances will require more time to solve. Thus the time required to solve a problem (or the space required, or any measure of complexity) is calculated as a function of the size of the instance. This is usually taken to be the size of the input in bits. Complexity theory is interested in how algorithms scale with an increase in the input size. For instance, in the problem of finding whether a graph is connected, how much more time does it take to solve a problem for a graph with 2''n'' vertices compared to the time taken for a graph with ''n'' vertices?
 
To measure the difficulty of solving a computational problem, one may wish to see how much time the best algorithm requires to solve the problem. However, the running time may, in general, depend on the instance. In particular, larger instances will require more time to solve. Thus the time required to solve a problem (or the space required, or any measure of complexity) is calculated as a function of the size of the instance. This is usually taken to be the size of the input in bits. Complexity theory is interested in how algorithms scale with an increase in the input size. For instance, in the problem of finding whether a graph is connected, how much more time does it take to solve a problem for a graph with 2''n'' vertices compared to the time taken for a graph with ''n'' vertices?
  −
To measure the difficulty of solving a computational problem, one may wish to see how much time the best algorithm requires to solve the problem. However, the running time may, in general, depend on the instance. In particular, larger instances will require more time to solve. Thus the time required to solve a problem (or the space required, or any measure of complexity) is calculated as a function of the size of the instance. This is usually taken to be the size of the input in bits. Complexity theory is interested in how algorithms scale with an increase in the input size. For instance, in the problem of finding whether a graph is connected, how much more time does it take to solve a problem for a graph with 2n vertices compared to the time taken for a graph with n vertices?
  −
  −
要衡量解决一个计算问题问题的难度,你可能希望看到最好的算法需要多少时间来解决这个问题。但是,通常情况下,运行时间可能取决于实例。特别是,更大的实例将需要更多的时间来解决。因此,解决问题所需的时间(或所需的空间,或任何复杂性度量)是按实例大小的函数计算的。这通常被认为是输入位的大小。复杂性理论的兴趣在于算法如何随着输入大小的增加而扩展。例如,在寻找一个图是否连通的问题中,与寻找一个有 n 个顶点的图相比,寻找一个有2n 个顶点的图需要多少时间来解决一个问题?
  −
  −
            
If the input size is ''n'', the time taken can be expressed as a function of ''n''. Since the time taken on different inputs of the same size can be different, the worst-case time complexity T(''n'') is defined to be the maximum time taken over all inputs of size ''n''. If T(''n'') is a polynomial in ''n'', then the algorithm is said to be a [[polynomial time]] algorithm. [[Cobham's thesis]] argues that a problem can be solved with a feasible amount of resources if it admits a polynomial time algorithm.
 
If the input size is ''n'', the time taken can be expressed as a function of ''n''. Since the time taken on different inputs of the same size can be different, the worst-case time complexity T(''n'') is defined to be the maximum time taken over all inputs of size ''n''. If T(''n'') is a polynomial in ''n'', then the algorithm is said to be a [[polynomial time]] algorithm. [[Cobham's thesis]] argues that a problem can be solved with a feasible amount of resources if it admits a polynomial time algorithm.
  −
If the input size is n, the time taken can be expressed as a function of n. Since the time taken on different inputs of the same size can be different, the worst-case time complexity T(n) is defined to be the maximum time taken over all inputs of size n. If T(n) is a polynomial in n, then the algorithm is said to be a polynomial time algorithm. Cobham's thesis argues that a problem can be solved with a feasible amount of resources if it admits a polynomial time algorithm.
  −
  −
如果输入大小为 n,所花费的时间可以表示为 n 的函数。 由于同一大小的不同输入所占用的时间可能不同,最坏情况下的时间复杂度 t (n)被定义为大小 n 的所有输入所占用的最大时间。 如果 t (n)是 n 中的多项式,那么该算法称为多项式时间算法。Cobham 的论文认为,如果一个问题采用多项式时间算法,那么它可以用可行的资源量来解决。
  −
  −
            
==Machine models and complexity measures==
 
==Machine models and complexity measures==
  −
==Machine models and complexity measures==
  −
  −
机器模型和复杂性度量
  −
  −
            
===Turing machine===
 
===Turing machine===
  −
===Turing machine===
  −
  −
图灵机
      
{{main|Turing machine}}
 
{{main|Turing machine}}
  −
      
[[File:Turing machine 2b.svg|thumb|right|An illustration of a Turing machine]]
 
[[File:Turing machine 2b.svg|thumb|right|An illustration of a Turing machine]]
  −
An illustration of a Turing machine
  −
  −
图灵机的插图
      
A Turing machine is a mathematical model of a general computing machine. It is a theoretical device that manipulates symbols contained on a strip of tape. Turing machines are not intended as a practical computing technology, but rather as a general model of a computing machine—anything from an advanced supercomputer to a mathematician with a pencil and paper. It is believed that if a problem can be solved by an algorithm, there exists a Turing machine that solves the problem. Indeed, this is the statement of the [[Church–Turing thesis]]. Furthermore, it is known that everything that can be computed on other models of computation known to us today, such as a [[RAM machine]], [[Conway's Game of Life]], [[cellular automata]] or any programming language can be computed on a Turing machine. Since Turing machines are easy to analyze mathematically, and are believed to be as powerful as any other model of computation, the Turing machine is the most commonly used model in complexity theory.
 
A Turing machine is a mathematical model of a general computing machine. It is a theoretical device that manipulates symbols contained on a strip of tape. Turing machines are not intended as a practical computing technology, but rather as a general model of a computing machine—anything from an advanced supercomputer to a mathematician with a pencil and paper. It is believed that if a problem can be solved by an algorithm, there exists a Turing machine that solves the problem. Indeed, this is the statement of the [[Church–Turing thesis]]. Furthermore, it is known that everything that can be computed on other models of computation known to us today, such as a [[RAM machine]], [[Conway's Game of Life]], [[cellular automata]] or any programming language can be computed on a Turing machine. Since Turing machines are easy to analyze mathematically, and are believed to be as powerful as any other model of computation, the Turing machine is the most commonly used model in complexity theory.
  −
A Turing machine is a mathematical model of a general computing machine. It is a theoretical device that manipulates symbols contained on a strip of tape. Turing machines are not intended as a practical computing technology, but rather as a general model of a computing machine—anything from an advanced supercomputer to a mathematician with a pencil and paper. It is believed that if a problem can be solved by an algorithm, there exists a Turing machine that solves the problem. Indeed, this is the statement of the Church–Turing thesis. Furthermore, it is known that everything that can be computed on other models of computation known to us today, such as a RAM machine, Conway's Game of Life, cellular automata or any programming language can be computed on a Turing machine. Since Turing machines are easy to analyze mathematically, and are believed to be as powerful as any other model of computation, the Turing machine is the most commonly used model in complexity theory.
  −
  −
图灵机是通用计算机的数学模型。它是一种理论上的装置,可以操纵一条带子上的符号。图灵机并不是一种实用的计算机技术,而是一种计算机的通用模型ーー从一台高级超级计算机到一个拿着铅笔和纸的数学家。人们相信,如果一个问题可以通过算法来解决,那么就存在一个图灵机来解决这个问题。事实上,这就是丘奇-图灵论点的陈述。此外,众所周知,所有可以在我们今天已知的其他计算模型上计算的东西,例如 RAM 机器、 Conway 的生命游戏、细胞自动机或任何编程语言都可以在图灵机上计算。由于图灵机易于进行数学分析,并且被认为和其他任何计算模型一样强大,因此图灵机是复杂性理论中最常用的模型。
  −
  −
            
Many types of Turing machines are used to define complexity classes, such as [[deterministic Turing machine]]s, [[probabilistic Turing machine]]s, [[non-deterministic Turing machine]]s, [[quantum Turing machine]]s, [[symmetric Turing machine]]s and [[alternating Turing machine]]s. They are all equally powerful in principle, but when resources (such as time or space) are bounded, some of these may be more powerful than others.
 
Many types of Turing machines are used to define complexity classes, such as [[deterministic Turing machine]]s, [[probabilistic Turing machine]]s, [[non-deterministic Turing machine]]s, [[quantum Turing machine]]s, [[symmetric Turing machine]]s and [[alternating Turing machine]]s. They are all equally powerful in principle, but when resources (such as time or space) are bounded, some of these may be more powerful than others.
  −
Many types of Turing machines are used to define complexity classes, such as deterministic Turing machines, probabilistic Turing machines, non-deterministic Turing machines, quantum Turing machines, symmetric Turing machines and alternating Turing machines. They are all equally powerful in principle, but when resources (such as time or space) are bounded, some of these may be more powerful than others.
  −
  −
许多类型的图灵机被用来定义复杂性类,如确定性图灵机、概率图灵机、不确定图灵机、量子图灵机、对称图灵机和交替图灵机。它们在原则上都同样强大,但当资源(如时间或空间)被限制时,其中一些可能比其他的更强大。
            +
| last1=Arora | first1=Sanjeev | authorlink1=Sanjeev Arora
    +
1 = Arora | first1 = Sanjeev | authorlink1 = Sanjeev Arora
    
A deterministic Turing machine is the most basic Turing machine, which uses a fixed set of rules to determine its future actions. A probabilistic Turing machine is a deterministic Turing machine with an extra supply of random bits. The ability to make probabilistic decisions often helps algorithms solve problems more efficiently. Algorithms that use random bits are called [[randomized algorithm]]s. A non-deterministic Turing machine is a deterministic Turing machine with an added feature of non-determinism, which allows a Turing machine to have multiple possible future actions from a given state. One way to view non-determinism is that the Turing machine branches into many possible computational paths at each step, and if it solves the problem in any of these branches, it is said to have solved the problem. Clearly, this model is not meant to be a physically realizable model, it is just a theoretically interesting abstract machine that gives rise to particularly interesting complexity classes. For examples, see [[non-deterministic algorithm]].
 
A deterministic Turing machine is the most basic Turing machine, which uses a fixed set of rules to determine its future actions. A probabilistic Turing machine is a deterministic Turing machine with an extra supply of random bits. The ability to make probabilistic decisions often helps algorithms solve problems more efficiently. Algorithms that use random bits are called [[randomized algorithm]]s. A non-deterministic Turing machine is a deterministic Turing machine with an added feature of non-determinism, which allows a Turing machine to have multiple possible future actions from a given state. One way to view non-determinism is that the Turing machine branches into many possible computational paths at each step, and if it solves the problem in any of these branches, it is said to have solved the problem. Clearly, this model is not meant to be a physically realizable model, it is just a theoretically interesting abstract machine that gives rise to particularly interesting complexity classes. For examples, see [[non-deterministic algorithm]].
   −
A deterministic Turing machine is the most basic Turing machine, which uses a fixed set of rules to determine its future actions. A probabilistic Turing machine is a deterministic Turing machine with an extra supply of random bits. The ability to make probabilistic decisions often helps algorithms solve problems more efficiently. Algorithms that use random bits are called randomized algorithms. A non-deterministic Turing machine is a deterministic Turing machine with an added feature of non-determinism, which allows a Turing machine to have multiple possible future actions from a given state. One way to view non-determinism is that the Turing machine branches into many possible computational paths at each step, and if it solves the problem in any of these branches, it is said to have solved the problem. Clearly, this model is not meant to be a physically realizable model, it is just a theoretically interesting abstract machine that gives rise to particularly interesting complexity classes. For examples, see non-deterministic algorithm.
+
| last2=Barak | first2=Boaz
   −
确定性图灵机是最基本的图灵机,它使用一组固定的规则来决定未来的动作。机率图灵机图灵机是一种具有额外随机位的确定性图灵机。做出概率决策的能力通常有助于算法更有效地解决问题。使用随机位的算法称为随机算法。非确定型图灵机图灵机是一种确定性图灵机,具有额外的非确定性特征,它允许图灵机在给定的状态下有多种可能的未来动作。查看非确定性的一种方法是,图灵机在每个步骤中分支成许多可能的计算路径,如果它在这些分支中的任何一个中解决了这个问题,就说它已经解决了这个问题。显然,这个模型并不意味着是一个物理上可实现的模型,它只是一个理论上有趣的抽象机器,它产生了特别有趣的复杂类。例如,请参阅非确定性算法。
+
2 = Barak | first2 = Boaz
          +
| title=Computational Complexity: A Modern Approach
    +
| title = 计算复杂性: 一种现代方法
    
===Other machine models===
 
===Other machine models===
   −
===Other machine models===
+
| url = http://www.cs.princeton.edu/theory/complexity/
   −
其他机型
+
Http://www.cs.princeton.edu/theory/complexity/
    
Many machine models different from the standard [[Turing machine equivalents#Multi-tape Turing machines|multi-tape Turing machines]] have been proposed in the literature, for example [[random access machine]]s. Perhaps surprisingly, each of these models can be converted to another without providing any extra computational power. The time and memory consumption of these alternate models may vary.<ref>See {{harvnb|Arora|Barak|2009|loc=Chapter 1: The computational model and why it doesn't matter}}</ref> What all these models have in common is that the machines operate [[deterministic algorithm|deterministically]].
 
Many machine models different from the standard [[Turing machine equivalents#Multi-tape Turing machines|multi-tape Turing machines]] have been proposed in the literature, for example [[random access machine]]s. Perhaps surprisingly, each of these models can be converted to another without providing any extra computational power. The time and memory consumption of these alternate models may vary.<ref>See {{harvnb|Arora|Barak|2009|loc=Chapter 1: The computational model and why it doesn't matter}}</ref> What all these models have in common is that the machines operate [[deterministic algorithm|deterministically]].
  −
Many machine models different from the standard multi-tape Turing machines have been proposed in the literature, for example random access machines. Perhaps surprisingly, each of these models can be converted to another without providing any extra computational power. The time and memory consumption of these alternate models may vary. What all these models have in common is that the machines operate deterministically.
  −
  −
文献中提出了许多不同于标准多带图灵机的机器模型,例如随机存取机。也许令人惊讶的是,这些模型中的每一个都可以转换成另一个模型,而不需要提供任何额外的计算能力。这些替代模型的时间和内存消耗可能会有所不同。所有这些模型的共同点是,这些机器都是以确定的方式运行的。
  −
  −
  −
  −
  −
  −
However, some computational problems are easier to analyze in terms of more unusual resources. For example, a non-deterministic Turing machine is a computational model that is allowed to branch out to check many different possibilities at once. The non-deterministic Turing machine has very little to do with how we physically want to compute algorithms, but its branching exactly captures many of the mathematical models we want to analyze, so that [[non-deterministic time]] is a very important resource in analyzing computational problems.
  −
  −
However, some computational problems are easier to analyze in terms of more unusual resources. For example, a non-deterministic Turing machine is a computational model that is allowed to branch out to check many different possibilities at once. The non-deterministic Turing machine has very little to do with how we physically want to compute algorithms, but its branching exactly captures many of the mathematical models we want to analyze, so that non-deterministic time is a very important resource in analyzing computational problems.
  −
  −
然而,一些计算问题更容易用更多不寻常的资源来分析。例如,非确定型图灵机是一个允许同时检查许多不同可能性的计算模型。非确定型图灵机对于我们在物理上希望计算算法的方式几乎没有什么影响,但是它的分支精确地捕获了我们想要分析的许多数学模型,因此非确定性时间是分析计算问题的一个非常重要的资源。
  −
  −
  −
  −
  −
  −
===Complexity measures===
  −
  −
===Complexity measures===
  −
  −
复杂性度量
  −
  −
For a precise definition of what it means to solve a problem using a given amount of time and space, a computational model such as the [[deterministic Turing machine]] is used. The ''time required'' by a deterministic Turing machine ''M'' on input ''x'' is the total number of state transitions, or steps, the machine makes before it halts and outputs the answer ("yes" or "no"). A Turing machine ''M'' is said to operate within time ''f''(''n''), if the time required by ''M'' on each input of length ''n'' is at most ''f''(''n''). A decision problem ''A'' can be solved in time ''f''(''n'') if there exists a Turing machine operating in time ''f''(''n'') that solves the problem. Since complexity theory is interested in classifying problems based on their difficulty, one defines sets of problems based on some criteria. For instance, the set of problems solvable within time ''f''(''n'') on a deterministic Turing machine is then denoted by [[DTIME]](''f''(''n'')).
  −
  −
For a precise definition of what it means to solve a problem using a given amount of time and space, a computational model such as the deterministic Turing machine is used. The time required by a deterministic Turing machine M on input x is the total number of state transitions, or steps, the machine makes before it halts and outputs the answer ("yes" or "no"). A Turing machine M is said to operate within time f(n), if the time required by M on each input of length n is at most f(n). A decision problem A can be solved in time f(n) if there exists a Turing machine operating in time f(n) that solves the problem. Since complexity theory is interested in classifying problems based on their difficulty, one defines sets of problems based on some criteria. For instance, the set of problems solvable within time f(n) on a deterministic Turing machine is then denoted by DTIME(f(n)).
  −
  −
为了精确定义使用给定时间和空间解决问题的意义,我们使用了确定性图灵机这样的计算模型。确定性图灵机 m 在输入 x 上所需的时间是该机在停止并输出答案(“是”或“否”)之前进行的状态转换或步骤的总数。如果 m 对每个长度 n 的输入所需的时间最多为 f (n) ,则称 m 在时间 f (n)内工作。如果存在一个在时间 f (n)内运行的图灵机,决策问题 a 可以在时间 f (n)内得到解决。由于复杂性理论对根据问题的难度对问题进行分类感兴趣,因此人们根据一些标准来定义问题集。例如,在确定性图灵机上,在时间 f (n)内可解决的问题的集合由 DTIME (f (n))表示。
  −
  −
  −
  −
  −
  −
Analogous definitions can be made for space requirements. Although time and space are the most well-known complexity resources, any [[Complexity|complexity measure]] can be viewed as a computational resource. Complexity measures are very generally defined by the [[Blum complexity axioms]]. Other complexity measures used in complexity theory include [[communication complexity]], [[circuit complexity]], and [[decision tree complexity]].
  −
  −
Analogous definitions can be made for space requirements. Although time and space are the most well-known complexity resources, any complexity measure can be viewed as a computational resource. Complexity measures are very generally defined by the Blum complexity axioms. Other complexity measures used in complexity theory include communication complexity, circuit complexity, and decision tree complexity.
  −
  −
可以对空间要求作出类似的定义。虽然时间和空间是最著名的复杂性资源,但任何复杂性度量都可以被视为计算资源。复杂性度量通常是由 Blum 复杂性公理定义的。复杂性理论中使用的其他复杂性度量包括通信复杂性、电路复杂性和决策树复杂性。
  −
  −
  −
  −
  −
  −
The complexity of an algorithm is often expressed using [[big O notation]].
  −
  −
The complexity of an algorithm is often expressed using big O notation.
  −
  −
算法的复杂性通常用大 o 表示法来表示。
  −
  −
  −
  −
  −
  −
===Best, worst and average case complexity===
  −
  −
===Best, worst and average case complexity===
  −
  −
最佳、最差和平均情况复杂度
  −
  −
[[File:Sorting quicksort anim.gif|thumb|Visualization of the [[quicksort]] [[algorithm]] that has [[Best, worst and average case|average case performance]] <math>\mathcal{O}(n\log n)</math>.]]
  −
  −
Visualization of the [[quicksort algorithm that has average case performance <math>\mathcal{O}(n\log n)</math>.]]
  −
  −
[[具有平均案例性能 math  o }(n  log n) / math. ]的快速排序算法的可视化
  −
  −
The [[best, worst and average case]] complexity refer to three different ways of measuring the time complexity (or any other complexity measure) of different inputs of the same size. Since some inputs of size ''n'' may be faster to solve than others, we define the following complexities:
  −
  −
The best, worst and average case complexity refer to three different ways of measuring the time complexity (or any other complexity measure) of different inputs of the same size. Since some inputs of size n may be faster to solve than others, we define the following complexities:
  −
  −
最佳、最差和平均情况复杂度是指三种不同的方法来度量相同大小的不同输入的时间复杂度(或任何其他复杂度度量)。由于一些 n 大小的输入可能比其他的更快解决,我们定义了以下复杂性:
  −
  −
#Best-case complexity: This is the complexity of solving the problem for the best input of size ''n''.
  −
  −
Best-case complexity: This is the complexity of solving the problem for the best input of size n.
  −
  −
最佳情况复杂性: 这是解决问题的复杂性,最佳输入的大小 n。
  −
  −
#Average-case complexity: This is the complexity of solving the problem on an average. This complexity is only defined with respect to a [[probability distribution]] over the inputs. For instance, if all inputs of the same size are assumed to be equally likely to appear, the average case complexity can be defined with respect to the uniform distribution over all inputs of size ''n''.
  −
  −
Average-case complexity: This is the complexity of solving the problem on an average. This complexity is only defined with respect to a probability distribution over the inputs. For instance, if all inputs of the same size are assumed to be equally likely to appear, the average case complexity can be defined with respect to the uniform distribution over all inputs of size n.
  −
  −
平均案例复杂度: 这是解决问题的平均复杂度。这种复杂性只是根据输入的概率分布来定义的。例如,如果假定所有相同大小的输入出现的可能性相等,则关于大小 n 的所有输入的均匀分布,可以定义平均案例复杂度。
  −
  −
#[[Amortized analysis]]: Amortized analysis considers both the costly and less costly operations together over the whole series of operations of the algorithm.
  −
  −
Amortized analysis: Amortized analysis considers both the costly and less costly operations together over the whole series of operations of the algorithm.
  −
  −
平摊分析算法: 在算法的整个系列操作中,平摊分析算法同时考虑了成本较高和成本较低的操作。
  −
  −
#Worst-case complexity: This is the complexity of solving the problem for the worst input of size ''n''.
  −
  −
Worst-case complexity: This is the complexity of solving the problem for the worst input of size n.
  −
  −
最坏情况复杂度: 这是解决大小 n 的最坏输入问题的复杂度。
  −
  −
The order from cheap to costly is: Best, average (of [[discrete uniform distribution]]), amortized, worst.
  −
  −
The order from cheap to costly is: Best, average (of discrete uniform distribution), amortized, worst.
  −
  −
从价格便宜到价格昂贵的订单分别是: 最好的,平均的,分期偿还的,最差的离散型均匀分佈。
  −
  −
  −
  −
  −
  −
For example, consider the deterministic sorting algorithm [[quicksort]]. This solves the problem of sorting a list of integers that is given as the input. The worst-case is when the input is sorted or sorted in reverse order, and the algorithm takes time [[Big O notation|O]](''n''<sup>2</sup>) for this case. If we assume that all possible permutations of the input list are equally likely, the average time taken for sorting is O(''n'' log ''n''). The best case occurs when each pivoting divides the list in half, also needing O(''n'' log ''n'') time.
  −
  −
For example, consider the deterministic sorting algorithm quicksort. This solves the problem of sorting a list of integers that is given as the input. The worst-case is when the input is sorted or sorted in reverse order, and the algorithm takes time O(n<sup>2</sup>) for this case. If we assume that all possible permutations of the input list are equally likely, the average time taken for sorting is O(n log n). The best case occurs when each pivoting divides the list in half, also needing O(n log n) time.
  −
  −
例如,考虑确定性排序算法快速排序。这解决了对作为输入的整数列表进行排序的问题。最坏的情况是输入按逆序排序,对于这种情况,算法需要时间 o (n sup 2 / sup)。如果我们假设输入列表的所有可能排列都是相等的,那么排序所需的平均时间是 o (n log n)。最好的情况发生在每个旋转将列表分为两部分时,也需要 o (n log n)时间。
  −
  −
  −
  −
  −
  −
===Upper and lower bounds on the complexity of problems===
  −
  −
===Upper and lower bounds on the complexity of problems===
  −
  −
问题复杂性的上下界
  −
  −
To classify the computation time (or similar resources, such as space consumption), one is interested in proving upper and lower bounds on the maximum amount of time required by the most efficient algorithm solving a given problem. The complexity of an algorithm is usually taken to be its worst-case complexity, unless specified otherwise. Analyzing a particular algorithm falls under the field of [[analysis of algorithms]]. To show an upper bound ''T''(''n'') on the time complexity of a problem, one needs to show only that there is a particular algorithm with running time at most ''T''(''n''). However, proving lower bounds is much more difficult, since lower bounds make a statement about all possible algorithms that solve a given problem. The phrase "all possible algorithms" includes not just the algorithms known today, but any algorithm that might be discovered in the future. To show a lower bound of ''T''(''n'') for a problem requires showing that no algorithm can have time complexity lower than ''T''(''n'').
  −
  −
To classify the computation time (or similar resources, such as space consumption), one is interested in proving upper and lower bounds on the maximum amount of time required by the most efficient algorithm solving a given problem. The complexity of an algorithm is usually taken to be its worst-case complexity, unless specified otherwise. Analyzing a particular algorithm falls under the field of analysis of algorithms. To show an upper bound T(n) on the time complexity of a problem, one needs to show only that there is a particular algorithm with running time at most T(n). However, proving lower bounds is much more difficult, since lower bounds make a statement about all possible algorithms that solve a given problem. The phrase "all possible algorithms" includes not just the algorithms known today, but any algorithm that might be discovered in the future. To show a lower bound of T(n) for a problem requires showing that no algorithm can have time complexity lower than T(n).
  −
  −
为了对计算时间进行分类(或者类似的资源,比如空间消耗) ,人们感兴趣的是证明解决给定问题的最有效算法所需要的最大时间的上下界。算法的复杂性通常被认为是其最坏情况的复杂性,除非另有说明。分析一个特定的算法属于算法分析的范畴。为了给出问题时间复杂度的上界 t (n) ,我们只需要给出一个运行时间最多为 t (n)的特定算法。然而,证明下界要困难得多,因为下界表明了解决给定问题的所有可能的算法。“所有可能的算法”这个短语不仅包括今天已知的算法,还包括将来可能发现的任何算法。为了给出问题 t (n)的下界,需要证明任何算法的时间复杂度都不能低于 t (n)。
  −
  −
  −
  −
  −
  −
Upper and lower bounds are usually stated using the [[big O notation]], which hides constant factors and smaller terms. This makes the bounds independent of the specific details of the computational model used. For instance, if ''T''(''n'')&nbsp;=&nbsp;7''n''<sup>2</sup>&nbsp;+&nbsp;15''n''&nbsp;+&nbsp;40, in big O notation one would write ''T''(''n'')&nbsp;=&nbsp;O(''n''<sup>2</sup>).
  −
  −
Upper and lower bounds are usually stated using the big O notation, which hides constant factors and smaller terms. This makes the bounds independent of the specific details of the computational model used. For instance, if T(n)&nbsp;=&nbsp;7n<sup>2</sup>&nbsp;+&nbsp;15n&nbsp;+&nbsp;40, in big O notation one would write T(n)&nbsp;=&nbsp;O(n<sup>2</sup>).
  −
  −
上下界通常使用大 o 符号来表示,它隐藏了常数因子和较小的项。这使得边界与使用的计算模型的具体细节无关。例如,如果 t (n)7n sup 2 / sup + 15n + 40,在大 o 表示法中写 t (n) o (n sup 2 / sup)。
  −
  −
  −
  −
  −
  −
==Complexity classes==
  −
  −
==Complexity classes==
  −
  −
复杂性类
  −
  −
{{main|Complexity class}}
  −
  −
  −
  −
  −
  −
  −
  −
===Defining complexity classes===
  −
  −
===Defining complexity classes===
  −
  −
定义复杂性类
  −
  −
A '''complexity class''' is a set of problems of related complexity. Simpler complexity classes are defined by the following factors:
  −
  −
A complexity class is a set of problems of related complexity. Simpler complexity classes are defined by the following factors:
  −
  −
复杂性类是一组相关的复杂性问题。更简单的复杂类由以下因素定义:
  −
  −
* The type of computational problem: The most commonly used problems are decision problems. However, complexity classes can be defined based on [[function problem]]s, [[counting problem (complexity)|counting problem]]s, [[optimization problem]]s, [[promise problem]]s, etc.
  −
  −
  −
  −
* The model of computation: The most common model of computation is the deterministic Turing machine, but many complexity classes are based on non-deterministic Turing machines, [[Boolean circuit]]s, [[quantum Turing machine]]s, [[monotone circuit]]s, etc.
  −
  −
  −
  −
* The resource (or resources) that is being bounded and the bound: These two properties are usually stated together, such as "polynomial time", "logarithmic space", "constant depth", etc.
  −
  −
  −
  −
  −
  −
  −
  −
Some complexity classes have complicated definitions that do not fit into this framework. Thus, a typical complexity class has a definition like the following:
  −
  −
Some complexity classes have complicated definitions that do not fit into this framework. Thus, a typical complexity class has a definition like the following:
  −
  −
一些复杂性类的复杂定义不适合这个框架。因此,一个典型的复杂性类具有如下定义:
  −
  −
  −
  −
  −
  −
:The set of decision problems solvable by a deterministic Turing machine within time ''f''(''n''). (This complexity class is known as DTIME(''f''(''n'')).)
  −
  −
The set of decision problems solvable by a deterministic Turing machine within time f(n). (This complexity class is known as DTIME(f(n)).)
  −
  −
时间 f (n)内确定性图灵机可解决的一组决策问题。(这个复杂性类称为 DTIME (f (n))。)
  −
  −
  −
  −
  −
  −
But bounding the computation time above by some concrete function ''f''(''n'') often yields complexity classes that depend on the chosen machine model. For instance, the language {''xx'' | ''x'' is any binary string} can be solved in [[linear time]] on a multi-tape Turing machine, but necessarily requires quadratic time in the model of single-tape Turing machines. If we allow polynomial variations in running time, [[Cobham's thesis|Cobham-Edmonds thesis]] states that "the time complexities in any two reasonable and general models of computation are polynomially related" {{Harv|Goldreich|2008|loc=Chapter 1.2}}. This forms the basis for the complexity class [[P (complexity)|P]], which is the set of decision problems solvable by a deterministic Turing machine within polynomial time. The corresponding set of function problems is [[FP (complexity)|FP]].
  −
  −
But bounding the computation time above by some concrete function f(n) often yields complexity classes that depend on the chosen machine model. For instance, the language {xx | x is any binary string} can be solved in linear time on a multi-tape Turing machine, but necessarily requires quadratic time in the model of single-tape Turing machines. If we allow polynomial variations in running time, Cobham-Edmonds thesis states that "the time complexities in any two reasonable and general models of computation are polynomially related" . This forms the basis for the complexity class P, which is the set of decision problems solvable by a deterministic Turing machine within polynomial time. The corresponding set of function problems is FP.
  −
  −
但是通过一些具体的函数 f (n)来约束上面的计算时间通常会产生依赖于所选择的机器模型的复杂类。例如,语言{ xx | x 是任意二进制字符串}可以在多带图灵机上在线性时间内求解,但在单带图灵机模型中必须要求二次时间。如果我们允许运行时间的多项式变化,Cobham-Edmonds 理论指出,”任何两个合理的和一般的计算模型的时间复杂性是多项式相关的”。这就形成了复杂度等级 p 的基础,p 是一组决策问题,可以由确定性图灵机在多项式时间内解决。相应的一组函数问题是 FP。
  −
  −
  −
  −
  −
  −
===Important complexity classes===
  −
  −
===Important complexity classes===
  −
  −
重要的复杂性类
  −
  −
  −
  −
  −
  −
[[Image:Complexity subsets pspace.svg|thumb|right|A representation of the relation among complexity classes]]
  −
  −
A representation of the relation among complexity classes
  −
  −
复杂类之间关系的一种表示方法
  −
  −
Many important complexity classes can be defined by bounding the time or space used by the algorithm. Some important complexity classes of decision problems defined in this manner are the following:
  −
  −
Many important complexity classes can be defined by bounding the time or space used by the algorithm. Some important complexity classes of decision problems defined in this manner are the following:
  −
  −
许多重要的复杂度类可以通过限定算法使用的时间或空间来定义。以这种方式定义的决策问题的一些重要的复杂性类别如下:
  −
  −
{|
  −
  −
{|
  −
  −
{|
  −
  −
|-style="vertical-align:top;"
  −
  −
|-style="vertical-align:top;"
  −
  −
|-style“ vertical-align: top; ”
  −
  −
|
  −
  −
|
  −
  −
|
  −
  −
{| class="wikitable"
  −
  −
{| class="wikitable"
  −
  −
{ | class“ wikitable”
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
! Complexity class
  −
  −
! Complexity class
  −
  −
!复杂性类
  −
  −
! Model of computation
  −
  −
! Model of computation
  −
  −
!计算模式
  −
  −
! Resource constraint
  −
  −
! Resource constraint
  −
  −
!资源限制
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
! colspan="3" | Deterministic time
  −
  −
! colspan="3" | Deterministic time
  −
  −
!Colspan“3” | 确定时间
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
| [[DTIME]](''f''(''n''))
  −
  −
| DTIME(f(n))
  −
  −
| DTIME (f (n))
  −
  −
| Deterministic Turing machine
  −
  −
| Deterministic Turing machine
  −
  −
| 确定性图灵机
  −
  −
| Time O(''f''(''n''))
  −
  −
| Time O(f(n))
  −
  −
| 时间 o (f (n))
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
| &nbsp;
  −
  −
| &nbsp;
  −
  −
不会
  −
  −
| &nbsp;
  −
  −
| &nbsp;
  −
  −
不会
  −
  −
| &nbsp;
  −
  −
| &nbsp;
  −
  −
不会
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
| [[P (complexity)|P]]
  −
  −
| P
  −
  −
| p
  −
  −
| Deterministic Turing machine
  −
  −
| Deterministic Turing machine
  −
  −
| 确定性图灵机
  −
  −
| Time O(poly(''n''))
  −
  −
| Time O(poly(n))
  −
  −
| 时间 o (poly (n))
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
| [[EXPTIME]]
  −
  −
| EXPTIME
  −
  −
| EXPTIME
  −
  −
| Deterministic Turing machine
  −
  −
| Deterministic Turing machine
  −
  −
| 确定性图灵机
  −
  −
| Time O(2<sup>poly(''n'')</sup>)
  −
  −
| Time O(2<sup>poly(n)</sup>)
  −
  −
| 时间 o (2 sup poly (n) / sup)
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
! colspan="3" | Non-deterministic time
  −
  −
! colspan="3" | Non-deterministic time
  −
  −
!Colspan“3” | 非确定时间
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
| [[NTIME]](''f''(''n''))
  −
  −
| NTIME(f(n))
  −
  −
| NTIME (f (n))
  −
  −
| Non-deterministic Turing machine
  −
  −
| Non-deterministic Turing machine
  −
  −
非确定型图灵机
  −
  −
| Time O(''f''(''n''))
  −
  −
| Time O(f(n))
  −
  −
| 时间 o (f (n))
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
| &nbsp;
  −
  −
| &nbsp;
  −
  −
不会
  −
  −
| &nbsp;
  −
  −
| &nbsp;
  −
  −
不会
  −
  −
| &nbsp;
  −
  −
| &nbsp;
  −
  −
不会
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
| [[NP (complexity)|NP]]
  −
  −
| NP
  −
  −
| NP
  −
  −
| Non-deterministic Turing machine
  −
  −
| Non-deterministic Turing machine
  −
  −
非确定型图灵机
  −
  −
| Time O(poly(''n''))
  −
  −
| Time O(poly(n))
  −
  −
| 时间 o (poly (n))
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
| [[NEXPTIME]]
  −
  −
| NEXPTIME
  −
  −
| NEXPTIME
  −
  −
| Non-deterministic Turing machine
  −
  −
| Non-deterministic Turing machine
  −
  −
非确定型图灵机
  −
  −
| Time O(2<sup>poly(''n'')</sup>)
  −
  −
| Time O(2<sup>poly(n)</sup>)
  −
  −
| 时间 o (2 sup poly (n) / sup)
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
|}
  −
  −
|}
  −
  −
|}
  −
  −
|
  −
  −
|
  −
  −
|
  −
  −
{| class="wikitable"
  −
  −
{| class="wikitable"
  −
  −
{ | class“ wikitable”
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
  −
  −
  −
  −
! Complexity class
  −
  −
! Complexity class
  −
  −
!复杂性类
  −
  −
  −
  −
  −
  −
! Model of computation
  −
  −
! Model of computation
  −
  −
!计算模式
  −
  −
  −
  −
  −
  −
! Resource constraint
  −
  −
! Resource constraint
  −
  −
!资源限制
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
! colspan="3" | Deterministic space
  −
  −
! colspan="3" | Deterministic space
  −
  −
!Colspan“3” | 确定性空间
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
| [[DSPACE]](''f''(''n''))
  −
  −
| DSPACE(f(n))
  −
  −
| DSPACE (f (n))
  −
  −
| Deterministic Turing machine
  −
  −
| Deterministic Turing machine
  −
  −
| 确定性图灵机
  −
  −
| Space O(''f''(''n''))
  −
  −
| Space O(f(n))
  −
  −
| 空间 o (f (n))
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
| [[L (complexity)|L]]
  −
  −
| L
  −
  −
| l
  −
  −
| Deterministic Turing machine
  −
  −
| Deterministic Turing machine
  −
  −
| 确定性图灵机
  −
  −
| Space O(log ''n'')
  −
  −
| Space O(log n)
  −
  −
| 空格 o (log n)
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
| [[PSPACE]]
  −
  −
| PSPACE
  −
  −
| PSPACE
  −
  −
| Deterministic Turing machine
  −
  −
| Deterministic Turing machine
  −
  −
| 确定性图灵机
  −
  −
| Space O(poly(''n''))
  −
  −
| Space O(poly(n))
  −
  −
| 空间 o (poly (n))
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
| [[EXPSPACE]]
  −
  −
| EXPSPACE
  −
  −
| EXPSPACE
  −
  −
| Deterministic Turing machine
  −
  −
| Deterministic Turing machine
  −
  −
| 确定性图灵机
  −
  −
| Space O(2<sup>poly(''n'')</sup>)
  −
  −
| Space O(2<sup>poly(n)</sup>)
  −
  −
| 空间 o (2 sup poly (n) / sup)
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
! colspan="3" | Non-deterministic space
  −
  −
! colspan="3" | Non-deterministic space
  −
  −
!Colspan“3” | 非确定性空间
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
| [[NSPACE]](''f''(''n''))
  −
  −
| NSPACE(f(n))
  −
  −
| NSPACE (f (n))
  −
  −
| Non-deterministic Turing machine
  −
  −
| Non-deterministic Turing machine
  −
  −
非确定型图灵机
  −
  −
| Space O(''f''(''n''))
  −
  −
| Space O(f(n))
  −
  −
| 空间 o (f (n))
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
| [[NL (complexity)|NL]]
  −
  −
| NL
  −
  −
| NL
  −
  −
| Non-deterministic Turing machine
  −
  −
| Non-deterministic Turing machine
  −
  −
非确定型图灵机
  −
  −
| Space O(log ''n'')
  −
  −
| Space O(log n)
  −
  −
| 空格 o (log n)
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
| [[NPSPACE]]
  −
  −
| NPSPACE
  −
  −
| NPSPACE
  −
  −
| Non-deterministic Turing machine
  −
  −
| Non-deterministic Turing machine
  −
  −
非确定型图灵机
  −
  −
| Space O(poly(''n''))
  −
  −
| Space O(poly(n))
  −
  −
| 空间 o (poly (n))
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
| [[NEXPSPACE]]
  −
  −
| NEXPSPACE
  −
  −
| NEXPSPACE
  −
  −
| Non-deterministic Turing machine
  −
  −
| Non-deterministic Turing machine
  −
  −
非确定型图灵机
  −
  −
| Space O(2<sup>poly(''n'')</sup>)
  −
  −
| Space O(2<sup>poly(n)</sup>)
  −
  −
| 空间 o (2 sup poly (n) / sup)
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
|}
  −
  −
|}
  −
  −
|}
  −
  −
|-
  −
  −
|-
  −
  −
|-
  −
  −
|}
  −
  −
|}
  −
  −
|}
  −
  −
  −
  −
  −
  −
The logarithmic-space classes (necessarily) do not take into account the space needed to represent the problem.
  −
  −
The logarithmic-space classes (necessarily) do not take into account the space needed to represent the problem.
  −
  −
对数空间类(必须)没有考虑表示问题所需的空间。
  −
  −
  −
  −
  −
  −
It turns out that PSPACE = NPSPACE and EXPSPACE = NEXPSPACE by [[Savitch's theorem]].
  −
  −
It turns out that PSPACE = NPSPACE and EXPSPACE = NEXPSPACE by Savitch's theorem.
  −
  −
利用 Savitch 定理证明了 PSPACE NPSPACE 和 EXPSPACE NEXPSPACE。
  −
  −
  −
  −
  −
  −
Other important complexity classes include [[BPP (complexity)|BPP]], [[ZPP (complexity)|ZPP]] and [[RP (complexity)|RP]], which are defined using [[probabilistic Turing machine]]s; [[AC (complexity)|AC]] and [[NC (complexity)|NC]], which are defined using Boolean circuits; and [[BQP]] and [[QMA]], which are defined using quantum Turing machines. [[Sharp-P|#P]] is an important complexity class of counting problems (not decision problems). Classes like [[IP (complexity)|IP]] and [[AM (complexity)|AM]] are defined using [[Interactive proof system]]s. [[ALL (complexity)|ALL]] is the class of all decision problems.
  −
  −
Other important complexity classes include BPP, ZPP and RP, which are defined using probabilistic Turing machines; AC and NC, which are defined using Boolean circuits; and BQP and QMA, which are defined using quantum Turing machines. #P is an important complexity class of counting problems (not decision problems). Classes like IP and AM are defined using Interactive proof systems. ALL is the class of all decision problems.
  −
  −
其他重要的复杂性类包括 BPP、 ZPP 和 RP,它们使用概率图灵机定义; AC 和 NC,它们使用布尔电路定义; BQP 和 QMA,它们使用量子图灵机定义。# p 是计数问题(不是决策问题)的一个重要的复杂类。类如 IP 和 AM 使用交互式证明系统定义。All 是所有决策问题的类别。
  −
  −
  −
  −
  −
  −
===Hierarchy theorems===
  −
  −
===Hierarchy theorems===
  −
  −
层次定理
  −
  −
{{main|time hierarchy theorem|space hierarchy theorem}}
  −
  −
  −
  −
For the complexity classes defined in this way, it is desirable to prove that relaxing the requirements on (say) computation time indeed defines a bigger set of problems. In particular, although DTIME(''n'') is contained in DTIME(''n''<sup>2</sup>), it would be interesting to know if the inclusion is strict. For time and space requirements, the answer to such questions is given by the time and space hierarchy theorems respectively. They are called hierarchy theorems because they induce a proper hierarchy on the classes defined by constraining the respective resources. Thus there are pairs of complexity classes such that one is properly included in the other. Having deduced such proper set inclusions, we can proceed to make quantitative statements about how much more additional time or space is needed in order to increase the number of problems that can be solved.
  −
  −
For the complexity classes defined in this way, it is desirable to prove that relaxing the requirements on (say) computation time indeed defines a bigger set of problems. In particular, although DTIME(n) is contained in DTIME(n<sup>2</sup>), it would be interesting to know if the inclusion is strict. For time and space requirements, the answer to such questions is given by the time and space hierarchy theorems respectively. They are called hierarchy theorems because they induce a proper hierarchy on the classes defined by constraining the respective resources. Thus there are pairs of complexity classes such that one is properly included in the other. Having deduced such proper set inclusions, we can proceed to make quantitative statements about how much more additional time or space is needed in order to increase the number of problems that can be solved.
  −
  −
对于以这种方式定义的复杂类,我们希望证明放宽对计算时间的要求确实定义了更多的问题。特别是,虽然 DTIME (n)包含在 DTIME (n sup 2 / sup)中,但是了解包含是否严格是很有意义的。对于时间和空间要求,分别用时间和空间层次定理给出了这些问题的答案。它们之所以被称为层次定理,是因为它们通过约束各自的资源,在定义的类上诱导出一个适当的层次结构。因此,存在成对的复杂类,这样一个复杂类可以被正确地包含在另一个复杂类中。已经推导出这种适当的集合包含,我们可以着手进行定量陈述,说明需要多少额外的时间或空间,以增加可以解决的问题的数量。
  −
  −
  −
  −
  −
  −
More precisely, the [[time hierarchy theorem]] states that
  −
  −
More precisely, the time hierarchy theorem states that
  −
  −
更准确地说,时间谱系理论声称
  −
  −
:<math>\mathsf{DTIME}\big(f(n) \big) \subsetneq \mathsf{DTIME} \big(f(n) \sdot \log^{2}(f(n)) \big)</math>.
  −
  −
<math>\mathsf{DTIME}\big(f(n) \big) \subsetneq \mathsf{DTIME} \big(f(n) \sdot \log^{2}(f(n)) \big)</math>.
  −
  −
数学{ DTIME } big (f (n) big) subsetneq  mathsf { DTIME } big (f (n) sdot  log ^ {2}(f (n)) big) / math。
  −
  −
  −
  −
  −
  −
The [[space hierarchy theorem]] states that
  −
  −
The space hierarchy theorem states that
  −
  −
空间层次定理指出
  −
  −
:<math>\mathsf{DSPACE}\big(f(n)\big) \subsetneq \mathsf{DSPACE} \big(f(n) \sdot \log(f(n)) \big)</math>.
  −
  −
<math>\mathsf{DSPACE}\big(f(n)\big) \subsetneq \mathsf{DSPACE} \big(f(n) \sdot \log(f(n)) \big)</math>.
  −
  −
数学 mathsf { DSPACE } big (f (n) big) subsetneq  mathsf { DSPACE } big (f (n) sdot  log (f (n)) big) / math。
  −
  −
  −
  −
  −
  −
The time and space hierarchy theorems form the basis for most separation results of complexity classes. For instance, the time hierarchy theorem tells us that P is strictly contained in EXPTIME, and the space hierarchy theorem tells us that L is strictly contained in PSPACE.
  −
  −
The time and space hierarchy theorems form the basis for most separation results of complexity classes. For instance, the time hierarchy theorem tells us that P is strictly contained in EXPTIME, and the space hierarchy theorem tells us that L is strictly contained in PSPACE.
  −
  −
时间和空间层次定理构成了复杂类大多数分离结果的基础。例如,时间谱系理论告诉我们 p 严格包含在 EXPTIME,而空间层次定理告诉我们 l 严格包含在 PSPACE。
  −
  −
  −
  −
  −
  −
===Reduction===
  −
  −
===Reduction===
  −
  −
减少
  −
  −
{{main|Reduction (complexity)}}
  −
  −
  −
  −
Many complexity classes are defined using the concept of a reduction. A reduction is a transformation of one problem into another problem. It captures the informal notion of a problem being at most as difficult as another problem. For instance, if a problem ''X'' can be solved using an algorithm for ''Y'', ''X'' is no more difficult than ''Y'', and we say that ''X'' ''reduces'' to ''Y''. There are many different types of reductions, based on the method of reduction, such as Cook reductions, Karp reductions and Levin reductions, and the bound on the complexity of reductions, such as [[polynomial-time reduction]]s or [[log-space reduction]]s.
  −
  −
Many complexity classes are defined using the concept of a reduction. A reduction is a transformation of one problem into another problem. It captures the informal notion of a problem being at most as difficult as another problem. For instance, if a problem X can be solved using an algorithm for Y, X is no more difficult than Y, and we say that X reduces to Y. There are many different types of reductions, based on the method of reduction, such as Cook reductions, Karp reductions and Levin reductions, and the bound on the complexity of reductions, such as polynomial-time reductions or log-space reductions.
  −
  −
许多复杂性类是使用约简的概念来定义的。化简是将一个问题转化为另一个问题。它抓住了一个非正式的概念,即一个问题最多和另一个问题一样困难。例如,如果一个问题 x 可以用 y 的算法来解决,那么 x 并不比 y 困难,我们说 x 减少为 y。根据约化方法,约化有多种类型,如 Cook 约化、 Karp 约化和 Levin 约化,以及约化复杂度的界限,如多项式时间约化或对数空间约化。
  −
  −
  −
  −
  −
  −
The most commonly used reduction is a polynomial-time reduction. This means that the reduction process takes polynomial time. For example, the problem of squaring an integer can be reduced to the problem of multiplying two integers. This means an algorithm for multiplying two integers can be used to square an integer. Indeed, this can be done by giving the same input to both inputs of the multiplication algorithm. Thus we see that squaring is not more difficult than multiplication, since squaring can be reduced to multiplication.
  −
  −
The most commonly used reduction is a polynomial-time reduction. This means that the reduction process takes polynomial time. For example, the problem of squaring an integer can be reduced to the problem of multiplying two integers. This means an algorithm for multiplying two integers can be used to square an integer. Indeed, this can be done by giving the same input to both inputs of the multiplication algorithm. Thus we see that squaring is not more difficult than multiplication, since squaring can be reduced to multiplication.
  −
  −
最常用的还原方法是多项式时间图灵归约。这意味着还原过程需要多项式时间。例如,平方一个整数的问题可以简化为两个整数相乘的问题。这意味着两个整数相乘的算法可以用来平方一个整数。实际上,这可以通过给乘法算法的两个输入提供相同的输入来实现。因此,我们看到平方运算并不比乘法运算困难,因为平方运算可以简化为乘法运算。
  −
  −
  −
  −
  −
  −
This motivates the concept of a problem being hard for a complexity class. A problem ''X'' is ''hard'' for a class of problems ''C'' if every problem in ''C'' can be reduced to ''X''. Thus no problem in ''C'' is harder than ''X'', since an algorithm for ''X'' allows us to solve any problem in ''C''. The notion of hard problems depends on the type of reduction being used. For complexity classes larger than P, polynomial-time reductions are commonly used. In particular, the set of problems that are hard for NP is the set of [[NP-hard]] problems.
  −
  −
This motivates the concept of a problem being hard for a complexity class. A problem X is hard for a class of problems C if every problem in C can be reduced to X. Thus no problem in C is harder than X, since an algorithm for X allows us to solve any problem in C. The notion of hard problems depends on the type of reduction being used. For complexity classes larger than P, polynomial-time reductions are commonly used. In particular, the set of problems that are hard for NP is the set of NP-hard problems.
  −
  −
这激发了问题对于复杂性类来说很难的概念。如果 c 中的所有问题都可以简化为 x,那么问题 x 对于一类问题 c 来说是很困难的。因此 c 语言中没有比 x 更难的问题,因为 x 的算法允许我们在 c 语言中解决任何问题。 难题的概念取决于所用的还原类型。对于大于 p 的复杂类,通常采用多项式时间约简。特别是对于 NP 难的问题集是 NP 难问题集。
  −
  −
  −
  −
  −
  −
If a problem ''X'' is in ''C'' and hard for ''C'', then ''X'' is said to be ''[[complete (complexity)|complete]]'' for ''C''. This means that ''X'' is the hardest problem in ''C''. (Since many problems could be equally hard, one might say that ''X'' is one of the hardest problems in ''C''.) Thus the class of [[NP-complete]] problems contains the most difficult problems in NP, in the sense that they are the ones most likely not to be in P. Because the problem P&nbsp;=&nbsp;NP is not solved, being able to reduce a known NP-complete problem, Π<sub>2</sub>, to another problem, Π<sub>1</sub>, would indicate that there is no known polynomial-time solution for Π<sub>1</sub>. This is because a polynomial-time solution to Π<sub>1</sub> would yield a polynomial-time solution to Π<sub>2</sub>. Similarly, because all NP problems can be reduced to the set, finding an [[NP-complete]] problem that can be solved in polynomial time would mean that P&nbsp;=&nbsp;NP.<ref name="Sipser2006"/>
  −
  −
If a problem X is in C and hard for C, then X is said to be complete for C. This means that X is the hardest problem in C. (Since many problems could be equally hard, one might say that X is one of the hardest problems in C.) Thus the class of NP-complete problems contains the most difficult problems in NP, in the sense that they are the ones most likely not to be in P. Because the problem P&nbsp;=&nbsp;NP is not solved, being able to reduce a known NP-complete problem, Π<sub>2</sub>, to another problem, Π<sub>1</sub>, would indicate that there is no known polynomial-time solution for Π<sub>1</sub>. This is because a polynomial-time solution to Π<sub>1</sub> would yield a polynomial-time solution to Π<sub>2</sub>. Similarly, because all NP problems can be reduced to the set, finding an NP-complete problem that can be solved in polynomial time would mean that P&nbsp;=&nbsp;NP.
  −
  −
如果一个问题 x 在 c 中很难解决,那么 x 对 c 来说就是完整的。 这意味着 x 是 c 中最难的问题(因为许多问题可能同样难,有人可能会说 x 是 c 中最难的问题之一)因此 NP 完全问题包含了 NP 中最难的问题,也就是说它们是 p 中最不可能出现的问题。因为 p NP 问题没有解决,能够将一个已知的 NP 完全问题,sub 2 / sub,转化为另一个问题 sub 1 / sub,就意味着对 sub 1 / sub 没有已知的多项式时间解。这是因为子1 / 子的多项式时间解将产生子2 / 子的多项式时间解。类似地,由于所有 NP 问题都可以归结为一个集合,所以找到一个 NP 完全问题可以在多项式时间内求解就意味着 p NP。
  −
  −
  −
  −
  −
  −
==Important open problems==
  −
  −
==Important open problems==
  −
  −
重要的开放性问题
  −
  −
[[Image:Complexity classes.svg|thumb|Diagram of complexity classes provided that P&nbsp;≠&nbsp;NP. The existence of problems in NP outside both P and NP-complete in this case was established by Ladner.<ref name="Ladner75">{{Citation|last=Ladner|first=Richard E.|title=On the structure of polynomial time reducibility|journal=[[Journal of the ACM]] |volume=22|year=1975|pages=151–171|doi=10.1145/321864.321877|issue=1|postscript=.}}</ref>]]
  −
  −
Diagram of complexity classes provided that P&nbsp;≠&nbsp;NP. The existence of problems in NP outside both P and NP-complete in this case was established by Ladner.
  −
  −
在 p ≠ NP 的情况下,复杂性类的图表。在这种情况下,p 和 NP 完全以外的 NP 问题的存在性是由拉德纳建立的。
  −
  −
  −
  −
  −
  −
===P versus NP problem===
  −
  −
===P versus NP problem===
  −
  −
P/NP问题
  −
  −
{{Main|P versus NP problem}}
  −
  −
  −
  −
  −
  −
  −
  −
The complexity class P is often seen as a mathematical abstraction modeling those computational tasks that admit an efficient algorithm. This hypothesis is called the [[Cobham–Edmonds thesis]]. The complexity class [[NP (complexity)|NP]], on the other hand, contains many problems that people would like to solve efficiently, but for which no efficient algorithm is known, such as the [[Boolean satisfiability problem]], the [[Hamiltonian path problem]] and the [[vertex cover problem]]. Since deterministic Turing machines are special non-deterministic Turing machines, it is easily observed that each problem in P is also member of the class NP.
  −
  −
The complexity class P is often seen as a mathematical abstraction modeling those computational tasks that admit an efficient algorithm. This hypothesis is called the Cobham–Edmonds thesis. The complexity class NP, on the other hand, contains many problems that people would like to solve efficiently, but for which no efficient algorithm is known, such as the Boolean satisfiability problem, the Hamiltonian path problem and the vertex cover problem. Since deterministic Turing machines are special non-deterministic Turing machines, it is easily observed that each problem in P is also member of the class NP.
  −
  −
复杂性类 p 通常被看作是一个数学抽象,为那些需要高效算法的计算任务建模。这一假设被称为“科布姆-埃德蒙兹论点”。另一方面,复杂类 NP 包含了许多人们想要高效率解决的问题,但是对于这些问题却没有一个有效的算法,比如布尔可满足性问题、哈密顿路径问题和覆盖。由于确定性图灵机是一种特殊的非确定性图灵机,很容易观察到 p 中的每个问题都是 NP 类的成员。
  −
  −
  −
  −
  −
  −
The question of whether P equals NP is one of the most important open questions in theoretical computer science because of the wide implications of a solution.<ref name="Sipser2006">See {{harvnb|Sipser|2006|loc= Chapter 7: Time complexity}}</ref> If the answer is yes, many important problems can be shown to have more efficient solutions. These include various types of [[integer programming]] problems in [[operations research]], many problems in [[logistics]], [[protein structure prediction]] in [[biology]],<ref>{{Citation|title=Protein folding in the hydrophobic-hydrophilic (HP) model is NP-complete|last=Berger|first=Bonnie A.|author1-link=Bonnie Berger|journal=Journal of Computational Biology|year=1998|volume=5|pages=27–40|pmid=9541869|doi=10.1089/cmb.1998.5.27|last2=Leighton|first2=T|author2-link=F. Thomson Leighton|issue=1|postscript=. |citeseerx=10.1.1.139.5547}}</ref> and the ability to find formal proofs of [[pure mathematics]] theorems.<ref>{{Citation|last=Cook|first=Stephen|authorlink=Stephen Cook|title=The P versus NP Problem|publisher=[[Clay Mathematics Institute]]|date=April 2000|url=http://www.claymath.org/millennium/P_vs_NP/Official_Problem_Description.pdf|accessdate=2006-10-18|postscript=.|url-status=dead|archiveurl=https://web.archive.org/web/20101212035424/http://www.claymath.org/millennium/P_vs_NP/Official_Problem_Description.pdf|archivedate=December 12, 2010|df=mdy-all}}</ref> The P versus NP problem is one of the [[Millennium Prize Problems]] proposed by the [[Clay Mathematics Institute]]. There is a US$1,000,000 prize for resolving the problem.<ref>{{Citation|title=The Millennium Grand Challenge in Mathematics|last=Jaffe|first=Arthur M.|authorlink=Arthur Jaffe|year=2006|journal=Notices of the AMS|volume=53|issue=6|url=http://www.ams.org/notices/200606/fea-jaffe.pdf|accessdate=2006-10-18|postscript=.}}</ref>
  −
  −
The question of whether P equals NP is one of the most important open questions in theoretical computer science because of the wide implications of a solution. If the answer is yes, many important problems can be shown to have more efficient solutions. These include various types of integer programming problems in operations research, many problems in logistics, protein structure prediction in biology, and the ability to find formal proofs of pure mathematics theorems. The P versus NP problem is one of the Millennium Prize Problems proposed by the Clay Mathematics Institute. There is a US$1,000,000 prize for resolving the problem.
  −
  −
P 是否等于 NP 的问题是理论计算机科学中最重要的开放性问题之一,因为其解的广泛意义。如果答案是肯定的,那么许多重要的问题就可以得到更有效的解决方案。这些问题包括运筹学中的各种类型的整数规划问题,物流学中的许多问题,生物学中的蛋白质结构预测,以及找到纯数学定理的正式证明的能力。美国 P/NP问题协会是由美国千禧年大奖难题克雷数学研究所提出的一个建议。为了解决这个问题,有一个100万美元的奖金。
  −
  −
  −
  −
  −
  −
===Problems in NP not known to be in P or NP-complete===
  −
  −
===Problems in NP not known to be in P or NP-complete===
  −
  −
未知 p 或 NP 完全的 NP 问题
  −
  −
It was shown by Ladner that if '''P''' ≠ '''NP''' then there exist problems in '''NP''' that are neither in '''P''' nor '''NP-complete'''.<ref name="Ladner75" /> Such problems are called [[NP-intermediate]] problems. The [[graph isomorphism problem]], the [[discrete logarithm problem]] and the [[integer factorization problem]] are examples of problems believed to be NP-intermediate. They are some of the very few NP problems not known to be in '''P''' or to be '''NP-complete'''.
  −
  −
It was shown by Ladner that if P ≠ NP then there exist problems in NP that are neither in P nor NP-complete. Such problems are called NP-intermediate problems. The graph isomorphism problem, the discrete logarithm problem and the integer factorization problem are examples of problems believed to be NP-intermediate. They are some of the very few NP problems not known to be in P or to be NP-complete.
  −
  −
Ladner 指出,如果 p 不等于 NP,那么在 NP 中就存在既不是 p 也不是 NP 完全的问题。这类问题称为 np 中间问题。图同构问题、离散对数问题和整数分解问题就是被认为是 np 中间问题的例子。它们是少数几个不在 p 中或不在 NP 完全的 NP 问题中的一些。
  −
  −
  −
  −
  −
  −
The [[graph isomorphism problem]] is the computational problem of determining whether two finite [[graph (discrete mathematics)|graph]]s are [[graph isomorphism|isomorphic]]. An important unsolved problem in complexity theory is whether the graph isomorphism problem is in '''P''', '''NP-complete''', or NP-intermediate. The answer is not known, but it is believed that the problem is at least not NP-complete.<ref name="AK06">{{Citation
  −
  −
The graph isomorphism problem is the computational problem of determining whether two finite graphs are isomorphic. An important unsolved problem in complexity theory is whether the graph isomorphism problem is in P, NP-complete, or NP-intermediate. The answer is not known, but it is believed that the problem is at least not NP-complete.<ref name="AK06">{{Citation
  −
  −
图同构问题是判定两个有限图是否同构的计算问题。复杂性理论中一个尚未解决的重要问题是图的同构问题是在 p、 np 完全还是 np 中间。答案不得而知,但是相信这个问题至少不是 np 完全的,参考名字“ ak06”{ Citation
  −
  −
| first1 = Vikraman
  −
  −
| first1 = Vikraman
  −
  −
| first1 = Vikraman
  −
  −
| last1 = Arvind
  −
  −
| last1 = Arvind
  −
  −
最后1个 Arvind
  −
  −
| first2 = Piyush P.
  −
  −
| first2 = Piyush P.
  −
  −
| first2 Piyush p.
  −
  −
| last2 = Kurur
  −
  −
| last2 = Kurur
  −
  −
2 Kurur
  −
  −
| title = Graph isomorphism is in SPP
  −
  −
| title = Graph isomorphism is in SPP
  −
  −
图同构在 SPP 中
  −
  −
| journal = Information and Computation
  −
  −
| journal = Information and Computation
  −
  −
期刊信息与计算
  −
  −
| volume = 204
  −
  −
| volume = 204
  −
  −
第204卷
  −
  −
| issue = 5
  −
  −
| issue = 5
  −
  −
第五期
  −
  −
| year = 2006
  −
  −
| year = 2006
  −
  −
2006年
  −
  −
| pages = 835–852
  −
  −
| pages = 835–852
  −
  −
第835-852页
  −
  −
| doi = 10.1016/j.ic.2006.02.002
  −
  −
| doi = 10.1016/j.ic.2006.02.002
  −
  −
10.1016 / j.ic. 2006.02.002
  −
  −
| postscript = .| doi-access = free
  −
  −
| postscript = .| doi-access = free
  −
  −
后记,免费访问
  −
  −
}}</ref> If graph isomorphism is NP-complete, the [[polynomial time hierarchy]] collapses to its second level.<ref>{{cite book | last1 = Schöning | first1 = Uwe | authorlink = Uwe Schöning | title = Graph isomorphism is in the low hierarchy | url = | journal = Proceedings of the 4th Annual Symposium on Theoretical Aspects of Computer Science | volume = 1987 | issue = | pages = 114–124 | doi=10.1007/bfb0039599| series = Lecture Notes in Computer Science | year = 1987 | isbn = 978-3-540-17219-2 }}</ref> Since it is widely believed that the polynomial hierarchy does not collapse to any finite level, it is believed that graph isomorphism is not NP-complete. The best algorithm for this problem, due to [[László Babai]] and [[Eugene Luks]] has run time <math>O(2^{\sqrt{n \log n}})</math> for graphs with ''n'' vertices, although some recent work by Babai offers some potentially new perspectives on this.<ref>{{cite arXiv |last=Babai |first=László |date=2016 |title=Graph Isomorphism in Quasipolynomial Time |eprint=1512.03547 |class=cs.DS }}</ref>
  −
  −
}}</ref> If graph isomorphism is NP-complete, the polynomial time hierarchy collapses to its second level. Since it is widely believed that the polynomial hierarchy does not collapse to any finite level, it is believed that graph isomorphism is not NP-complete. The best algorithm for this problem, due to László Babai and Eugene Luks has run time <math>O(2^{\sqrt{n \log n}})</math> for graphs with n vertices, although some recent work by Babai offers some potentially new perspectives on this.
  −
  −
如果图的同构是 np- 完全的,多项式时间层次结构折叠到它的第二个层次。由于人们普遍认为 PH 不会塌缩到任何有限的水平,因此人们认为图的同构不是 np 完全的。这个问题最好的算法,归功于 László Babai 和 Eugene Luks 对于 n 顶点图的运行时数学 o (2 ^ sqrt n  log n }) / math,尽管 Babai 最近的一些工作在这方面提供了一些潜在的新观点。
  −
  −
  −
  −
  −
  −
The [[integer factorization problem]] is the computational problem of determining the [[prime factorization]] of a given integer. Phrased as a decision problem, it is the problem of deciding whether the input has a prime factor less than ''k''. No efficient integer factorization algorithm is known, and this fact forms the basis of several modern cryptographic systems, such as the [[RSA (algorithm)|RSA]] algorithm. The integer factorization problem is in '''NP''' and in '''co-NP''' (and even in UP and co-UP<ref>[[Lance Fortnow]]. Computational Complexity Blog: Complexity Class of the Week: Factoring. September 13, 2002. http://weblog.fortnow.com/2002/09/complexity-class-of-week-factoring.html</ref>). If the problem is '''NP-complete''', the polynomial time hierarchy will collapse to its first level (i.e., '''NP''' will equal '''co-NP'''). The best known algorithm for integer factorization is the [[general number field sieve]], which takes time <math>O(e^{\left(\sqrt[3]{\frac{64}{9}}\right)\sqrt[3]{(\log n)}\sqrt[3]{(\log \log n)^2}})</math><ref>Wolfram MathWorld: [http://mathworld.wolfram.com/NumberFieldSieve.html Number Field Sieve]</ref> to factor an odd integer ''n''. However, the best known [[quantum algorithm]] for this problem, [[Shor's algorithm]], does run in polynomial time. Unfortunately, this fact doesn't say much about where the problem lies with respect to non-quantum complexity classes.
  −
  −
The integer factorization problem is the computational problem of determining the prime factorization of a given integer. Phrased as a decision problem, it is the problem of deciding whether the input has a prime factor less than k. No efficient integer factorization algorithm is known, and this fact forms the basis of several modern cryptographic systems, such as the RSA algorithm. The integer factorization problem is in NP and in co-NP (and even in UP and co-UP). If the problem is NP-complete, the polynomial time hierarchy will collapse to its first level (i.e., NP will equal co-NP). The best known algorithm for integer factorization is the general number field sieve, which takes time <math>O(e^{\left(\sqrt[3]{\frac{64}{9}}\right)\sqrt[3]{(\log n)}\sqrt[3]{(\log \log n)^2}})</math> to factor an odd integer n. However, the best known quantum algorithm for this problem, Shor's algorithm, does run in polynomial time. Unfortunately, this fact doesn't say much about where the problem lies with respect to non-quantum complexity classes.
  −
  −
整数分解问题是确定一个给定整数的计算问题整数分解。这个问题被称为决策问题,是决定输入是否有一个素因子小于 k 的问题没有一个有效的整数分解算法是已知的,这个事实形成了一些现代密码系统的基础,比如 RSA 算法。整数分解问题是 NP 和 co-NP (甚至是 UP 和 co-UP)的问题。如果问题是 NP 完全的,多项式时间层次将崩溃到它的第一个层次(即,NP 将等于 co-NP)。整数分解最著名的算法是普通数域筛选法算法,它使用时间算法 o (e ^ { left ( sqrt [3]{ frac {64}{9}{右) sqrt [3]{(log n)}} sqrt [3]{((log log  log n) ^ 2}) / 算出奇数 n。然而,这个问题最著名的量子算法,Shor 的算法,运行在多项式时间内。不幸的是,这个事实并没有说明问题出在哪里,关于非量子复杂性类。
  −
  −
  −
  −
  −
  −
===Separations between other complexity classes===
  −
  −
===Separations between other complexity classes===
  −
  −
其他复杂类之间的分离
  −
  −
Many known complexity classes are suspected to be unequal, but this has not been proved. For instance '''P''' ⊆ '''NP''' ⊆ '''[[PP (complexity)|PP]]''' ⊆ '''PSPACE''', but it is possible that '''P''' = '''PSPACE'''. If '''P''' is not equal to '''NP''', then '''P''' is not equal to '''PSPACE''' either. Since there are many known complexity classes between '''P''' and '''PSPACE''', such as '''RP''', '''BPP''', '''PP''', '''BQP''', '''MA''', '''PH''', etc., it is possible that all these complexity classes collapse to one class. Proving that any of these classes are unequal would be a major breakthrough in complexity theory.
  −
  −
Many known complexity classes are suspected to be unequal, but this has not been proved. For instance P ⊆ NP ⊆ PP ⊆ PSPACE, but it is possible that P = PSPACE. If P is not equal to NP, then P is not equal to PSPACE either. Since there are many known complexity classes between P and PSPACE, such as RP, BPP, PP, BQP, MA, PH, etc., it is possible that all these complexity classes collapse to one class. Proving that any of these classes are unequal would be a major breakthrough in complexity theory.
  −
  −
许多已知的复杂类被怀疑是不平等的,但是这还没有被证明。例如 p something NP something PP something PSPACE,但 p PSPACE 可能。如果 p 不等于 NP,则 p 也不等于 PSPACE。由于 p 和 PSPACE 之间存在许多已知的复杂类,如 RP、 BPP、 PP、 BQP、 MA、 PH 等,所有这些复杂类都可能坍缩成一个类。证明这些等级中的任何一个都是不平等的,将是复杂性理论的一个重大突破。
  −
  −
  −
  −
  −
  −
Along the same lines, '''[[co-NP]]''' is the class containing the [[Complement (complexity)|complement]] problems (i.e. problems with the ''yes''/''no'' answers reversed) of '''NP''' problems. It is believed<ref>[http://www.cs.princeton.edu/courses/archive/spr06/cos522/ Boaz Barak's course on Computational Complexity] [http://www.cs.princeton.edu/courses/archive/spr06/cos522/lec2.pdf Lecture 2]</ref> that '''NP''' is not equal to '''co-NP'''; however, it has not yet been proven. It is clear that if these two complexity classes are not equal then '''P''' is not equal to '''NP''', since '''P'''='''co-P'''.  Thus if '''P'''='''NP''' we would have '''co-P'''='''co-NP''' whence '''NP'''='''P'''='''co-P'''='''co-NP'''.
  −
  −
Along the same lines, co-NP is the class containing the complement problems (i.e. problems with the yes/no answers reversed) of NP problems. It is believed that NP is not equal to co-NP; however, it has not yet been proven. It is clear that if these two complexity classes are not equal then P is not equal to NP, since P=co-P.  Thus if P=NP we would have co-P=co-NP whence NP=P=co-P=co-NP.
  −
  −
同样地,co-NP 也是包含补语问题的类(例如:。问题的是 / 否回答颠倒)的 NP 问题。人们普遍认为,NP 并不等同于共 NP,然而,它还没有得到证实。很明显,如果这两个复杂性类不相等,那么 p 就不等于 NP,因为 p 是 co-P。因此,如果是 p NP,那么我们就可以得到与 p 有关的 p-p-p 共同 NP。
  −
  −
  −
  −
  −
  −
Similarly, it is not known if '''L''' (the set of all problems that can be solved in logarithmic space) is strictly contained in '''P''' or equal to '''P'''. Again, there are many complexity classes between the two, such as '''NL''' and '''NC''', and it is not known if they are distinct or equal classes.
  −
  −
Similarly, it is not known if L (the set of all problems that can be solved in logarithmic space) is strictly contained in P or equal to P. Again, there are many complexity classes between the two, such as NL and NC, and it is not known if they are distinct or equal classes.
  −
  −
同样,l (所有可以在对数空间中解决的问题的集合)是否严格包含在 p 中或等于 p。同样,在两者之间有许多复杂类,如 NL 和 NC,它们是不同的还是相等的类。
  −
  −
  −
  −
  −
  −
It is suspected that '''P''' and '''BPP''' are equal. However, it is currently open if '''BPP''' = '''NEXP'''.
  −
  −
It is suspected that P and BPP are equal. However, it is currently open if BPP = NEXP.
  −
  −
人们怀疑 p 和 BPP 是相等的。不过,目前如果 bppnexp。
  −
  −
  −
  −
  −
  −
==Intractability== <!-- This section is linked from [[Minimax]], [[Intractability]], [[Intractable]] -->
  −
  −
==Intractability== <!-- This section is linked from Minimax, Intractability, Intractable -->
  −
  −
难以驾驭! ——这部分链接了极大极小,难以驾驭,难以驾驭——
  −
  −
{{See also|Combinatorial explosion}}
  −
  −
  −
  −
{{wikt|tractable|feasible|intractability|infeasible}}
  −
  −
  −
  −
A problem that can be solved in theory (e.g. given large but finite resources, especially time), but for which in practice ''any'' solution takes too many resources to be useful, is known as an '''{{visible anchor|intractable problem}}'''.<ref>Hopcroft, J.E., Motwani, R. and Ullman, J.D. (2007) [[Introduction to Automata Theory, Languages, and Computation]], Addison Wesley, Boston/San Francisco/New York (page 368)</ref> Conversely, a problem that can be solved in practice is called a '''{{visible anchor|tractable problem}}''', literally "a problem that can be handled". The term ''[[wikt:infeasible|infeasible]]'' (literally "cannot be done") is sometimes used interchangeably with ''[[wikt:intractable|intractable]]'',<ref>{{cite book |title=Algorithms and Complexity |first=Gerard |last=Meurant |year=2014 |isbn=978-0-08093391-7 |page=[https://books.google.com/books?id=6WriBQAAQBAJ&pg=PA4&dq=computational+feasibility+tractability p. 4]}}</ref> though this risks confusion with a [[feasible solution]] in [[mathematical optimization]].<ref>
  −
  −
A problem that can be solved in theory (e.g. given large but finite resources, especially time), but for which in practice any solution takes too many resources to be useful, is known as an . Conversely, a problem that can be solved in practice is called a , literally "a problem that can be handled". The term infeasible (literally "cannot be done") is sometimes used interchangeably with intractable, though this risks confusion with a feasible solution in mathematical optimization.<ref>
  −
  −
在理论上可以解决的问题。但是在实践中,任何解决方案都需要太多的资源才能发挥作用。相反,一个在实践中可以解决的问题被称为“一个可以处理的问题”。Infeasible (字面上的意思是“不可能完成”)这个词有时可以交替使用,也可以用来表示棘手的问题,尽管这可能会导致在21最优化找到一个可行的解决方案。 裁判
  −
  −
{{cite book
  −
  −
{{cite book
  −
  −
{引用书
  −
  −
|title=Writing for Computer Science
  −
  −
|title=Writing for Computer Science
  −
  −
计算机科学写作
  −
  −
|first=Justin
  −
  −
|first=Justin
  −
  −
先是贾斯汀
  −
  −
|last=Zobel
  −
  −
|last=Zobel
  −
  −
最后一个 Zobel
  −
  −
|page=[https://books.google.com/books?id=LWCYBgAAQBAJ&pg=PA132&dq=intractable+infeasible 132]
  −
  −
|page=[https://books.google.com/books?id=LWCYBgAAQBAJ&pg=PA132&dq=intractable+infeasible 132]
  −
  −
[ https://books.google.com/books?id=lwcybgaaqbaj&pg=pa132&dq=intractable+infeasible 132]
  −
  −
|year=2015
  −
  −
|year=2015
  −
  −
2015年
  −
  −
|isbn=978-1-44716639-9
  −
  −
|isbn=978-1-44716639-9
  −
  −
[国际标准图书馆编号978-1-44716639-9]
  −
  −
}}</ref>
  −
  −
}}</ref>
  −
  −
{} / ref
  −
  −
  −
  −
  −
  −
Tractable problems are frequently identified with problems that have polynomial-time solutions ('''P''', '''PTIME'''); this is known as the [[Cobham–Edmonds thesis]]. Problems that are known to be intractable in this sense include those that are [[EXPTIME]]-hard. If NP is not the same as P, then [[NP-hard]] problems are also intractable in this sense.
  −
  −
Tractable problems are frequently identified with problems that have polynomial-time solutions (P, PTIME); this is known as the Cobham–Edmonds thesis. Problems that are known to be intractable in this sense include those that are EXPTIME-hard. If NP is not the same as P, then NP-hard problems are also intractable in this sense.
  −
  −
易处理的问题经常与具有多项式时间解决方案的问题(p,PTIME)相提并论; 这就是所谓的 Cobham-Edmonds 理论。在这个意义上被认为是棘手的问题包括那些 extime-hard。如果 NP 不等于 p,那么 NP 难问题在这个意义上也是棘手的。
  −
  −
  −
  −
  −
  −
However, this identification is inexact: a polynomial-time solution with large degree or large leading coefficient grows quickly, and may be impractical for practical size problems; conversely, an exponential-time solution that grows slowly may be practical on realistic input, or a solution that takes a long time in the worst case may take a short time in most cases or the average case, and thus still be practical. Saying that a problem is not in P does not imply that all large cases of the problem are hard or even that most of them are. For example, the decision problem in [[Presburger arithmetic]] has been shown not to be in P, yet algorithms have been written that solve the problem in reasonable times in most cases. Similarly, algorithms can solve the NP-complete [[knapsack problem]] over a wide range of sizes in less than quadratic time and [[SAT solver]]s routinely handle large instances of the NP-complete [[Boolean satisfiability problem]].
  −
  −
However, this identification is inexact: a polynomial-time solution with large degree or large leading coefficient grows quickly, and may be impractical for practical size problems; conversely, an exponential-time solution that grows slowly may be practical on realistic input, or a solution that takes a long time in the worst case may take a short time in most cases or the average case, and thus still be practical. Saying that a problem is not in P does not imply that all large cases of the problem are hard or even that most of them are. For example, the decision problem in Presburger arithmetic has been shown not to be in P, yet algorithms have been written that solve the problem in reasonable times in most cases. Similarly, algorithms can solve the NP-complete knapsack problem over a wide range of sizes in less than quadratic time and SAT solvers routinely handle large instances of the NP-complete Boolean satisfiability problem.
  −
  −
然而,这种识别是不精确的: 具有大次数或大超前系数的多项式时间解增长迅速,可能不适用于实际规模问题; 相反,增长缓慢的指数时间解在现实输入中可能是实用的,或者在最坏情况下需要很长时间的解在大多数情况下或在平均情况下可能需要很短的时间,因此仍然是实用的。说一个问题不在 p 中并不意味着所有的大问题都很难,甚至大多数都很难。例如,Presburger 算法中的决策问题已经被证明不在 p 中,但是已经编写的算法在大多数情况下在合理的时间内解决了这个问题。类似地,算法可以在不到二次时间的范围内求解 np 完全背包问题,而 SAT 求解器通常处理 np 完全布尔可满足性问题的大型实例。
  −
  −
  −
  −
  −
  −
To see why exponential-time algorithms are generally unusable in practice, consider a program that makes 2<sup>''n''</sup> operations before halting. For small ''n'', say 100, and assuming for the sake of example that the computer does 10<sup>12</sup> operations each second, the program would run for about 4&nbsp;×&nbsp;10<sup>10</sup> years, which is the same order of magnitude as the [[age of the universe]]. Even with a much faster computer, the program would only be useful for very small instances and in that sense the intractability of a problem is somewhat independent of technological progress. However, an exponential-time algorithm that takes 1.0001<sup>''n''</sup> operations is practical until ''n'' gets relatively large.
  −
  −
To see why exponential-time algorithms are generally unusable in practice, consider a program that makes 2<sup>n</sup> operations before halting. For small n, say 100, and assuming for the sake of example that the computer does 10<sup>12</sup> operations each second, the program would run for about 4&nbsp;×&nbsp;10<sup>10</sup> years, which is the same order of magnitude as the age of the universe. Even with a much faster computer, the program would only be useful for very small instances and in that sense the intractability of a problem is somewhat independent of technological progress. However, an exponential-time algorithm that takes 1.0001<sup>n</sup> operations is practical until n gets relatively large.
  −
  −
为了了解为什么指数时间算法在实践中通常是不可用的,考虑一个在暂停之前进行两次支持 / 支持操作的程序。对于小 n,比如100,假设计算机每秒钟执行10个 sup 12 / sup 操作,程序将运行大约410 sup 10 / sup 年,这与宇宙年龄的数量级相同。即使使用速度更快的计算机,该程序也只对非常小的实例有用,从这个意义上说,问题的难解性在某种程度上与技术进步无关。然而,在 n 变得相对较大之前,采用1.0001 sopn / sup 运算的指数时间算法是可行的。
  −
  −
  −
  −
  −
  −
Similarly, a polynomial time algorithm is not always practical. If its running time is, say, ''n''<sup>15</sup>, it is unreasonable to consider it efficient and it is still useless except on small instances. Indeed, in practice even ''n''<sup>3</sup> or ''n''<sup>2</sup> algorithms are often impractical on realistic sizes of problems.
  −
  −
Similarly, a polynomial time algorithm is not always practical. If its running time is, say, n<sup>15</sup>, it is unreasonable to consider it efficient and it is still useless except on small instances. Indeed, in practice even n<sup>3</sup> or n<sup>2</sup> algorithms are often impractical on realistic sizes of problems.
  −
  −
同样,多项式时间算法也不总是实用的。如果它的运行时间是,比如说,nsup 15 / sup,那么认为它有效是不合理的,而且除了小实例之外,它仍然是无用的。事实上,在实践中,即使是 nsup 3 / sup 或 nsup 2 / sup 算法对于实际问题的大小也常常是不切实际的。
  −
  −
  −
  −
  −
  −
==Continuous complexity theory==
  −
  −
==Continuous complexity theory==
  −
  −
连续复杂性理论
  −
  −
Continuous complexity theory can refer to complexity theory of problems that involve continuous functions that are approximated by discretizations, as studied in [[numerical analysis]]. One approach to complexity theory of numerical analysis<ref>{{cite journal | title = Complexity Theory and Numerical Analysis | id = {{citeseerx|10.1.1.33.4678}} | first = Steve | last = Smale | journal = Acta Numerica | volume = 6 | pages = 523–551 | year = 1997 | publisher = Cambridge Univ Press | doi = 10.1017/s0962492900002774 | bibcode = 1997AcNum...6..523S }}</ref> is [[information based complexity]].
  −
  −
Continuous complexity theory can refer to complexity theory of problems that involve continuous functions that are approximated by discretizations, as studied in numerical analysis. One approach to complexity theory of numerical analysis is information based complexity.
  −
  −
连续复杂性理论可以指涉及连续函数的问题的复杂性理论,这些函数可以用离散化来近似,正如数值分析中所研究的那样。数值分析复杂性理论的一种方法是基于信息的复杂性。
  −
  −
  −
  −
  −
  −
Continuous complexity theory can also refer to complexity theory of the use of [[analog computation]], which uses continuous [[dynamical system]]s and [[differential equation]]s.<ref>{{cite arxiv|eprint=0907.3117|last1=Babai|first1=László|last2=Campagnolo|first2=Manuel|title=A Survey on Continuous Time Computations|class=cs.CC|year=2009}}</ref> [[Control theory]] can be considered a form of computation and differential equations are used in the modelling of continuous-time and hybrid discrete-continuous-time systems.<ref>{{cite journal | title = Computational Techniques for the Verification of Hybrid Systems | id = {{citeseerx|10.1.1.70.4296}} | first1 = Claire J. | last1 = Tomlin | first2 = Ian | last2 = Mitchell | first3 = Alexandre M. | last3 = Bayen | first4 = Meeko | last4 = Oishi | journal = Proceedings of the IEEE | volume = 91 | issue = 7 | pages = 986–1001 | date = July 2003 | doi = 10.1109/jproc.2003.814621 }}</ref>
  −
  −
Continuous complexity theory can also refer to complexity theory of the use of analog computation, which uses continuous dynamical systems and differential equations. Control theory can be considered a form of computation and differential equations are used in the modelling of continuous-time and hybrid discrete-continuous-time systems.
  −
  −
连续复杂性理论也可以参考模拟计算的复杂性理论,模拟计算采用连续动力系统和微分方程。控制理论可以看作是一种计算形式,微分方程用于连续时间和混合离散连续时间系统的建模。
  −
  −
  −
  −
  −
  −
==History==
  −
  −
==History==
  −
  −
历史
  −
  −
An early example of algorithm complexity analysis is the running time analysis of the [[Euclidean algorithm]] done by [[Gabriel Lamé]] in 1844.
  −
  −
An early example of algorithm complexity analysis is the running time analysis of the Euclidean algorithm done by Gabriel Lamé in 1844.
  −
  −
算法复杂性分析的一个早期例子是 Gabriel lam 在1844年完成的辗转相除法的运行时间分析。
  −
  −
  −
  −
  −
  −
Before the actual research explicitly devoted to the complexity of algorithmic problems started off, numerous foundations were laid out by various researchers. Most influential among these was the definition of Turing machines by [[Alan Turing]] in 1936, which turned out to be a very robust and flexible simplification of a computer.
  −
  −
Before the actual research explicitly devoted to the complexity of algorithmic problems started off, numerous foundations were laid out by various researchers. Most influential among these was the definition of Turing machines by Alan Turing in 1936, which turned out to be a very robust and flexible simplification of a computer.
  −
  −
在真正致力于研究算法问题的复杂性的实际研究开始之前,各种各样的研究人员已经打下了大量的基础。其中最有影响力的是阿兰 · 图灵在1936年对图灵机的定义,这被证明是一个非常健壮和灵活的计算机简化。
  −
  −
  −
  −
  −
  −
The beginning of systematic studies in computational complexity is attributed to the seminal 1965 paper "On the Computational Complexity of Algorithms" by [[Juris Hartmanis]] and [[Richard E. Stearns]], which laid out the definitions of [[time complexity]] and [[space complexity]], and proved the hierarchy theorems.<ref name="Fortnow 2003">{{Harvtxt|Fortnow|Homer|2003}}</ref> In addition, in 1965 [[Jack Edmonds|Edmonds]] suggested to consider a "good" algorithm to be one with running time bounded by a polynomial of the input size.<ref>Richard M. Karp, "[http://cecas.clemson.edu/~shierd/Shier/MthSc816/turing-karp.pdf Combinatorics, Complexity, and Randomness]", 1985 Turing Award Lecture</ref>
  −
  −
The beginning of systematic studies in computational complexity is attributed to the seminal 1965 paper "On the Computational Complexity of Algorithms" by Juris Hartmanis and Richard E. Stearns, which laid out the definitions of time complexity and space complexity, and proved the hierarchy theorems. In addition, in 1965 Edmonds suggested to consider a "good" algorithm to be one with running time bounded by a polynomial of the input size.
  −
  −
计算复杂性系统研究的开始是由于 Juris Hartmanis 和理查德·斯特恩斯在1965年发表的论文《关于算法的计算复杂性》 ,其中提出了时间复杂性和空间复杂性的定义,并证明了层次定理。此外,在1965年,Edmonds 建议考虑一个”好的”算法是一个运行时间由输入大小的多项式限定的算法。
  −
  −
  −
  −
  −
  −
Earlier papers studying problems solvable by Turing machines with specific bounded resources include<ref name="Fortnow 2003"/> [[John Myhill]]'s definition of [[linear bounded automata]] (Myhill 1960), [[Raymond Smullyan]]'s study of rudimentary sets (1961), as well as [[Hisao Yamada]]'s paper<ref>{{Cite journal | last1 = Yamada | first1 = H. | title = Real-Time Computation and Recursive Functions Not Real-Time Computable | journal = IEEE Transactions on Electronic Computers | volume = EC-11 | issue = 6 | pages = 753–760 | year = 1962 | doi = 10.1109/TEC.1962.5219459}}</ref> on real-time computations (1962). Somewhat earlier, [[Boris Trakhtenbrot]] (1956), a pioneer in the field from the USSR, studied another specific complexity measure.<ref>Trakhtenbrot, B.A.: Signalizing functions and tabular operators. Uchionnye Zapiski
  −
  −
Earlier papers studying problems solvable by Turing machines with specific bounded resources include on real-time computations (1962). Somewhat earlier, Boris Trakhtenbrot (1956), a pioneer in the field from the USSR, studied another specific complexity measure.<ref>Trakhtenbrot, B.A.: Signalizing functions and tabular operators. Uchionnye Zapiski
  −
  −
早期的论文研究的问题可解决的图灵机具有特定的有限资源包括在实时计算(1962年)。稍早些时候,鲍里斯 · 特拉赫滕布罗特(1956) ,苏联在这一领域的先驱,研究了另一个具体的复杂性度量方法。* 签名函数和表格操作符。Uchionnye Zapiski
  −
  −
Penzenskogo Pedinstituta (Transactions of the Penza Pedagogoical Institute) 4, 75–87 (1956) (in Russian)</ref> As he remembers:
  −
  −
Penzenskogo Pedinstituta (Transactions of the Penza Pedagogoical Institute) 4, 75–87 (1956) (in Russian)</ref> As he remembers:
  −
  −
Penzenskogo Pedinstituta (Penza 教育学院学报)4,75-87(1956)(俄文) / ref 他记得:
  −
  −
  −
  −
  −
  −
{{quote|However, [my] initial interest [in automata theory] was increasingly set aside in favor of computational complexity, an exciting fusion of combinatorial methods, inherited from [[switching theory]], with the conceptual arsenal of the theory of algorithms. These ideas had occurred to me earlier in 1955 when I coined the term "signalizing function", which is nowadays commonly known as "complexity measure".<ref>Boris Trakhtenbrot, "[https://books.google.com/books?id=GFX2qiLuRAMC&pg=PA1&dq=%22From+Logic+to+Theoretical+Computer+Science+%E2%80%93+An+Update%22&hl=en&sa=X&ved=0ahUKEwivkOPkt-TjAhVHRqwKHUNnAekQ6AEIKjAA#v=onepage&q=%22From%20Logic%20to%20Theoretical%20Computer%20Science%20%E2%80%93%20An%20Update%22&f=false From Logic to Theoretical Computer Science – An Update]". In: ''Pillars of Computer Science'', LNCS 4800, Springer 2008.</ref>}}
  −
  −
  −
  −
  −
  −
  −
  −
In 1967, [[Manuel Blum]] formulated a set of [[axiom]]s (now known as [[Blum axioms]]) specifying desirable properties of complexity measures on the set of computable functions and proved an important result, the so-called [[Blum's speedup theorem|speed-up theorem]]. The field began to flourish in 1971 when the [[Stephen Cook]] and [[Leonid Levin]] [[Cook–Levin theorem|proved]] the existence of practically relevant problems that are [[NP-complete]]. In 1972, [[Richard Karp]] took this idea a leap forward with his landmark paper, "Reducibility Among Combinatorial Problems", in which he showed that 21 diverse [[combinatorics|combinatorial]] and [[graph theory|graph theoretical]] problems, each infamous for its computational intractability, are NP-complete.<ref>{{Citation | author = Richard M. Karp | chapter = Reducibility Among Combinatorial Problems | chapter-url = http://www.cs.berkeley.edu/~luca/cs172/karp.pdf | title = Complexity of Computer Computations |editor= R. E. Miller |editor2=J. W. Thatcher| publisher = New York: Plenum | pages = 85–103 | year = 1972}}</ref>
  −
  −
In 1967, Manuel Blum formulated a set of axioms (now known as Blum axioms) specifying desirable properties of complexity measures on the set of computable functions and proved an important result, the so-called speed-up theorem. The field began to flourish in 1971 when the Stephen Cook and Leonid Levin proved the existence of practically relevant problems that are NP-complete. In 1972, Richard Karp took this idea a leap forward with his landmark paper, "Reducibility Among Combinatorial Problems", in which he showed that 21 diverse combinatorial and graph theoretical problems, each infamous for its computational intractability, are NP-complete.
  −
  −
1967年,Manuel Blum 提出了一组公理(现在称为 Blum 公理) ,在可计算函数集上指定了复杂度量的理想性质,并证明了一个重要的结果,即所谓的加速定理。这个领域在1971年开始蓬勃发展,当时史蒂芬 · 库克和莱昂尼德 · 莱文证明存在实际上相关的 np 完全问题。1972年,理查德 · 卡普在他具有里程碑意义的论文《组合问题中的可约性》中,向我们展示了21个不同的组合和图论问题,每个问题都因其难以计算而臭名昭著,这是 np 完全的。
  −
  −
  −
  −
  −
  −
In the 1980s, much work was done on the average difficulty of solving NP-complete problems—both exactly and approximately. At that time, computational complexity theory was at its height, and it was widely believed that if a problem turned out to be NP-complete, then there was little chance of being able to work with the problem in a practical situation. However, it became increasingly clear that this is not always the case{{cn|reason=passive, no source|date=August 2019}}, and some authors claimed that general asymptotic results are often unimportant for typical problems arising in practice.<ref>{{cite book|last=Wolfram|first=Stephen|title=A New Kind of Science|publisher=Wolfram Media, Inc.|year=2002|page=[https://archive.org/details/newkindofscience00wolf/page/1143 1143]|isbn=978-1-57955-008-0|url-access=registration|url=https://archive.org/details/newkindofscience00wolf/page/1143}}</ref>
  −
  −
In the 1980s, much work was done on the average difficulty of solving NP-complete problems—both exactly and approximately. At that time, computational complexity theory was at its height, and it was widely believed that if a problem turned out to be NP-complete, then there was little chance of being able to work with the problem in a practical situation. However, it became increasingly clear that this is not always the case, and some authors claimed that general asymptotic results are often unimportant for typical problems arising in practice.
  −
  −
20世纪80年代,人们在解决 np 完全问题的平均难度方面做了大量的工作。当时,计算复杂性理论正处于鼎盛时期,人们普遍认为,如果一个问题最终证明是 np 完全问题,那么在实际情况下处理这个问题的可能性就很小。然而,越来越清楚的是,情况并非总是如此,一些作者声称,对于实践中出现的典型问题,一般的渐近结果往往不重要。
  −
  −
  −
  −
  −
  −
==See also==
  −
  −
==See also==
  −
  −
参见
  −
  −
{{Div col|colwidth=25em}}
  −
  −
  −
  −
* [[Context of computational complexity]]
  −
  −
  −
  −
* [[Descriptive complexity theory]]
  −
  −
  −
  −
* [[Game complexity]]
  −
  −
  −
  −
* [[Leaf language]]
  −
  −
  −
  −
* [[List of complexity classes]]
  −
  −
  −
  −
* [[List of computability and complexity topics]]
  −
  −
  −
  −
* [[List of important publications in theoretical computer science]]
  −
  −
  −
  −
* [[List of unsolved problems in computer science]]
  −
  −
  −
  −
* [[Parameterized complexity]]
  −
  −
  −
  −
* [[Proof complexity]]
  −
  −
  −
  −
* [[Quantum complexity theory]]
  −
  −
  −
  −
* [[Structural complexity theory]]
  −
  −
  −
  −
* [[Transcomputational problem]]
  −
  −
  −
  −
* [[Computational complexity of mathematical operations]]
  −
  −
  −
  −
{{Div col end}}
  −
  −
  −
  −
  −
  −
  −
  −
==Works on Complexity==
  −
  −
==Works on Complexity==
  −
  −
关于复杂性的作品
  −
  −
* {{Citation |editor-first=Shyam |editor-last=Wuppuluri |editor2-first=Francisco A. |editor2-last=Doria|title=Unravelling Complexity: The Life and Work of Gregory Chaitin |publisher=World Scientific |year=2020 |isbn=978-981-12-0006-9 |ref=https://www.worldscientific.com/worldscibooks/10.1142/11270|doi=10.1142/11270 }}
  −
  −
  −
  −
==References==
  −
  −
==References==
  −
  −
参考资料
  −
  −
=== Citations ===
  −
  −
=== Citations ===
  −
  −
引文
  −
  −
{{Reflist|30em}}
  −
  −
  −
  −
  −
  −
  −
  −
===Textbooks===
  −
  −
===Textbooks===
  −
  −
教科书
  −
  −
*{{Citation
  −
  −
  −
  −
| last1=Arora | first1=Sanjeev | authorlink1=Sanjeev Arora
  −
  −
| last1=Arora | first1=Sanjeev | authorlink1=Sanjeev Arora
  −
  −
1 | last 1 Arora | first1 Sanjeev | authorlink1 Sanjeev Arora
  −
  −
| last2=Barak | first2=Boaz
  −
  −
| last2=Barak | first2=Boaz
  −
  −
2 Barak | first2 Boaz
  −
  −
| title=Computational Complexity: A Modern Approach
  −
  −
| title=Computational Complexity: A Modern Approach
  −
  −
计算复杂性: 一种现代方法
  −
  −
| url = http://www.cs.princeton.edu/theory/complexity/
  −
  −
| url = http://www.cs.princeton.edu/theory/complexity/
  −
  −
Http://www.cs.princeton.edu/theory/complexity/
      
| publisher=Cambridge University Press
 
| publisher=Cambridge University Press
   −
| publisher=Cambridge University Press
+
剑桥大学出版社
   −
出版商剑桥大学出版社
     −
| year=2009
      
| year=2009
 
| year=2009
    
2009年
 
2009年
 +
 +
However, some computational problems are easier to analyze in terms of more unusual resources. For example, a non-deterministic Turing machine is a computational model that is allowed to branch out to check many different possibilities at once. The non-deterministic Turing machine has very little to do with how we physically want to compute algorithms, but its branching exactly captures many of the mathematical models we want to analyze, so that [[non-deterministic time]] is a very important resource in analyzing computational problems.
    
| isbn=978-0-521-42426-4
 
| isbn=978-0-521-42426-4
   −
| isbn=978-0-521-42426-4
+
| isbn = 978-0-521-42426-4
   −
[国际标准图书编号978-0-521-42426-4]
     −
| zbl=1193.68112
      
| zbl=1193.68112
 
| zbl=1193.68112
第1,789行: 第163行:  
1193.68112
 
1193.68112
   −
}}
+
===Complexity measures===
    
}}
 
}}
第1,795行: 第169行:  
}}
 
}}
   −
* {{Citation
+
For a precise definition of what it means to solve a problem using a given amount of time and space, a computational model such as the [[deterministic Turing machine]] is used. The ''time required'' by a deterministic Turing machine ''M'' on input ''x'' is the total number of state transitions, or steps, the machine makes before it halts and outputs the answer ("yes" or "no"). A Turing machine ''M'' is said to operate within time ''f''(''n'') if the time required by ''M'' on each input of length ''n'' is at most ''f''(''n''). A decision problem ''A'' can be solved in time ''f''(''n'') if there exists a Turing machine operating in time ''f''(''n'') that solves the problem. Since complexity theory is interested in classifying problems based on their difficulty, one defines sets of problems based on some criteria. For instance, the set of problems solvable within time ''f''(''n'') on a deterministic Turing machine is then denoted by [[DTIME]](''f''(''n'')).
      第1,801行: 第175行:  
| last1=Downey
 
| last1=Downey
   −
| last1=Downey
+
1 = Downey
   −
最后一位唐尼
+
Analogous definitions can be made for space requirements. Although time and space are the most well-known complexity resources, any [[Complexity|complexity measure]] can be viewed as a computational resource. Complexity measures are very generally defined by the [[Blum complexity axioms]]. Other complexity measures used in complexity theory include [[communication complexity]], [[circuit complexity]], and [[decision tree complexity]].
    
| first1=Rod
 
| first1=Rod
   −
| first1=Rod
+
1 = Rod
 +
 
   −
| first1 Rod
      
| last2=Fellows
 
| last2=Fellows
   −
| last2=Fellows
+
2 = Fellows
   −
2 Fellows
+
The complexity of an algorithm is often expressed using [[big O notation]].
    
| first2=Michael
 
| first2=Michael
   −
| first2=Michael
+
2 = Michael
   −
| first2 Michael
     −
| authorlink2=Michael Fellows
      
| authorlink2=Michael Fellows
 
| authorlink2=Michael Fellows
   −
作者: 迈克尔 · 费罗斯
+
2 = Michael Fellows
   −
| title=Parameterized complexity
+
===Best, worst and average case complexity===
    
| title=Parameterized complexity
 
| title=Parameterized complexity
   −
标题参数化复杂度
+
参数化复杂度
   −
| url=https://www.springer.com/sgw/cda/frontpage/0,11855,5-0-22-1519914-0,00.html
+
[[File:Sorting quicksort anim.gif|thumb|Visualization of the [[quicksort]] [[algorithm]] that has [[Best, worst and average case|average case performance]] <math>\mathcal{O}(n\log n)</math>.]]
    
| url=https://www.springer.com/sgw/cda/frontpage/0,11855,5-0-22-1519914-0,00.html
 
| url=https://www.springer.com/sgw/cda/frontpage/0,11855,5-0-22-1519914-0,00.html
第1,841行: 第213行:  
Https://www.springer.com/sgw/cda/frontpage/0,11855,5-0-22-1519914-0,00.html
 
Https://www.springer.com/sgw/cda/frontpage/0,11855,5-0-22-1519914-0,00.html
   −
| publisher=Springer-Verlag
+
The [[best, worst and average case]] complexity refer to three different ways of measuring the time complexity (or any other complexity measure) of different inputs of the same size. Since some inputs of size ''n'' may be faster to solve than others, we define the following complexities:
    
| publisher=Springer-Verlag
 
| publisher=Springer-Verlag
   −
| 出版商 Springer-Verlag
+
| publisher = Springer-Verlag
   −
| location=Berlin, New York
+
#Best-case complexity: This is the complexity of solving the problem for the best input of size ''n''.
    
| location=Berlin, New York
 
| location=Berlin, New York
   −
| 位置: 纽约,柏林
+
| 地点: 柏林,纽约
   −
| year=1999
+
#Average-case complexity: This is the complexity of solving the problem on an average. This complexity is only defined with respect to a [[probability distribution]] over the inputs. For instance, if all inputs of the same size are assumed to be equally likely to appear, the average case complexity can be defined with respect to the uniform distribution over all inputs of size ''n''.
    
| year=1999
 
| year=1999
第1,859行: 第231行:  
1999年
 
1999年
   −
| isbn=9780387948836
+
#[[Amortized analysis]]: Amortized analysis considers both the costly and less costly operations together over the whole series of operations of the algorithm.
    
| isbn=9780387948836
 
| isbn=9780387948836
第1,865行: 第237行:  
9780387948836
 
9780387948836
   −
| series=Monographs in Computer Science
+
#Worst-case complexity: This is the complexity of solving the problem for the worst input of size ''n''.
    
| series=Monographs in Computer Science
 
| series=Monographs in Computer Science
   −
计算机科学系列专著
+
系列 = 计算机科学专著
   −
}}
+
The order from cheap to costly is: Best, average (of [[discrete uniform distribution]]), amortized, worst.
    
}}
 
}}
第1,877行: 第249行:  
}}
 
}}
   −
* {{citation
         +
For example, consider the deterministic sorting algorithm [[quicksort]]. This solves the problem of sorting a list of integers that is given as the input. The worst-case is when the pivot is always the largest or smallest value in the list (so the list is never divided). In this case the algorithm takes time [[Big O notation|O]](''n''<sup>2</sup>). If we assume that all possible permutations of the input list are equally likely, the average time taken for sorting is O(''n'' log ''n''). The best case occurs when each pivoting divides the list in half, also needing O(''n'' log ''n'') time.
    
| last=Du
 
| last=Du
   −
| last=Du
+
| last = Du
   −
| last Du
     −
| first=Ding-Zhu
      
| first=Ding-Zhu
 
| first=Ding-Zhu
   −
首先是鼎珠
+
| 第一 = 鼎柱
   −
| author2=Ko, Ker-I
+
===Upper and lower bounds on the complexity of problems===
    
| author2=Ko, Ker-I
 
| author2=Ko, Ker-I
   −
| author2 Ko,Ker-I
+
| author2 = Ko,Ker-I
   −
| title=Theory of Computational Complexity
+
To classify the computation time (or similar resources, such as space consumption), it is helpful to demonstrate upper and lower bounds on the maximum amount of time required by the most efficient algorithm to solve a given problem. The complexity of an algorithm is usually taken to be its worst-case complexity, unless specified otherwise. Analyzing a particular algorithm falls under the field of [[analysis of algorithms]]. To show an upper bound ''T''(''n'') on the time complexity of a problem, one needs to show only that there is a particular algorithm with running time at most ''T''(''n''). However, proving lower bounds is much more difficult, since lower bounds make a statement about all possible algorithms that solve a given problem. The phrase "all possible algorithms" includes not just the algorithms known today, but any algorithm that might be discovered in the future. To show a lower bound of ''T''(''n'') for a problem requires showing that no algorithm can have time complexity lower than ''T''(''n'').
    
| title=Theory of Computational Complexity
 
| title=Theory of Computational Complexity
第1,905行: 第275行:  
计算复杂性理论
 
计算复杂性理论
   −
| publisher=John Wiley & Sons
+
 
    
| publisher=John Wiley & Sons
 
| publisher=John Wiley & Sons
   −
出版商约翰威立
+
2012年3月24日 | publisher = 约翰威立
   −
| year=2000
+
Upper and lower bounds are usually stated using the [[big O notation]], which hides constant factors and smaller terms. This makes the bounds independent of the specific details of the computational model used. For instance, if ''T''(''n'')&nbsp;=&nbsp;7''n''<sup>2</sup>&nbsp;+&nbsp;15''n''&nbsp;+&nbsp;40, in big O notation one would write ''T''(''n'')&nbsp;=&nbsp;O(''n''<sup>2</sup>).
    
| year=2000
 
| year=2000
第1,917行: 第287行:  
2000年
 
2000年
   −
| isbn=978-0-471-34506-0
+
 
    
| isbn=978-0-471-34506-0
 
| isbn=978-0-471-34506-0
   −
[国际标准图书馆编号978-0-471-34506-0]
+
| isbn = 978-0-471-34506-0
   −
}}
+
==Complexity classes==
    
}}
 
}}
第1,929行: 第299行:  
}}
 
}}
   −
* {{Garey-Johnson}}
+
{{main|Complexity class}}
         −
* {{Citation
+
===Defining complexity classes===
 
  −
 
  −
 
  −
| last=Goldreich
      
| last=Goldreich
 
| last=Goldreich
   −
| 最后的 Goldreich
+
| last = Goldreich
   −
| first=Oded
+
A '''complexity class''' is a set of problems of related complexity. Simpler complexity classes are defined by the following factors:
    
| first=Oded
 
| first=Oded
   −
首先是 Oded
+
第一个 = Oded
   −
| authorlink=Oded Goldreich
+
* The type of computational problem: The most commonly used problems are decision problems. However, complexity classes can be defined based on [[function problem]]s, [[counting problem (complexity)|counting problem]]s, [[optimization problem]]s, [[promise problem]]s, etc.
    
| authorlink=Oded Goldreich
 
| authorlink=Oded Goldreich
   −
作者: Oded Goldreich
+
| authorlink = Oded Goldreich
   −
| url = http://www.wisdom.weizmann.ac.il/~oded/cc-book.html
+
* The model of computation: The most common model of computation is the deterministic Turing machine, but many complexity classes are based on non-deterministic Turing machines, [[Boolean circuit]]s, [[quantum Turing machine]]s, [[monotone circuit]]s, etc.
    
| url = http://www.wisdom.weizmann.ac.il/~oded/cc-book.html
 
| url = http://www.wisdom.weizmann.ac.il/~oded/cc-book.html
    
Http://www.wisdom.weizmann.ac.il/~oded/cc-book.html
 
Http://www.wisdom.weizmann.ac.il/~oded/cc-book.html
 +
 +
* The resource (or resources) that is being bounded and the bound: These two properties are usually stated together, such as "polynomial time", "logarithmic space", "constant depth", etc.
    
| title = Computational Complexity: A Conceptual Perspective
 
| title = Computational Complexity: A Conceptual Perspective
   −
| title = Computational Complexity: A Conceptual Perspective
+
| title = 计算复杂性: 一个概念性的视角
   −
计算复杂性: 概念透视
     −
| publisher = Cambridge University Press
      
| publisher = Cambridge University Press
 
| publisher = Cambridge University Press
   −
出版商剑桥大学出版社
+
剑桥大学出版社
   −
| year = 2008
+
Some complexity classes have complicated definitions that do not fit into this framework. Thus, a typical complexity class has a definition like the following:
    
| year = 2008
 
| year = 2008
第1,979行: 第345行:  
2008年
 
2008年
   −
}}
+
 
    
}}
 
}}
第1,985行: 第351行:  
}}
 
}}
   −
* {{Citation
+
:The set of decision problems solvable by a deterministic Turing machine within time ''f''(''n''). (This complexity class is known as DTIME(''f''(''n'')).)
      第1,993行: 第359行:  
| editor1-last=van Leeuwen
 
| editor1-last=van Leeuwen
   −
| editor1-last=van Leeuwen
+
But bounding the computation time above by some concrete function ''f''(''n'') often yields complexity classes that depend on the chosen machine model. For instance, the language {''xx'' | ''x'' is any binary string} can be solved in [[linear time]] on a multi-tape Turing machine, but necessarily requires quadratic time in the model of single-tape Turing machines. If we allow polynomial variations in running time, [[Cobham's thesis|Cobham-Edmonds thesis]] states that "the time complexities in any two reasonable and general models of computation are polynomially related" {{Harv|Goldreich|2008|loc=Chapter 1.2}}. This forms the basis for the complexity class [[P (complexity)|P]], which is the set of decision problems solvable by a deterministic Turing machine within polynomial time. The corresponding set of function problems is [[FP (complexity)|FP]].
    
| editor1-first=Jan
 
| editor1-first=Jan
   −
| editor1-first=Jan
+
1-first = Jan
 +
 
   −
1月1日
      
| editor1-link = Jan van Leeuwen
 
| editor1-link = Jan van Leeuwen
第2,005行: 第371行:  
| editor1-link = Jan van Leeuwen
 
| editor1-link = Jan van Leeuwen
   −
| editor1-link = Jan van Leeuwen
+
===Important complexity classes===
    
| title=Handbook of theoretical computer science (vol. A): algorithms and complexity
 
| title=Handbook of theoretical computer science (vol. A): algorithms and complexity
   −
| title=Handbook of theoretical computer science (vol. A): algorithms and complexity
+
| title = 理论计算机科学手册。A)算法和复杂性
   −
理论计算机科学手册。A)算法和复杂性
     −
| publisher=MIT Press
      
| publisher=MIT Press
 
| publisher=MIT Press
   −
出版商: 麻省理工出版社
+
| publisher = MIT Press
   −
| isbn=978-0-444-88071-0
+
[[Image:Complexity subsets pspace.svg|thumb|right|A representation of the relation among complexity classes]]
    
| isbn=978-0-444-88071-0
 
| isbn=978-0-444-88071-0
   −
[国际标准图书编号978-0-444-88071-0]
+
978-0-444-88071-0
   −
| year=1990
+
Many important complexity classes can be defined by bounding the time or space used by the algorithm. Some important complexity classes of decision problems defined in this manner are the following:
    
| year=1990
 
| year=1990
第2,031行: 第395行:  
1990年
 
1990年
   −
}}
+
{|
    
}}
 
}}
第2,037行: 第401行:  
}}
 
}}
   −
* {{citation
+
|-style="vertical-align:top;"
 
      +
|
    
  | last = Papadimitriou
 
  | last = Papadimitriou
   −
| last = Papadimitriou
+
| last = Papadimitriou
   −
最后的帕帕迪米特里欧
+
{| class="wikitable"
    
  | first = Christos
 
  | first = Christos
   −
| first = Christos
+
第一季,克里斯托
   −
第一个克里斯托
+
|-
    
  | authorlink = Christos Papadimitriou
 
  | authorlink = Christos Papadimitriou
   −
| authorlink = Christos Papadimitriou
+
作者/链接 = 赫里斯托斯·帕帕季米特里乌
   −
| authorlink 赫里斯托斯·帕帕季米特里乌
+
! Complexity class
    
  | title = Computational Complexity
 
  | title = Computational Complexity
   −
| title = Computational Complexity
+
| title = 计算复杂性
   −
计算复杂性
+
! Model of computation
    
  | edition = 1st
 
  | edition = 1st
   −
| edition = 1st
+
1st
   −
第一版
+
! Resource constraint
 
  −
| year = 1994
      
  | year = 1994
 
  | year = 1994
第2,077行: 第439行:  
1994年
 
1994年
   −
| publisher = Addison Wesley
+
|-
    
  | publisher = Addison Wesley
 
  | publisher = Addison Wesley
   −
出版商 Addison Wesley
+
艾迪生 · 韦斯利
   −
| isbn = 978-0-201-53082-7
+
! colspan="3" | Deterministic time
    
  | isbn = 978-0-201-53082-7
 
  | isbn = 978-0-201-53082-7
   −
[国际标准图书编号978-0-201-53082-7]
+
| isbn = 978-0-201-53082-7
   −
}}
+
|-
    
}}
 
}}
第2,095行: 第457行:  
}}
 
}}
   −
* {{Citation
+
| [[DTIME]](''f''(''n''))
 
      +
| Deterministic Turing machine
    
|last=Sipser
 
|last=Sipser
   −
|last=Sipser
+
最后 = Sipser
   −
最后一个诗人
+
| Time O(''f''(''n''))
    
|first=Michael
 
|first=Michael
   −
|first=Michael
+
迈克尔
   −
先是迈克尔
+
|-
    
|authorlink=Michael Sipser
 
|authorlink=Michael Sipser
   −
|authorlink=Michael Sipser
+
| authorlink = Michael Sipser
   −
作者: Michael Sipser
+
| &nbsp;
    
|title=Introduction to the Theory of Computation
 
|title=Introduction to the Theory of Computation
   −
|title=Introduction to the Theory of Computation
+
| title = 美国计算理论学会简介
   −
美国计算理论学会简介
+
| &nbsp;
    
|edition=2nd
 
|edition=2nd
   −
|edition=2nd
+
2nd
   −
第二版
+
| &nbsp;
 
  −
|year=2006
      
|year=2006
 
|year=2006
第2,135行: 第495行:  
2006年
 
2006年
   −
|publisher=Thomson Course Technology
+
|-
    
|publisher=Thomson Course Technology
 
|publisher=Thomson Course Technology
   −
出版商 Thomson Course Technology
+
| publisher = Thomson Course Technology
   −
|location=USA
+
| [[P (complexity)|P]]
    
|location=USA
 
|location=USA
   −
| 位置美国
+
| location = USA
   −
|isbn=978-0-534-95097-2
+
| Deterministic Turing machine
    
|isbn=978-0-534-95097-2
 
|isbn=978-0-534-95097-2
   −
[国际标准图书编号978-0-534-95097-2]
+
| isbn = 978-0-534-95097-2
   −
|title-link=Introduction to the Theory of Computation
+
| Time O(poly(''n''))
    
|title-link=Introduction to the Theory of Computation
 
|title-link=Introduction to the Theory of Computation
   −
| 标题链接计算理论简介
+
| title-link = 计算理论简介
   −
}}
+
|-
    
}}
 
}}
第2,165行: 第525行:  
}}
 
}}
    +
| [[EXPTIME]]
    +
| Deterministic Turing machine
    +
| Time O(2<sup>poly(''n'')</sup>)
    +
|-
   −
===Surveys===
+
! colspan="3" | Non-deterministic time
   −
===Surveys===
+
|-
   −
调查
+
| [[NTIME]](''f''(''n''))
   −
* {{Citation | last1=Khalil | first1=Hatem | last2=Ulery | first2=Dana | author2-link=Dana Ulery | title=A Review of Current Studies on Complexity of Algorithms for Partial Differential Equations | year=1976 | pages=197–201 | url = http://portal.acm.org/citation.cfm?id=800191.805573 | doi=10.1145/800191.805573 | journal=Proceedings of the Annual Conference on - ACM 76| series=ACM '76 }}
+
| Non-deterministic Turing machine
    +
| Time O(''f''(''n''))
    +
|-
   −
* {{Citation | last1=Cook | first1=Stephen | author1-link=Stephen Cook | title=An overview of computational complexity | year=1983 | journal=Commun. ACM | issn=0001-0782 | volume=26 | issue=6 | pages=400–408 | doi=10.1145/358141.358144| url=http://www.europrog.ru/paper/sc1982e.pdf }}
+
| &nbsp;
    +
| &nbsp;
    +
| &nbsp;
   −
* {{Citation | last1=Fortnow | first1=Lance | last2=Homer | first2=Steven | title=A Short History of Computational Complexity | year=2003 | journal=Bulletin of the EATCS | volume=80 | pages=95–133 | url = http://people.cs.uchicago.edu/~fortnow/papers/history.pdf}}
+
|-
    +
| [[NP (complexity)|NP]]
    +
| Non-deterministic Turing machine
   −
* {{Citation | last1=Mertens | first1=Stephan | title=Computational Complexity for Physicists | year=2002 | journal=Computing in Science and Eng. | issn=1521-9615 | volume=4 | issue=3 | pages=31–47 | doi=10.1109/5992.998639 | arxiv=cond-mat/0012185| bibcode=2002CSE.....4c..31M }}
+
| Time O(poly(''n''))
    +
|-
    +
| [[NEXPTIME]]
    +
| Non-deterministic Turing machine
   −
 
+
| Time O(2<sup>poly(''n'')</sup>)
 
  −
 
  −
==External links==
  −
 
  −
==External links==
  −
 
  −
外部链接
  −
 
  −
{{Commonscat}}
  −
 
  −
 
  −
 
  −
*[https://complexityzoo.uwaterloo.ca/Complexity_Zoo The Complexity Zoo]
  −
 
  −
 
  −
 
  −
*{{springer|title=Computational complexity classes|id=p/c130160}}
  −
 
  −
 
  −
 
  −
* [https://mathoverflow.net/q/34487 What are the most important results (and papers) in complexity theory that every one should know?]
  −
 
  −
 
  −
 
  −
* [https://www.scottaaronson.com/papers/philos.pdf Scott Aaronson: Why Philosophers Should Care About Computational Complexity]
  −
 
  −
 
  −
 
  −
 
  −
 
  −
 
  −
 
  −
{{ComplexityClasses}}
  −
 
  −
 
  −
 
  −
{{Computer science}}
  −
 
  −
 
  −
 
  −
{{Authority control}}
  −
 
  −
 
  −
 
  −
 
  −
 
  −
 
  −
 
  −
{{DEFAULTSORT:Computational Complexity Theory}}
  −
 
  −
 
  −
 
  −
[[Category:Computational complexity theory| ]]
  −
 
  −
  −
 
  −
[[Category:Computational fields of study]]
      
Category:Computational fields of study
 
Category:Computational fields of study
1,568

个编辑

导航菜单