Jump to content

Examine individual changes

This page allows you to examine the variables generated by the Edit Filter for an individual change.

Variables generated for this change

VariableValue
Edit count of the user (user_editcount)
null
Name of the user account (user_name)
'74.192.203.25'
Age of the user account (user_age)
0
Groups (including implicit) the user is in (user_groups)
[ 0 => '*' ]
Rights that the user has (user_rights)
[ 0 => 'createaccount', 1 => 'read', 2 => 'edit', 3 => 'createtalk', 4 => 'writeapi', 5 => 'viewmyprivateinfo', 6 => 'editmyprivateinfo', 7 => 'editmyoptions', 8 => 'abusefilter-log-detail', 9 => 'urlshortener-create-url', 10 => 'centralauth-merge', 11 => 'abusefilter-view', 12 => 'abusefilter-log', 13 => 'vipsscaler-test' ]
Whether or not a user is editing through the mobile interface (user_mobile)
true
Whether the user is editing from mobile app (user_app)
false
Page ID (page_id)
7543
Page namespace (page_namespace)
0
Page title without namespace (page_title)
'Computational complexity theory'
Full page title (page_prefixedtitle)
'Computational complexity theory'
Edit protection level of the page (page_restrictions_edit)
[]
Last ten users to contribute to the page (page_recent_contributors)
[ 0 => '2600:1006:B08B:FC72:D5D0:E1D:5A8C:F654', 1 => 'David Eppstein', 2 => 'KenShirriff', 3 => 'Totallyuneekname', 4 => 'Headbomb', 5 => 'Maxeto0910', 6 => 'OAbot', 7 => 'Citation bot', 8 => 'AmirOnWiki', 9 => 'Meno25' ]
Page age in seconds (page_age)
707480105
Action (action)
'edit'
Edit summary/reason (summary)
'/* Machine models and complexity measures */'
Time since last page edit in seconds (page_last_edit_age)
541425
Old content model (old_content_model)
'wikitext'
New content model (new_content_model)
'wikitext'
Old page wikitext, before the edit (old_wikitext)
'{{Short description|Inherent difficulty of computational problems}} {{Use mdy dates|date=September 2017}} In [[theoretical computer science]] and mathematics, '''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]]. 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 [[logic gate|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]],<ref>{{cite web |title=P vs NP Problem {{!}} Clay Mathematics Institute |url=http://www.claymath.org/millennium-problems/p-vs-np-problem |website=www.claymath.org |language=en |access-date=July 6, 2018 |archive-date=July 6, 2018 |archive-url=https://web.archive.org/web/20180706075006/http://www.claymath.org/millennium-problems/p-vs-np-problem |url-status=dead }}</ref> is part of the field of computational complexity. 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. ==Computational problems== [[Image:TSP Deutschland 3.png|thumb|upright=1.5|A traveling salesman tour through 14 German cities]] ===Problem instances=== A [[computational problem]] can be viewed as an infinite collection of ''instances'' together with a set (possibly empty) of ''solutions'' 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. To further highlight the difference between a problem and an instance, consider the following instance of the decision version of the [[travelling 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&nbsp;km. For this reason, complexity theory addresses computational problems and not particular 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. 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=== [[Image:Decision Problem.svg|thumb|A [[decision problem]] has only two possible outputs, ''yes'' or ''no'' (or alternately 1 or 0) on any 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. 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. ===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 is not 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'',&nbsp;''b'',&nbsp;''c'') such that the relation ''a''&nbsp;×&nbsp;''b''&nbsp;=&nbsp;''c'' holds. Deciding whether a given triple is a member of this set corresponds to solving the problem of multiplying two numbers. ===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? 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. ==Machine models and complexity measures== ===Turing machine=== {{main|Turing machine}} [[File:Turing machine 2b.svg|thumb|right|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]], [[lambda calculus]] 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. 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. 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]]. ===Other machine models=== 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]]. 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=== 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'')). 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]]. The complexity of an algorithm is often expressed using [[big O notation]]. ===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>]] 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: #Best-case complexity: This is the complexity of solving the problem for the best input 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''. #[[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''. 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 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. ===Upper and lower bounds on the complexity of problems=== 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''). 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>). ==Complexity classes== {{main|Complexity class}} ===Defining complexity classes=== 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: :The set of decision problems solvable by a deterministic Turing machine within time ''f''(''n''). (This complexity class is known as 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]]. ===Important complexity classes=== [[File:Complexity subsets pspace.svg|thumb|right|A representation of the relation among complexity classes; L would be another step "inside" NL]] 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: {| class="wikitable sortable" ! scope=col | Resource ! scope=col | <abbr title="of Turing Machine used to Model Computation">Determinism</abbr> ! scope=col | Complexity class ! scope=col | Resource constraint |- ! scope=rowgroup rowspan=8 style="text-align:center;" | Space ! scope=rowgroup rowspan=4 style="text-align:center;" | Non-Deterministic | [[NSPACE]](''f''(''n'')) | data-sort-value=0 | O(''f''(''n'')) |- | [[NL (complexity)|NL]] | data-sort-value=1 | O(log ''n'') |- | [[NPSPACE]] | data-sort-value=2 | O(poly(''n'')) |- | [[NEXPSPACE]] | data-sort-value=4 | O(2<sup>poly(''n'')</sup>) |- ! scope=rowgroup rowspan=4 style="text-align:center;" | Deterministic | [[DSPACE]](''f''(''n'')) | data-sort-value=0 | O(''f''(''n'')) |- | [[L (complexity)|L]] | data-sort-value=1 | O(log ''n'') |- | [[PSPACE]] | data-sort-value=2 | O(poly(''n'')) |- | [[EXPSPACE]] | data-sort-value=4 | O(2<sup>poly(''n'')</sup>) |- ! scope=rowgroup rowspan=6 style="text-align:center;" | Time ! scope=rowgroup rowspan=3 style="text-align:center;" | Non-Deterministic | [[NTIME]](''f''(''n'')) | data-sort-value=0 | O(''f''(''n'')) |- | [[NP (complexity)|NP]] | data-sort-value=2 | O(poly(''n'')) |- | [[NEXPTIME]] | data-sort-value=4 | O(2<sup>poly(''n'')</sup>) |- ! scope=rowgroup rowspan=3 style="text-align:center;" | Deterministic | [[DTIME]](''f''(''n'')) | data-sort-value=0 | O(''f''(''n'')) |- | [[P (complexity)|P]] | data-sort-value=2 | O(poly(''n'')) |- | [[EXPTIME]] | data-sort-value=4 | O(2<sup>poly(''n'')</sup>) |} 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]]. 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. ===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. More precisely, the [[time hierarchy theorem]] states that :<math>\mathsf{DTIME}\big(o(f(n)) \big) \subsetneq \mathsf{DTIME} \big(f(n) \sdot \log(f(n)) \big)</math>. The [[space hierarchy theorem]] states that :<math>\mathsf{DSPACE}\big(o(f(n))\big) \subsetneq \mathsf{DSPACE} \big(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. ===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. 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. 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"/> ==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|s2cid=14352974|postscript=.|doi-access=free}}</ref>]] ===P versus NP problem=== {{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 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|last1=Berger|first1=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|author-link=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|access-date=2006-10-18|postscript=.|url-status=dead|archive-url=https://web.archive.org/web/20101212035424/http://www.claymath.org/millennium/P_vs_NP/Official_Problem_Description.pdf|archive-date=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.|author-link=Arthur Jaffe|year=2006|journal=Notices of the AMS|volume=53|issue=6|url=https://www.ams.org/notices/200606/fea-jaffe.pdf |archive-url=https://web.archive.org/web/20060612225513/http://www.ams.org/notices/200606/fea-jaffe.pdf |archive-date=2006-06-12 |url-status=live|access-date=2006-10-18|postscript=.}}</ref> ===Problems in NP not known to be in P or 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'''.<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'''. 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 | first1 = Vikraman | last1 = Arvind | first2 = Piyush P. | last2 = Kurur | title = Graph isomorphism is in SPP | journal = Information and Computation | volume = 204 | issue = 5 | year = 2006 | pages = 835–852 | doi = 10.1016/j.ic.2006.02.002 | postscript = .| doi-access = }}</ref> If graph isomorphism is NP-complete, the [[polynomial time hierarchy]] collapses to its second level.<ref>{{citation | last = Schöning | first = Uwe | author-link = Uwe Schöning | doi = 10.1016/0022-0000(88)90010-4 | issue = 3 | journal = Journal of Computer and System Sciences | pages = 312–323 | title = Graph Isomorphism is in the Low Hierarchy | volume = 37 | year = 1988}}</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> 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>{{cite web|first=Lance|last=Fortnow|author-link=Lance Fortnow|title=Computational Complexity Blog: Factoring|date=2002-09-13|url=http://weblog.fortnow.com/2002/09/complexity-class-of-week-factoring.html|website=weblog.fortnow.com}}</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. ===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. 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'''. 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. It is suspected that '''P''' and '''BPP''' are equal. However, it is currently open if '''BPP''' = '''NEXP'''. ==Intractability== <!-- This section is linked from [[Minimax]], [[Intractability]], [[Intractable]] --> {{See also|Combinatorial explosion}} 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 p. 4]|publisher=Elsevier }}</ref> though this risks confusion with a [[feasible solution]] in [[mathematical optimization]].<ref> {{cite book |title=Writing for Computer Science |first=Justin |last=Zobel |page=[https://books.google.com/books?id=LWCYBgAAQBAJ&pg=PA132 132] |year=2015 |publisher=Springer |isbn=978-1-44716639-9 }}</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. 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]]. 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. 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. ==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 | 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 | s2cid = 5949193 }}</ref> 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 | citeseerx = 10.1.1.70.4296 | first1 = Claire J. | last1 = Tomlin | first2 = Ian | last2 = Mitchell | first3 = Alexandre M. | last3 = Bayen | first4 = Meeko | last4 = Oishi | author4-link = Meeko Oishi | journal = Proceedings of the IEEE | volume = 91 | issue = 7 | pages = 986–1001 | date = July 2003 | doi = 10.1109/jproc.2003.814621 }}</ref> ==History== An early example of algorithm complexity analysis is the running time analysis of the [[Euclidean algorithm]] done by [[Gabriel Lamé]] in 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. 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> 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 Penzenskogo Pedinstituta (Transactions of the Penza Pedagogoical Institute) 4, 75–87 (1956) (in Russian)</ref> As he remembers: {{blockquote|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 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 [[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 | access-date = September 28, 2009 | archive-date = June 29, 2011 | archive-url = https://web.archive.org/web/20110629023717/http://www.cs.berkeley.edu/~luca/cs172/karp.pdf | url-status = dead }}</ref> ==See also== {{Div col|colwidth=25em}} * [[Computational complexity]] * [[Descriptive complexity theory]] * [[Game complexity]] * [[Leaf language]] * [[Limits of computation]] * [[List of complexity classes]] * [[List of computability and complexity topics]] * [[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== * {{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 |url=https://www.worldscientific.com/worldscibooks/10.1142/11270|doi=10.1142/11270 |s2cid=198790362 }} ==References== === Citations === {{Reflist|30em}} ===Textbooks=== *{{Citation | last1=Arora | first1=Sanjeev | author-link1=Sanjeev Arora | last2=Barak | first2=Boaz | title=Computational Complexity: A Modern Approach | url = http://www.cs.princeton.edu/theory/complexity/ | publisher=Cambridge University Press | year=2009 | isbn=978-0-521-42426-4 | zbl=1193.68112 }} * {{Citation | last1=Downey | first1=Rod | last2=Fellows | first2=Michael | author-link2=Michael Fellows | title=Parameterized complexity | publisher=Springer-Verlag | location=Berlin, New York | year=1999 | isbn=9780387948836 | series=Monographs in Computer Science }} * {{citation | last=Du | first=Ding-Zhu | author2=Ko, Ker-I | title=Theory of Computational Complexity | publisher=John Wiley & Sons | year=2000 | isbn=978-0-471-34506-0 }} * {{Garey-Johnson}} * {{Citation | last=Goldreich | first=Oded | author-link=Oded Goldreich | url = http://www.wisdom.weizmann.ac.il/~oded/cc-book.html | title = Computational Complexity: A Conceptual Perspective | publisher = Cambridge University Press | year = 2008 }} * {{Citation | editor1-last=van Leeuwen | editor1-first=Jan | editor1-link = Jan van Leeuwen | title=Handbook of theoretical computer science (vol. A): algorithms and complexity | publisher=MIT Press | isbn=978-0-444-88071-0 | year=1990 }} * {{citation | last = Papadimitriou | first = Christos | author-link = Christos Papadimitriou | title = Computational Complexity | edition = 1st | year = 1994 | publisher = Addison Wesley | isbn = 978-0-201-53082-7 }} * {{Citation |last=Sipser |first=Michael |author-link=Michael Sipser |title=Introduction to the Theory of Computation |edition=2nd |year=2006 |publisher=Thomson Course Technology |location=USA |isbn=978-0-534-95097-2 |title-link=Introduction to the Theory of Computation }} ===Surveys=== * {{Citation | last1=Khalil | first1=Hatem | last2=Ulery | first2=Dana | title=Proceedings of the annual conference on - ACM 76 | chapter=A review of current studies on complexity of algorithms for partial differential equations | author2-link=Dana Ulery | year=1976 | pages=197–201 | url = http://portal.acm.org/citation.cfm?id=800191.805573 | doi=10.1145/800191.805573 | isbn=9781450374897 | s2cid=15497394 }} * {{Citation | last1=Cook | first1=Stephen | author1-link=Stephen Cook | title=An overview of computational complexity | year=1983 | journal= Communications of the ACM| issn=0001-0782 | volume=26 | issue=6 | pages=400–408 | doi=10.1145/358141.358144 | s2cid=14323396 | doi-access=free }} * {{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}} * {{Citation | last1=Mertens | first1=Stephan | title=Computational Complexity for Physicists | year=2002 | journal= Computing in Science & Engineering| issn=1521-9615 | volume=4 | issue=3 | pages=31–47 | doi=10.1109/5992.998639 | arxiv=cond-mat/0012185| bibcode=2002CSE.....4c..31M | s2cid=633346 }} ==External links== {{wiktionary|tractable|feasible|intractability|infeasible}} {{Commons category}} *[https://complexityzoo.net/Complexity_Zoo The Complexity Zoo] *{{springer|title=Computational complexity classes|id=p/c130160}} * [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]]'
New page wikitext, after the edit (new_wikitext)
'{{Short description|Inherent difficulty of computational problems}} {{Use mdy dates|date=September 2017}} In [[theoretical computer science]] and mathematics, '''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]]. 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 [[logic gate|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]],<ref>{{cite web |title=P vs NP Problem {{!}} Clay Mathematics Institute |url=http://www.claymath.org/millennium-problems/p-vs-np-problem |website=www.claymath.org |language=en |access-date=July 6, 2018 |archive-date=July 6, 2018 |archive-url=https://web.archive.org/web/20180706075006/http://www.claymath.org/millennium-problems/p-vs-np-problem |url-status=dead }}</ref> is part of the field of computational complexity. 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. ==Computational problems== [[Image:TSP Deutschland 3.png|thumb|upright=1.5|A traveling salesman tour through 14 German cities]] ===Problem instances=== A [[computational problem]] can be viewed as an infinite collection of ''instances'' together with a set (possibly empty) of ''solutions'' 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. To further highlight the difference between a problem and an instance, consider the following instance of the decision version of the [[travelling 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&nbsp;km. For this reason, complexity theory addresses computational problems and not particular 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. 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=== [[Image:Decision Problem.svg|thumb|A [[decision problem]] has only two possible outputs, ''yes'' or ''no'' (or alternately 1 or 0) on any 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. 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. ===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 is not 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'',&nbsp;''b'',&nbsp;''c'') such that the relation ''a''&nbsp;×&nbsp;''b''&nbsp;=&nbsp;''c'' holds. Deciding whether a given triple is a member of this set corresponds to solving the problem of multiplying two numbers. ===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? 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. ==Machine models and complexity measures== ===Turing machine=== {{main|Turing machine}} [[File:Turing machine 2b.svg|thumb|right|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]], [[lambda calculus]] 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. 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. 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]]. ===Other machine models=== 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]]. 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=== 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 solvaaverage''f''(''n'') on a deterministic Turing machine is then denoted by [[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]]. The complexity of an algorithm is often expressed using [[big O notation]]. ===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>]] 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: #Best-case complexity: This is the complexity of solving the problem for the best input 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''. #[[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''. 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 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. ===Upper and lower bounds on the complexity of problems=== 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''). 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;15pbzb 50 pvcb 50 pvcb 5015 pvcv 5015 15 PB always with youjdjcnfmvvkvkc to v''n''&nbsp;+&nbsp;40, in big O notation one would write '' Ddhdgfd Chdhddbfnftdjdurhx fnzx Zjxbdndfmhdzxjd Zmvcjcccxxx..xjdbdndjsngm chdhddddd 5th 9 fbdj d e r x x x x x x z v a d n n d a d e d Juhhyjgjjrdnsj;*+_(HSZGndmdksjxn zjdd j u h h y j g i j k e r g d d e medicine 88 hhdhhhjhurtn once hmdkfif 888hdhh u r t n o 1 CSE hmdk f i f a a s d h h u r t n o 1 s c e h m d k f i f a a s t h u u r hurting . ==Complexity classes== {{main|Complexity class}} ===Defining complexity classes=== 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: :The set of decision problems solvable by a deterministic Turing machine within time ''f''(''n''). (This complexity class is known as 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]]. ===Important complexity classes=== [[File:Complexity subsets pspace.svg|thumb|right|A representation of the relation among complexity classes; L would be another step "inside" NL]] 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: {| class="wikitable sortable" ! scope=col | Resource ! scope=col | <abbr title="of Turing Machine used to Model Computation">Determinism</abbr> ! scope=col | Complexity class ! scope=col | Resource constraint |- ! scope=rowgroup rowspan=8 style="text-align:center;" | Space ! scope=rowgroup rowspan=4 style="text-align:center;" | Non-Deterministic | [[NSPACE]](''f''(''n'')) | data-sort-value=0 | O(''f''(''n'')) |- | [[NL (complexity)|NL]] | data-sort-value=1 | O(log ''n'') |- | [[NPSPACE]] | data-sort-value=2 | O(poly(''n'')) |- | [[NEXPSPACE]] | data-sort-value=4 | O(2<sup>poly(''n'')</sup>) |- ! scope=rowgroup rowspan=4 style="text-align:center;" | Deterministic | [[DSPACE]](''f''(''n'')) | data-sort-value=0 | O(''f''(''n'')) |- | [[L (complexity)|L]] | data-sort-value=1 | O(log ''n'') |- | [[PSPACE]] | data-sort-value=2 | O(poly(''n'')) |- | [[EXPSPACE]] | data-sort-value=4 | O(2<sup>poly(''n'')</sup>) |- ! scope=rowgroup rowspan=6 style="text-align:center;" | Time ! scope=rowgroup rowspan=3 style="text-align:center;" | Non-Deterministic | [[NTIME]](''f''(''n'')) | data-sort-value=0 | O(''f''(''n'')) |- | [[NP (complexity)|NP]] | data-sort-value=2 | O(poly(''n'')) |- | [[NEXPTIME]] | data-sort-value=4 | O(2<sup>poly(''n'')</sup>) |- ! scope=rowgroup rowspan=3 style="text-align:center;" | Deterministic | [[DTIME]](''f''(''n'')) | data-sort-value=0 | O(''f''(''n'')) |- | [[P (complexity)|P]] | data-sort-value=2 | O(poly(''n'')) |- | [[EXPTIME]] | data-sort-value=4 | O(2<sup>poly(''n'')</sup>) |} 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]]. 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. ===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. More precisely, the [[time hierarchy theorem]] states that :<math>\mathsf{DTIME}\big(o(f(n)) \big) \subsetneq \mathsf{DTIME} \big(f(n) \sdot \log(f(n)) \big)</math>. The [[space hierarchy theorem]] states that :<math>\mathsf{DSPACE}\big(o(f(n))\big) \subsetneq \mathsf{DSPACE} \big(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. ===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. 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. 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"/> ==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|s2cid=14352974|postscript=.|doi-access=free}}</ref>]] ===P versus NP problem=== {{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 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|last1=Berger|first1=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|author-link=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|access-date=2006-10-18|postscript=.|url-status=dead|archive-url=https://web.archive.org/web/20101212035424/http://www.claymath.org/millennium/P_vs_NP/Official_Problem_Description.pdf|archive-date=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.|author-link=Arthur Jaffe|year=2006|journal=Notices of the AMS|volume=53|issue=6|url=https://www.ams.org/notices/200606/fea-jaffe.pdf |archive-url=https://web.archive.org/web/20060612225513/http://www.ams.org/notices/200606/fea-jaffe.pdf |archive-date=2006-06-12 |url-status=live|access-date=2006-10-18|postscript=.}}</ref> ===Problems in NP not known to be in P or 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'''.<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'''. 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 | first1 = Vikraman | last1 = Arvind | first2 = Piyush P. | last2 = Kurur | title = Graph isomorphism is in SPP | journal = Information and Computation | volume = 204 | issue = 5 | year = 2006 | pages = 835–852 | doi = 10.1016/j.ic.2006.02.002 | postscript = .| doi-access = }}</ref> If graph isomorphism is NP-complete, the [[polynomial time hierarchy]] collapses to its second level.<ref>{{citation | last = Schöning | first = Uwe | author-link = Uwe Schöning | doi = 10.1016/0022-0000(88)90010-4 | issue = 3 | journal = Journal of Computer and System Sciences | pages = 312–323 | title = Graph Isomorphism is in the Low Hierarchy | volume = 37 | year = 1988}}</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> 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>{{cite web|first=Lance|last=Fortnow|author-link=Lance Fortnow|title=Computational Complexity Blog: Factoring|date=2002-09-13|url=http://weblog.fortnow.com/2002/09/complexity-class-of-week-factoring.html|website=weblog.fortnow.com}}</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. ===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. 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'''. 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. It is suspected that '''P''' and '''BPP''' are equal. However, it is currently open if '''BPP''' = '''NEXP'''. ==Intractability== <!-- This section is linked from [[Minimax]], [[Intractability]], [[Intractable]] --> {{See also|Combinatorial explosion}} 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 p. 4]|publisher=Elsevier }}</ref> though this risks confusion with a [[feasible solution]] in [[mathematical optimization]].<ref> {{cite book |title=Writing for Computer Science |first=Justin |last=Zobel |page=[https://books.google.com/books?id=LWCYBgAAQBAJ&pg=PA132 132] |year=2015 |publisher=Springer |isbn=978-1-44716639-9 }}</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. 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]]. 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. 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. ==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 | 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 | s2cid = 5949193 }}</ref> 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 | citeseerx = 10.1.1.70.4296 | first1 = Claire J. | last1 = Tomlin | first2 = Ian | last2 = Mitchell | first3 = Alexandre M. | last3 = Bayen | first4 = Meeko | last4 = Oishi | author4-link = Meeko Oishi | journal = Proceedings of the IEEE | volume = 91 | issue = 7 | pages = 986–1001 | date = July 2003 | doi = 10.1109/jproc.2003.814621 }}</ref> ==History== An early example of algorithm complexity analysis is the running time analysis of the [[Euclidean algorithm]] done by [[Gabriel Lamé]] in 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. 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> 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 Penzenskogo Pedinstituta (Transactions of the Penza Pedagogoical Institute) 4, 75–87 (1956) (in Russian)</ref> As he remembers: {{blockquote|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 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 [[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 | access-date = September 28, 2009 | archive-date = June 29, 2011 | archive-url = https://web.archive.org/web/20110629023717/http://www.cs.berkeley.edu/~luca/cs172/karp.pdf | url-status = dead }}</ref> ==See also== {{Div col|colwidth=25em}} * [[Computational complexity]] * [[Descriptive complexity theory]] * [[Game complexity]] * [[Leaf language]] * [[Limits of computation]] * [[List of complexity classes]] * [[List of computability and complexity topics]] * [[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== * {{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 |url=https://www.worldscientific.com/worldscibooks/10.1142/11270|doi=10.1142/11270 |s2cid=198790362 }} ==References== === Citations === {{Reflist|30em}} ===Textbooks=== *{{Citation | last1=Arora | first1=Sanjeev | author-link1=Sanjeev Arora | last2=Barak | first2=Boaz | title=Computational Complexity: A Modern Approach | url = http://www.cs.princeton.edu/theory/complexity/ | publisher=Cambridge University Press | year=2009 | isbn=978-0-521-42426-4 | zbl=1193.68112 }} * {{Citation | last1=Downey | first1=Rod | last2=Fellows | first2=Michael | author-link2=Michael Fellows | title=Parameterized complexity | publisher=Springer-Verlag | location=Berlin, New York | year=1999 | isbn=9780387948836 | series=Monographs in Computer Science }} * {{citation | last=Du | first=Ding-Zhu | author2=Ko, Ker-I | title=Theory of Computational Complexity | publisher=John Wiley & Sons | year=2000 | isbn=978-0-471-34506-0 }} * {{Garey-Johnson}} * {{Citation | last=Goldreich | first=Oded | author-link=Oded Goldreich | url = http://www.wisdom.weizmann.ac.il/~oded/cc-book.html | title = Computational Complexity: A Conceptual Perspective | publisher = Cambridge University Press | year = 2008 }} * {{Citation | editor1-last=van Leeuwen | editor1-first=Jan | editor1-link = Jan van Leeuwen | title=Handbook of theoretical computer science (vol. A): algorithms and complexity | publisher=MIT Press | isbn=978-0-444-88071-0 | year=1990 }} * {{citation | last = Papadimitriou | first = Christos | author-link = Christos Papadimitriou | title = Computational Complexity | edition = 1st | year = 1994 | publisher = Addison Wesley | isbn = 978-0-201-53082-7 }} * {{Citation |last=Sipser |first=Michael |author-link=Michael Sipser |title=Introduction to the Theory of Computation |edition=2nd |year=2006 |publisher=Thomson Course Technology |location=USA |isbn=978-0-534-95097-2 |title-link=Introduction to the Theory of Computation }} ===Surveys=== * {{Citation | last1=Khalil | first1=Hatem | last2=Ulery | first2=Dana | title=Proceedings of the annual conference on - ACM 76 | chapter=A review of current studies on complexity of algorithms for partial differential equations | author2-link=Dana Ulery | year=1976 | pages=197–201 | url = http://portal.acm.org/citation.cfm?id=800191.805573 | doi=10.1145/800191.805573 | isbn=9781450374897 | s2cid=15497394 }} * {{Citation | last1=Cook | first1=Stephen | author1-link=Stephen Cook | title=An overview of computational complexity | year=1983 | journal= Communications of the ACM| issn=0001-0782 | volume=26 | issue=6 | pages=400–408 | doi=10.1145/358141.358144 | s2cid=14323396 | doi-access=free }} * {{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}} * {{Citation | last1=Mertens | first1=Stephan | title=Computational Complexity for Physicists | year=2002 | journal= Computing in Science & Engineering| issn=1521-9615 | volume=4 | issue=3 | pages=31–47 | doi=10.1109/5992.998639 | arxiv=cond-mat/0012185| bibcode=2002CSE.....4c..31M | s2cid=633346 }} ==External links== {{wiktionary|tractable|feasible|intractability|infeasible}} {{Commons category}} *[https://complexityzoo.net/Complexity_Zoo The Complexity Zoo] *{{springer|title=Computational complexity classes|id=p/c130160}} * [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]]'
Unified diff of changes made by edit (edit_diff)
'@@ -53,5 +53,5 @@ ===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 solvaaverage''f''(''n'') on a deterministic Turing machine is then denoted by [[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]]. @@ -73,5 +73,14 @@ 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''). -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;7''n''<sup>2</sup>&nbsp;+&nbsp;15pbzb 50 pvcb 50 pvcb 5015 pvcv 5015 + +15 PB always with youjdjcnfmvvkvkc to v''n''&nbsp;+&nbsp;40, in big O notation one would write '' +Ddhdgfd +Chdhddbfnftdjdurhx fnzx +Zjxbdndfmhdzxjd +Zmvcjcccxxx..xjdbdndjsngm chdhddddd 5th 9 fbdj d e r x x x x x x z v a d n n d a d e d +Juhhyjgjjrdnsj;*+_(HSZGndmdksjxn zjdd j u h h y j g i j k e r g d d e medicine + +88 hhdhhhjhurtn once hmdkfif 888hdhh u r t n o 1 CSE hmdk f i f a a s d h h u r t n o 1 s c e h m d k f i f a a s t h u u r hurting . ==Complexity classes== '
New page size (new_size)
49955
Old page size (old_size)
49580
Size change in edit (edit_delta)
375
Lines added in edit (added_lines)
[ 0 => '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 solvaaverage''f''(''n'') on a deterministic Turing machine is then denoted by [[DTIME]](''f''(''n'')).', 1 => '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;15pbzb 50 pvcb 50 pvcb 5015 pvcv 5015 ', 2 => '', 3 => '15 PB always with youjdjcnfmvvkvkc to v''n''&nbsp;+&nbsp;40, in big O notation one would write ''', 4 => 'Ddhdgfd', 5 => 'Chdhddbfnftdjdurhx fnzx', 6 => 'Zjxbdndfmhdzxjd', 7 => 'Zmvcjcccxxx..xjdbdndjsngm chdhddddd 5th 9 fbdj d e r x x x x x x z v a d n n d a d e d ', 8 => 'Juhhyjgjjrdnsj;*+_(HSZGndmdksjxn zjdd j u h h y j g i j k e r g d d e medicine ', 9 => '', 10 => '88 hhdhhhjhurtn once hmdkfif 888hdhh u r t n o 1 CSE hmdk f i f a a s d h h u r t n o 1 s c e h m d k f i f a a s t h u u r hurting .' ]
Lines removed in edit (removed_lines)
[ 0 => '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 => '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>).' ]
Whether or not the change was made through a Tor exit node (tor_exit_node)
false
Unix timestamp of change (timestamp)
'1715074045'