Calculation-Resource Bond

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Resource bounds[edit]

Complexity classes group computational problems by their resource


requirements. To do this, computational problems are differentiated by upper
bounds on the maximum amount of resources that the most efficient algorithm
takes to solve them. More specifically, complexity classes are concerned with
the rate of growth in the resources required to solve particular computational
problems as the input size increases. For example, the amount of time it takes to
solve problems in the complexity class P grows at a polynomial rate as the input
size increases, which is comparatively slow compared to problems in the
exponential complexity class EXPTIME (or more accurately, for problems
in EXPTIME that are outside of P, since ).
Note that the study of complexity classes is intended primarily to understand
the inherent complexity required to solve computational problems. Complexity
theorists are thus generally concerned with finding the smallest complexity class
that a problem falls into and are therefore concerned with identifying which
class a computational problem falls into using the most efficient algorithm.
There may be an algorithm, for instance, that solves a particular problem in
exponential time, but if the most efficient algorithm for solving this problem
runs in polynomial time then the inherent time complexity of that problem is
better described as polynomial.
Time bounds[edit]
Main article: Time complexity
The time complexity of an algorithm with respect to the Turing machine model
is the number of steps it takes for a Turing machine to run an algorithm on a
given input size. Formally, the time complexity for an algorithm implemented
with a Turing machine  is defined as the function , where  is the maximum
number of steps that  takes on any input of length .
In computational complexity theory, theoretical computer scientists are
concerned less with particular runtime values and more with the general class of
functions that the time complexity function falls into. For instance, is the time
complexity function a polynomial? A logarithmic function? An exponential
function? Or another kind of function?
Space bounds[edit]
Main article: Space complexity
The space complexity of an algorithm with respect to the Turing machine model
is the number of cells on the Turing machine's tape that are required to run an
algorithm on a given input size. Formally, the space complexity of an algorithm
implemented with a Turing machine  is defined as the function , where  is the
maximum number of cells that  uses on any input of length .
Basic complexity classes[edit]
See also: List of complexity classes
Basic definitions[edit]
Complexity classes are often defined using granular sets of complexity classes
called DTIME and NTIME (for time complexity)
and DSPACE and NSPACE (for space complexity). Using big O notation, they
are defined as follows:
 The time complexity class  is the set of all problems that are decided by
an  time deterministic Turing machine.
 The time complexity class  is the set of all problems that are decided by
an  time nondeterministic Turing machine.
 The space complexity class  is the set of all problems that are decided by
an  space deterministic Turing machine.
 The space complexity class  is the set of all problems that are decided by
an  space nondeterministic Turing machine.
Time complexity classes[edit]
Main article: Time complexity
P and NP[edit]
Main articles: P (complexity) and NP (complexity)
P is the class of problems that are solvable by a deterministic Turing
machine in polynomial time and NP is the class of problems that are solvable by
a nondeterministic Turing machine in polynomial time. Or more formally,
P is often said to be the class of problems that can be solved "quickly" or
"efficiently" by a deterministic computer, since the time complexity of solving a
problem in P increases relatively slowly with the input size.
An important characteristic of the class NP is that it can be equivalently defined
as the class of problems whose solutions are verifiable by a deterministic Turing
machine in polynomial time. That is, a language is in NP if there exists
a deterministic polynomial time Turing machine, referred to as the verifier, that
takes as input a string  and a polynomial-size certificate string , and
accepts  if  is in the language and rejects  if  is not in the language. Intuitively,
the certificate acts as a proof that the input  is in the language. Formally:[4]
NP is the class of languages  for which there exists a polynomial-time
deterministic Turing machine  and a polynomial  such that for all ,  is in  if and
only if there exists some  such that  accepts.
This equivalence between the nondeterministic definition and the verifier
definition highlights a fundamental connection between nondeterminism and
solution verifiability. Furthermore, it also provides a useful method for proving
that a language is in NP—simply identify a suitable certificate and show that it
can be verified in polynomial time.

You might also like