Escolar Documentos
Profissional Documentos
Cultura Documentos
ISSAM ALHADID
15/4/2019
Decision and Optimization Problems.
Polynomial Time vs. Non-Polynomial Time.
Three General Problem Categories.
The Sets P and NP.
NP-Complete Problems.
NP-Hard Problems.
NP-Hard vs. NP-Complete Problems.
Most of the problems we have dealt with thus
far in the class are optimization problems, in
which the goal is to find the maximum or
minimum value of a quantity and maybe also
find the particular solution that achieves this
maximum/minimum value. For example, in
the SHORTESTPATH problem, we are given an
undirected graph G = (V, E) and vertices s and
t, and we wish either to find the length of the
shortest path from s to t, or to find the
shortest path from s to t itself>
decision problems, in which the answer is
simply “yes” or “no” (or formally 1 or 0). This
is not restrictive at all: we can always cast a
given optimization problem as a related
decision problem by imposing a bound on
the value to be optimized.
For example, a decision problem related to
SHORTEST-PATH is PATH: given a directed
graph G = 1 (V, E), vertices s and t, and an
integer k, does a path exist from s to t that
consists of at most k edges?
There is an interesting relationship between a
decision problem and its related optimization
problem: the decision problem is in a sense “easier”,
or at least “no harder”.
As a specific example, we can solve PATH by solving
SHORTEST-PATH and then comparing the number of
the edges in the shortest path found to the value of
the decision-problem parameter k.
Stated in a different way, if an optimization problem
is easy, its corresponding decision problem is also
easy.
A decision problem has only two possible
solutions: “Yes” or “No”.
Example: TSP
Examples: http://lcm.csa.iisc.ernet.in/dsa/node219.html
1st: Problems for which polynomial-time
algorithms have been found:
2nd: Problems that have been proven to be
intractable:
◦ There are two types of problems of this category:
The first type is problems that require a non-
polynomial amount of output.
For example, the problem of determining all
Hamiltonian cycles. If there was an edge from every
vertex to every other vertex, there would be (n – 1)!
such cycles.
To solve the problem, an algorithm would have to
output all of these cycles.
Example: for 51 vertices… we will have …. Cycles !
2nd: Problems that have been proven to be
intractable:
◦ There are two types of problems of this category:
The second type occurs when we are not asking for a
non-polynomial amount of output, and we can prove
that the problem cannot be solved in polynomial
time.
3rd: Problems that have not been proven to be
intractable, but for which polynomial-time
algorithms have never been found:
◦ For example, if we state the problems to require one
solution, the 0/1 knapsack problem, the TSP
problem, and the Hamiltonian cycles problem all fall
into this category.
Definition: P is the set of all decision problems that
can be solved by Polynomial-time algorithms.
However, could some decision problem for which we
have not found a polynomial-time algorithm also be in
P?
For example, could the TSP Decision problem be in P?
An algorithm composed of the following two
separate stages:
1. Guessing (Non-Deterministic) Stage: Given
an instance of a problem, this stage simply
produces some string S. The string can be
thought of as a guess at a solution to the
instance. However, it could just be a string
of nonsense.
An algorithm composed of the following two
separate stages:
2. Verification (Deterministic) Stage: The
instance and the string S are the input to
this stage. This stage then proceeds in an
ordinary deterministic manner either:
A non-deterministic algorithm “solves” a
decision problem if:
◦ For any instance for which the answer is “yes” there
is some string S for which the verification stage
returns “true”.
◦ For any instance for which the answer is “no” there
is no string for which the verification stage returns
“true”.
Definition: A polynomial-time non- deterministic
algorithm is a non-deterministic algorithm whose
verification stage is a polynomial-time algorithm.