DESIGN AND ANALYSIS OF ALGORITHMS Page 100
DESIGN AND ANALYSIS OF ALGORITHMS Page 101
Cook’s Theorem: States that satisfiability is in P if and only if P=NP If
P=NP then satisfiability is in P
If satisfiability is in P, then P=NP
To do this
> A-) Any polynomial time nondeterministic decision algorithm.
I-)Input of that algorithm
Then formula Q(A, I), Such that Q is satisfiable iff ‘A’ has a successful
termination with Input I.
> If the length of ‘I’ is ‘n’ and the time complexity of A is p(n) for some polynomial
p() then length of Q is O(p3(n) log n)=O(p4(n))
The time needed to construct Q is also O(p3(n) log n).
> A deterministic algorithm ‘Z’ to determine the outcome of ‘A’ on any input ‘I’
Algorithm Z computes ‘Q’ and then uses a deterministic algorithm for the
satisfiability problem to determine whether ‘Q’ is satisfiable.
> If O(q(m)) is the time needed to determine whether a formula of length ‘m’ is
satisfiable then the complexity of ‘Z’ is O(p (n) log n + q(p (n)log n)).
3 3
> If satisfiability is ‘p’, then ‘q(m)’ is a polynomial function of ‘m’ and the
complexity of ‘Z’ becomes ‘O(r(n))’ for some polynomial ‘r()’.
> Hence, if satisfiability is in p, then for every nondeterministic algorithm A in NP, we
can obtain a deterministic Z in p.
By this we shows that satisfiability is in p then P=NP
DESIGN AND ANALYSIS OF ALGORITHMS Page 102