Title: April 13th Class Notes
1April 13th Class Notes
- Hw 5 will be worth 50 points and it will be
posted tonight or tomorrow
2Definition of the Class NP
- 1)Language that can be accepted on a
nondeterministic TM in polynomial time. If it
isnt 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 -
3HampathltGgtG has a Hamiltonian path
- This doesnt have a Hampath since there are three
vertices of degree one and we would need a way in
and a way out
4The graph below has a hampath
5One Hampath for the diagram isA-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
6HampathltGgtGdoesnt 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)
7Composites nn exists Z and there exists a p
and q such that npq
- Can easily produce a certificate ie if n143 p11
and q13
8Primesnthere is no way to represent npq,
where pa nd q exist in Z and Pgt1 and qgt1
- This has been shown to be O(n6) by AKS
9CliqueG,KGraph G has a Clique of size kThe
time to determine this would be n choose kA
certificate would be all of the nodes in the
clique
10Subset-sum(s,target some subset in s adds up
to the target)
- Brute force method chack all subsets of S
- This would take 2n where sn
- A certificate could be generated which would
include the subet that adds to the target - Example S7,15,35,19,135,2 target 59
- Certificate 7,15,35,2
11It is not known if P is a subset of NP or they
are equal
12Section 7.4
- SAT (satisfiability problem)
- Boolean formula (X1 V X2 V X3) (X3V X4)
- Cook Levin theorem SAT exists in P iff PNP
13Polynomial time mapping problem
- Alt 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 Alt
pB, Than there exists a polynomial solution to A
14To solve A
- A(w)
- Calculate f(w)
- 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
15Partition lt p subset sum
- S 3,16,19,25,14,201
- F(w)S 3,16,19,25,14,201
- Target (316192514201)/2
-
16All problems in NP are poly time reducible to SAT
XltpSAT
- 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 probltSAT ltpX