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

Intractability

The theory of Intractability is the study of problems that are not solvable in polynomial time. Certain
computational problems are solvable in principle, but the solutions require so much time or space that
they can't be used in practice. Such problems are called intractable. The problems can be fundamentally
classified as those solved in polynomial time and those solvable in exponential time. Hard problems are
those problems whose solution takes exponential time. If a problem has a solution that is obtainable in
polynomial time, then it is called easy.

An example for an intractable problem is the travelling salesman problem. The travelling salesman
problem consists of finding the shortest tour that connects n points in a given plane. One method is to
consider all n! routes and calculate the length of each to find the shortest route. If n=16, there are 16!
routes which is impractical for any computer. A tractable solution to the travelling salesman problem is
still unknown and many practical, optimization and scheduling problems have similar complexity.

Intractable Problem

An intractable problem is one which cannot be solved using polynomial time or space. Such problems can
be solved, but not fast enough for the solution to be usable and are called intractable. An example for
intractable problem can be the question of whether a Boolean expression can be satisfied, that is, made
true for some assignment of the truth values TRUE and FALSE to its variables. This problem plays the
role for intractable problems that Lu played for undecidable problems. Thus we can reduce this problem
to many other problems, which are thus shown intractable as well.

To prove a problem to be solvable in polynomial time, the notion of reduction must change. It is not only
sufficient to prove that an algorithm exists for a problem but also necessary that the algorithm takes
polynomial time. Thus we require “polynomial reductions” for these problems. All intractable problems
are studied based on a strongly believed assumption P≠NP. Here P is the class of problems that are
solvable in polynomial time by a deterministic TM and NP is the class of problems that can be solved
only by a nondeterministic TM in polynomial time. The statement P≠NP means that the class NP has
some problems which are not in class P. So every problem with a nondeterministic TM does not have a
corresponding deterministic TM. An important consequence of the theory of intractability is that either
all these problems have polynomial-time deterministic solutions, or none do; i.e., they really require
exponential time.

The discussion on intractable problems classifies the problems into three classes: class P, class NP and
NP-complete problems.

Class P

A problem is assigned to the P (polynomial time) class if there exists at least one algorithm to solve that
problem, such that the number of steps of the algorithm is bounded by a polynomial in n, where n is the
length of the input. It contains all decision problems which can be solved by a deterministic Turing
machine using a polynomial amount of computation time, or polynomial time. P is also the class of
languages where the membership in the language can be tested in polynomial time.

There is a dramatic difference between polynomial time algorithm and exponential time algorithm.
Consider the polynomial time algorithm with a running time of the order n3 and an exponential time
algorithm of the order 2n. For example, let n be 1000, the size of a reasonable input to an algorithm. In
that case, n3 is 1 billion, a large, but manageable number, whereas 2n is a number much larger than the
number of atoms in the universe. Polynomial time algorithms are fast enough for many purposes, but
exponential time algorithms rarely are useful.

Exponential time algorithms typically arise when we solve problems by exhaustively searching through a
space of solutions, called brute-force search. Sometimes, brute-force search may be avoided through a
deeper understanding of a problem, which may reveal a polynomial time algorithm of greater utility. All
reasonable deterministic computational models are polynomially equivalent. That is, anyone of them can
simulate another with only a polynomial increase in running time.

A formal definition for class P problems can be given:

P is the class of languages that are decidable in polynomial time on a deterministic single-tape Turing
machine. In other words,

The importance of class P problems is,

• P is invariant for all models of computation that are polynomially equivalent to the deterministic
single-tape Turing machine.
• P roughly corresponds to the class of problems that are realistically solvable on a computer.

The first point indicates that P is a mathematically robust class. It isn't affected by the particulars of the
model of computation that we are using. The second point means that the algorithm is a practical one.
That is, we have a method of solving it that runs in time n k for some constant k. Whether this running
time is practical depends on k and on the application because a running time of n100 for example will not
be practically polynomial.

Example of Class P problem

An example for a problem solvable in polynomial time is finding a minimum weight spanning tree
(MWST) for a given graph. The solution for this problem is given by Kruskal’s algorithm. As we know, a
graph consists of a finite number of vertices and a finite set of edges connecting those vertices. An
example graph is shown in Figure A. Each edge in a weighted graph is associated with a weight and a
spanning tree represents a collection of edges such that all nodes are connected through these edges with
no cycles. A minimum spanning tree is the spanning tree with the smallest total edge weight among all
the spanning trees. An example for a spanning tree is shown in Figure B.
12

15
1 2

10
20

3 4
18

Figure A: Graph with 4 vertices.

10

2 3 4
12 18

Figure B: Minimum weight spanning tree for graph in fig A

Kruskal’s algorithm is a greedy strategy which gives the MWST in polynomial time. A greedy
algorithm is any algorithm that follows the problem solving technique of making the locally optimum
choice at each stage with the hope of finding the global optimum solution. The algorithm is stated below:

1. Create a forest F (a set of trees), where each vertex in the graph is a separate tree.
2. While S is nonempty
a. Remove an edge with minimum weight from S.
b. If that edge connects two different trees, then add it to the forest, combining two trees
into a single tree.
c. Otherwise discard that edge.
3. At the termination of the algorithm, the forest has only one component and forms a minimum
spanning tree of the graph.

In the graph of Fig A, we first consider the edge (1,3), because it has the lowest weight, 10. Since 1 and 3
are initially in different components, we accept this edge, and make 1 and 3 have the same component
number, say “component 1.” The next edge in order of weights is (2, 3), with weight 12. Since 2 and 3 are
in different components, we accept this edge and merge node 2 into “component 1.” The third edge is
(1,2), with weight 15. However, 1 and 2 are now in the same component so we reject this edge and
proceed to the fourth edge, (3, 4). Since 4 is not in “component 1,” we accept this edge. Now, we have
three edges for the spanning tree of a 4-node graph (Fig B), and so may stop.

Class NP

NP is one of the most fundamental complexity classes. The abbreviation NP refers to "Non-
deterministic Polynomial time" and the class NP consists of those problems that can be solved by a
nondeterministic TM that runs in polynomial time. Formally, we say a language L is in the class NP if
there is a nondeterministic TM M and a polynomial time complexity T (n) such that L = L (M), and when
M is given an input of length n, there are no sequences of more than T(n) moves of M. NP is also the
class of languages where the membership in the language can be verified in polynomial time.

In other words, when run on a deterministic TM, the problem will take exponential time.

Since every deterministic TM can be considered as a non-deterministic TM with no choice for moves,

every P problem is also an NP problem (P NP). And NP class has many problems that are not in P. This
is because a nondeterministic TM solving an NP problem has the ability to guess exponential number of
possible solutions and these solutions can each be checked in polynomial time with all running in parallel.

The P versus NP Question

One of the most important questions indeterminate till date is whether P=NP i.e, whether in fact
everything that can be done in polynomial time by a nondeterministic TM can be done by a deterministic
TM in polynomial time, perhaps with a higher-degree polynomial. Both the classes can be summarized
as,

P = the class of languages for which membership can be decided quickly.


NP = the class of languages for which membership can be verified quickly.
If these classes were equal, any polynomially verifiable problem would be polynomially decidable. Most
researchers believe that the two classes are not equal because people have invested enormous effort to
find polynomial time algorithms for certain problems in NP, without success. Researchers also have tried
proving that the classes are unequal, but that would be like showing that no fast algorithm exists to
replace brute-force search. Doing so is presently beyond scientific reach. The following figure shows the
two possibilities.

Figure C: One of the two possibilities is correct.

In short, NP class problems are those when solved using deterministic methods take exponential but, we
are still not able to prove that a polynomial time solution exist or not.

Example of Class NP problem

A popular NP problem is the “Travelling salesman problem” (TSP) which has no polynomial solution
available till date. The problem description is as follows: A travelling salesman is to visit a number of
cities and he has to plan the trip so every city is visited once and just once returning to where he started
and the whole trip is as short as possible. The cities and the paths connecting the cities can be represented
by a graph with nodes as cities and edges as the paths. The paths are weighted representing the distance
between the cities they connect. The problem can be presented in another form as finding a Hamiltonian
circuit of total weight at most W. The Hamiltonian circuit in a graph is a set of edges connecting every
node in the graph into a single cycle so that each node appears exactly once. So a minimum weighted
Hamiltonian circuit is indeed the path the travelling salesman has to take to make his journey as short as
possible.

Consider the graph given in Fig: A, it actually has only one Hamilton circuit: the cycle (1, 2, 4, 3, 1) and
is shown in Fig D. The total weight of this cycle is 15 + 20 + 18 + 10 = 63. Thus, if W is 63 or more, the
answer is "yes," and if W < 63 the answer is no. In this example, finding the Hamiltonian circuit is easy
because there can never be more than two such circuits possible. But for m-node graphs, the number of
distinct cycle grows as O (m!).

The most obvious algorithm to TSP is to try out all possible to arrive at the minimum possible path. And
if we observe more closely, we may eliminate some unwanted trials. But what ever we do, we must
examine an exponent number of cycles before we can conclude that there is none with the desired weight
limit W. But if we use a nondeterministic algorithm, it is possible to guess a permutation of the nodes
and compute the total weight for the cycle of nodes in that order. If there were a real nondeterministic
computer, no branch would use more than O (n) steps, if the input was of length n. In a multi tape
nondeterministic TM, we can guess a permutation in O (n2) steps and check its total weight in a similar
amount of time. Then a single tape nondeterministic TM can surely solve the TSP in O (n4). Thus we
conclude that TSP is an NP problem.

Class NP-Complete
The NP-complete is a class of problems having two properties:

 Any given solution to the problem can be verified quickly (in polynomial time); the set of
problems with this property is called NP.
 If the problem can be solved quickly (in polynomial time), then so can every problem in NP.

Although any given solution to such a problem can be verified quickly, there is no known efficient way to
locate such a solution and the most notable characteristic of NP-complete problems is that no fast
solution to them is known. That is, the time required to solve the problem using any currently
known algorithm increases very quickly as the size of the problem grows. As a result, the time required to
solve even moderately large versions of many of these problems easily reaches into the billions or
trillions of years, using any amount of computing power available today. As a consequence, determining
whether or not it is possible to solve these problems quickly is one of the principal unsolved problems in
computer science today.

The NP-complete problems belong to the class NP but are not in class P. Let L be a language (problem) in
NP. We say L is NP-complete if the following statements are true about L:
1. L is in NP.
2. For every language L’ in NP there is a polynomial-time reduction of L’ to L.

An example to NP-complete problem is the travelling salesman problem (TSP) previously discussed in
NP problem. Since we know P≠NP, the NP-complete problems belong to a class NP-P. And also a proof
that a particular problem is in NP-complete is also a proof that the problem is not in P.

NP-Hard

NP-hard (nondeterministic polynomial-time hard) is a class of problems informally stated as "at least as
hard as the hardest problems in NP." A problem H is NP-hard if and only if there is an NP-
complete problem L that is polynomial time Turing-reducible to H. That is the second condition of NP-
complete problems hold true for an NP-hard problem. But the first condition (L is in NP) cannot be
proved. The term intractable can be meaningfully associated with NP-hard problems. A proof that L is
NP-hard is sufficient to show that L is very likely to require exponential time, or worse. The travelling
salesman problem also falls into the category of NP-hard problems. The relationship between P, NP, Np-
complete and NP-hard problems are shown in Fig D for both P=NP and P≠NP.
Figure D: Relationship between all the four classes.

We shall prove a problem, called SAT (for boolean satisfiability) to be NP-complete by showing that the
language of every polynomial-time NTM has a polynomial time reduction to SAT. However, once we
have some NP-complete problems, we can prove a new problem to be NP-complete by reducing some
known NP-complete problem to it, using a polynomial-time reduction. The following theorem shows why
such a reduction proves the target problem to be NP-complete.

Theorem 1: If P1 is NP-complete, P2 is in NP and there is a polynomial-time reduction of P1 to P2, then P2


is NP-complete.

Proof: We need to show that every language L in NP polynomial-time reduces to P2. We know that there
is a polynomial-time reduction of L to P1; this reduction takes some polynomial time p (n). Thus, a string
w in L of length n is converted to a string x in P of length at most p (n).
We also know that there is a polynomial-time reduction of P1 to P2; let this reduction take polynomial
time q(m). Then this reduction transforms x to some string y in P2, taking time at most q(p(n)). Thus, the
transformation of w to y takes time at most p(n) + q(p(n)), which is a polynomial. We conclude that L is
polynomial-time reducible to P2. Since L could be any language in NP, we have shown that all of NP
polynomial-time reduces to P2; i.e., P2 is NP-complete.
Example of NP-complete problem

The NP-complete problem that we present is called the satisfiability problem for Boolean expressions.
The boolean expressions are built from:
1. Variables whose values are boolean; i.e., they either have the value 1 (true) or 0 (false).
2. Binary operators ˄ and ˅, standing for the logical AND and OR of two expressions.
3. Unary operator ¬ standing for logical negation.
4. Parentheses to group operators and operands, if necessary to alter the default precedence of
operators: ¬ highest, then ˄, and finally ˅.

Some examples are described in the following list.


0˄0==0 0˅0=0 ¬ 0=1

0˄1==0 0˅1=1 ¬ 1=0

1˄0==0 1˅0=1

1˄1==1 1˅1=1

A Boolean formula is an expression involving Boolean variables and operations. For example,
ϕ = (¬ x ˄ y) ˅ (x ˄ ¬ z)
is a Boolean formula. A Boolean formula is satisfiable if some assignment of 0s and 1s to the variables
makes the formula evaluate to 1. The preceding formula is satisfiable because the assignment x == 0, y
== 1, and z == 0 makes ϕ evaluate to 1.We say the assignment satisfies ϕ. The satisfiability problem
(SAT) is to test whether a Boolean formula is satisfiable. Let
SAT == {(ϕ) | ϕ is a satisfiable Boolean formula}.

The SAT problem is NP-Complete and is stated in a theorem called Cook-Levin theorem as “SAT ϵ P if
and only if P=NP”.

You might also like