Toc CHP-5
Toc CHP-5
Toc CHP-5
5.1 Introduction
Complexity theory considers not only whether a problem can be solved at all on a computer (as
computability theory), but also how efficiently the problem can be solved. Thus, the complexity
theory classifies problems according to their degree of “difficulty”. Two major aspects are
considered: time complexity and space complexity, which are respectively how many steps does
it take to perform a computation, and how much memory is required to perform that
computation. Although the time and space complexity are dependent of input problem but it is
more complexity issue, so computer scientists have adopted Big O notation that compare the
asymptotic behavior of large problems.
Complexity classes
Complexity class Model of computation Resource constraint
P Deterministic Turing machine Time poly(n)
EXPTIME Deterministic Turing machine Time 2poly(n)
NP Non-deterministic Turing machine Time poly(n)
NEXPTIME Non-deterministic Turing machine Time 2poly(n)
L Deterministic Turing machine Space O(log n)
PSPACE Deterministic Turing machine Space poly(n)
EXPSPACE Deterministic Turing machine Space 2poly(n)
NL Non-deterministic Turing machine Space O(log n)
NPSPACE Non-deterministic Turing machine Space poly(n)
NEXPSPACE Non-deterministic Turing machine Space 2poly(n)
P versus NP problem
The complexity class P is often seen as a mathematical
abstraction modeling those computational tasks that admit an
efficient algorithm.
The complexity class NP, on the other hand, contains many
problems that people would like to solve efficiently, but for
Theory of Computation - Compiled by Yagya Raj Pandeya, NAST, Dhangadhi ©[email protected] Page 1
Informally the class P is the class of decision problems solvable by some algorithm within a
number of steps bounded by some fixed polynomial in the length of the input. Turing was not
concerned with the efficiency of his machines, but rather his concern was whether they can
simulate arbitrary algorithms given sufficient time. However it turns out Turing machines can
generally simulate more efficient computer models (for example machines equipped with many
tapes or an unbounded random access memory) by at most squaring or cubing the computation
time. Thus P is a robust class, and has equivalent definitions over a large class of computer
models.
NP-completeness
NP-complete is a subset of NP, the set of all decision problems whose solutions can be verified in
polynomial time; NP may be equivalently defined as the set of decision problems that can be
solved in polynomial time on a nondeterministic Turing machine.
NP-hard problems
Some problem that proves the condition – (2) of
NP-completeness problem but not the condition –
(1) is called the NP-hard problem. They are
intractable problems.
Theory of Computation - Compiled by Yagya Raj Pandeya, NAST, Dhangadhi ©[email protected] Page 2