Download Absorption Costing Variable Costing and more Lecture notes Ethics in PDF only on Docsity!
Introduction to Algorithms
6.046J/18.
Lecture 23
Prof. Piotr Indyk
Proof (compl Q. How many h a ’s cause A. There are m choices f but once these are cho any h a ’s cause x and y to co re m choices for each of a ,
© Piotr Indyk Introduction to Algorithms May 6, 2008 L20. P vs NP (interconnectedness of all things)
- A whole course by itself
- We’ll do just two lectures
- More in 6.045, 6.840J, etc.
© Piotr Indyk Introduction to Algorithms May 6, 2008 L20. Example difficult problem
- Traveling Salesperson Problem (TSP) - Input: undirected graph with lengths on edges - Output: shortest tour that visits each vertex exactly once
- Best known algorithm: O(n 2 n ) time.
%"(&(.'(&#$ 2 &,( 2 /'#%) &&)
%
(!,)(. !
!
2 ) 5+'+* /4%1)+ 5 & /'#%)1
!
(!,1 2 )"%&-%#&(! $
% $!$ 3!&(%." $(
© Piotr Indyk Introduction to Algorithms May 6, 2008 L20. Another difficult problem
G=(V,E)
of V such that every pair
of vertices in C has an
edge between them
O(n 2
n
) time
Boolean Formula Satififiability Problem (SAT):
Given a Boolean formula F(X 1 , X 2 , ..., Xn) with n Boolean variables X 1 , X 2 , ..., Xn. SAT Problem: Determine if there is an trueth assignment of the n Boolean variables to 0(false) or 1(true) that makes the formula F =1(true). Example F = (X 1 V ¬X 2 V X 3 ) ∧ (X 2 V ¬X 3 V ¬X 5 )
* %% - ' "&# - )!# #
- #) -## #%( # ($
- , $ %'! ) % #% + %#) #
© Piotr Indyk Introduction to Algorithms May 6, 2008 L20. What can we do?
- Prove there is no polynomial time algorithm for those problems - Would be great - Seems really difficult - Best lower bounds for “natural” problems:
- Spend more time and money designing efficient algorithms for those problems –People tried for a few decades, no luck –Outstanding $1000,000 prize for finding one –It seems very likely that such algorithms do not exist
- (n 2 ) for restricted computational models
- (n) for unrestricted computational models
© Piotr Indyk Introduction to Algorithms May 6, 2008 L20. What else can we do?
- Show that those hard problems are
essentially equivalent.
I.e., if we can solve one of them in poly
time, then all others can be solved in poly
time as well.
- Works for at least few thousand hard
problems
© Piotr Indyk Introduction to Algorithms May 6, 2008 L20. A more realistic scenario
- Once an exponential lower bound is shown for one problem, it holds for all of them
- But someone is happy… Ron Rivest
© Piotr Indyk Introduction to Algorithms May 6, 2008 L20. Summing up
- If we show that a problem is equivalent to a few thousand other well studied problems without efficient algorithms, then we get a very strong evidence that is hard.
- We need to:
- Identify the class of problems of interest
- Define the notion of equivalence
- Prove the equivalence(s)
© Piotr Indyk Introduction to Algorithms May 6, 2008 L20.
1. Class of problems: NP
- A problem is solvable in poly time (or P), if there is a poly time algorithm V(.) such that for any input x: (x)=YES iff V(x)=YES
- A problem is solvable in non-deterministic poly time (or NP), if there is a poly time algorithm V(. , .) such that for any input x: (x)=YES iff there exists a certificate y of size poly(|x|) such that V(x,y)=YES
Nondeterministic Time (NP):
Deterministic Time (P):
© Piotr Indyk Introduction to Algorithms May 6, 2008 L20. Examples of problems in NP
- Is “Does there exist a clique in G of size K” in NP? Yes: V(x,y) interprets x as a graph G, y as a set C, and checks if all vertices in C are adjacent and if |C|K
- Is Sorting in NP? No, not a decision problem.
- Is “Sortedness” in NP? Yes: ignore y, and check if the input x is sorted.
© Piotr Indyk Introduction to Algorithms May 6, 2008 L20.
2. Reductions (formally)
- ’ is poly time reducible to ( ’ ) iff there is a poly time function f that maps inputs x’ to ’ into inputs x of , such that for any x’ ’(x’)=(f(x’))
- Fact 1: if P and ’ then ’P
- Fact 2: if NP and ’ then ’NP
- Fact 3: if ’ and ” ’ then ”
Polynomial Time Reductions
between Problem Classes:
© Piotr Indyk Introduction to Algorithms May 6, 2008 L20. Summing up
- If we show that a problem is equivalent to a few thousand other well studied problems without efficient algorithms, then we get a very strong evidence that is hard.
- We need to:
- Identify the class of problems of interest
- Define the notion of equivalence
- Prove the equivalence(s) Two Problems are Polynomial Time Equivalent: if there Polynomial Time Reductions between the two problems