NP –Hard and NP –complete problems
#Basic Concepts :
   i)    The distinction between Problems that can be solved by a polynomial time
         algorithm & Problems for which no polynomial time algorithm is known.
   ii)   This makes two groups for computing time of an algorithm soln.

       P problem: a decision problem which can be solved by a polynomial algorithm, such as
the MST decision problem and the longest common subsequence decision problem.
NP problem: a decision problem which can be solved by a nondeterministic
polynomial algorithm,such as the SAT(satisfiability problem ) problem and the traveling
salesperson decision problem.
Every P problem must be an NP problem
(i.e., P ⊆ NP).

Theory of NP-Completeness:
P > The general class of questions for which some algorithm can provide an answer in
polynomial time is called "class P" or just "P".
NP > For some questions, there is no known way to find an answer quickly, but if one is
provided with information showing what the answer is, it may be possible to verify the answer
quickly. The class of questions for which an answer can be verified in polynomial time is called
NP .
NP-Complete
If any NP-complete problem can be solved in polynomial time, NP = P.

Up to now, no NP-complete problem has any worst case
polynomial algorithm.
There are thousands of problems proved to be NP-complete problems.
If the decision version of an optimization problem is NP-complete, this optimization
problem is called NP-hard.
Nondeterministic algorithm
 a deterministic algorithm is an algorithm which, in informal terms, behaves predictably. Given
a particular input, it will always produce the same output, and the underlying machine will always
pass through the same sequence of states.
a nondeterministic algorithm is an algorithm that can exhibit different behaviors on different
runs, as opposed to a deterministic algorithm.
A nondeterministic algorithm performs in three function:
   Choice( ) > chooses one of elements of set S.
   Success ( ) > signals a successful completion.
  Failure ( ) > signals a un-successful completion.

Reducibility

a reduction is a transformation of one problem into another problem.

Depending on the transformation used this can be used to define complexity classes on a set of
problems.

problem A is reducible to problem B if solutions to B exist and give solutions to A whenever A
has solutions.
A very simple example of a reduction is from multiplication to squaring. Suppose all we know

how to do is to add, subtract, take squares, and divide by two. We can use this knowledge,

combined with the following formula, to obtain the product of any two numbers:




COOK’s THEOREM
It states that “satisfiability is in P iff P=NP”
     To explain above theorem consider X1 , X2, X3,X4 are Boolean variables
     X is negation of X.
     Consider the following formula
       A = (X1 X2)         ( X3 X4 ) ----------(i)


        A = (X1       X2)     (X3      X4) --------------( ii)

         Where
                    denotes or (||) And          denotes and (&&).


                                                                                    k
        A formula is Conjunctive Normal Form [CNF] iff it is represented as   i=1        Ci

        Where Ci are clauses each represented as             Lij .

                                                                                              k
     A formula is Dis - Conjunctive Normal Form [DNF] iff it is represented as          i=1       Ci

        Where Ci are clauses each represented as            Lij .

     i.e. (i) is DNF and (ii) is CNF

  The  satisfiability is a process to determine whether the formula is TRUE for some assignment of
truth values to the variables.

Satisfiability is in NP

Hence NP =P.

Satisfiability is in P also.
NP-Hard Graph Problems

The graph coloring problem is the special case of is NP-hard graph problem.

 Definition >
 The graph (or vertex) coloring problem, which involves assigning colors to vertices in a graph
such that adjacent vertices have distinct colors.
 Or
   A coloring of a graph G assigns colors to the vertices of G so that adjacent vertices are given
   different colors.
         The minimal number of colors required to color a graph is called the chromatic number
and denoted

Ca notes

  • 1.
    NP –Hard andNP –complete problems #Basic Concepts : i) The distinction between Problems that can be solved by a polynomial time algorithm & Problems for which no polynomial time algorithm is known. ii) This makes two groups for computing time of an algorithm soln. P problem: a decision problem which can be solved by a polynomial algorithm, such as the MST decision problem and the longest common subsequence decision problem. NP problem: a decision problem which can be solved by a nondeterministic polynomial algorithm,such as the SAT(satisfiability problem ) problem and the traveling salesperson decision problem. Every P problem must be an NP problem (i.e., P ⊆ NP). Theory of NP-Completeness: P > The general class of questions for which some algorithm can provide an answer in polynomial time is called "class P" or just "P". NP > For some questions, there is no known way to find an answer quickly, but if one is provided with information showing what the answer is, it may be possible to verify the answer quickly. The class of questions for which an answer can be verified in polynomial time is called NP . NP-Complete If any NP-complete problem can be solved in polynomial time, NP = P. Up to now, no NP-complete problem has any worst case polynomial algorithm. There are thousands of problems proved to be NP-complete problems. If the decision version of an optimization problem is NP-complete, this optimization problem is called NP-hard.
  • 2.
    Nondeterministic algorithm adeterministic algorithm is an algorithm which, in informal terms, behaves predictably. Given a particular input, it will always produce the same output, and the underlying machine will always pass through the same sequence of states. a nondeterministic algorithm is an algorithm that can exhibit different behaviors on different runs, as opposed to a deterministic algorithm. A nondeterministic algorithm performs in three function: Choice( ) > chooses one of elements of set S. Success ( ) > signals a successful completion. Failure ( ) > signals a un-successful completion. Reducibility a reduction is a transformation of one problem into another problem. Depending on the transformation used this can be used to define complexity classes on a set of problems. problem A is reducible to problem B if solutions to B exist and give solutions to A whenever A has solutions.
  • 3.
    A very simpleexample of a reduction is from multiplication to squaring. Suppose all we know how to do is to add, subtract, take squares, and divide by two. We can use this knowledge, combined with the following formula, to obtain the product of any two numbers: COOK’s THEOREM It states that “satisfiability is in P iff P=NP”  To explain above theorem consider X1 , X2, X3,X4 are Boolean variables  X is negation of X.  Consider the following formula A = (X1 X2) ( X3 X4 ) ----------(i) A = (X1 X2) (X3 X4) --------------( ii) Where denotes or (||) And denotes and (&&). k A formula is Conjunctive Normal Form [CNF] iff it is represented as i=1 Ci Where Ci are clauses each represented as Lij . k A formula is Dis - Conjunctive Normal Form [DNF] iff it is represented as i=1 Ci Where Ci are clauses each represented as Lij . i.e. (i) is DNF and (ii) is CNF The satisfiability is a process to determine whether the formula is TRUE for some assignment of truth values to the variables. Satisfiability is in NP Hence NP =P. Satisfiability is in P also.
  • 4.
    NP-Hard Graph Problems Thegraph coloring problem is the special case of is NP-hard graph problem. Definition > The graph (or vertex) coloring problem, which involves assigning colors to vertices in a graph such that adjacent vertices have distinct colors. Or A coloring of a graph G assigns colors to the vertices of G so that adjacent vertices are given different colors. The minimal number of colors required to color a graph is called the chromatic number and denoted