Presentation is loading. Please wait.

Presentation is loading. Please wait.

April 13 th Class Notes Hw# 5 will be worth 50 points and it will be posted tonight or tomorrow.

Similar presentations


Presentation on theme: "April 13 th Class Notes Hw# 5 will be worth 50 points and it will be posted tonight or tomorrow."— Presentation transcript:

1 April 13 th Class Notes Hw# 5 will be worth 50 points and it will be posted tonight or tomorrow

2 Definition of the Class NP 1)Language that can be accepted on a nondeterministic TM in polynomial time. If it isn’t in the language it may not reject in polynomial time 2)Given a certificate, one can verify in polynomial time whether or not an input is in the language

3 Hampath={ |G has a Hamiltonian path} This doesn’t have a Hampath since there are three vertices of degree one and we would need a way in and a way out

4 The graph below has a hampath

5 One Hampath for the diagram is A-B-D-F-E-C This path can be used to represent a certificate. Verifying this path would take less than polynomial time We can also prove that this can NP by checking all path options at once

6 Hampath={ |Gdoesn’t have a hamiltonion path There is not an easy certificate that can be generated to prove that no path exists This is Co-NP (compliment NP)

7 Composites ={n|n exists Z+ and there exists a p and q such that n=p*q} Can easily produce a certificate ie if n=143 p=11 and q=13

8 Primes={n|there is no way to represent n=p*q, where pa nd q exist in Z+ and P>1 and q>1} This has been shown to be O(n**6) by AKS

9 Clique={G,K|Graph G has a Clique of size k} The time to determine this would be n choose k A certificate would be all of the nodes in the clique

10 Subset-sum={(s,target| some subset in s adds up to the target) Brute force method: chack all subsets of S This would take 2**n where |s|=n A certificate could be generated which would include the subet that adds to the target Example S={7,15,35,19,135,2} target =59 Certificate =7,15,35,2

11 It is not known if P is a subset of NP or they are equal

12 Section 7.4 SAT (satisfiability problem) Boolean formula (X1 V X2 V X3) ^(X3V X4) Cook Levin theorem SAT exists in P iff P=NP

13 Polynomial time mapping problem A< pB iff W exists in A iff f(w) exists in B And f is computable in polynomial time If a polynomial solution to B was known and A< pB, Than there exists a polynomial solution to A

14 To solve A A(w){ 1. Calculate f(w) 2. Run the solution for B with input f(w) Given a solution to B we solve A by callin the soln to B a polynomial number of times

15 Partition < p subset sum S= {3,16,19,25,14,201} F(w)=S= {3,16,19,25,14,201} Target = (3+16+19+25+14+201)/2

16 All problems in NP are poly time reducible to SAT X<pSAT If all problems in the NP reduce (in polytime) to a problem Y. Then Y is known as NP-Complete and Y has to be in the NP. Also SAT is NP-Complete To prove a problem is NP_Complete reduce it from a known NP-Complete problem Any prob<SAT <pX


Download ppt "April 13 th Class Notes Hw# 5 will be worth 50 points and it will be posted tonight or tomorrow."

Similar presentations


Ads by Google