More Reductions
Hamiltonian Cycle to Travelling Salesman
HC≤pTSP
- Edges have weights in TSP
- Minimize weight in a cycle

- Is there a cycle with total weight ≤k (G′,k)

<G′,n>, where n=G
We can prove
G is yes ⇒ <G′,n> is yes
Also need to prove
no⇒no
yes⇐yes - easier to prove
NP
P - polynomial time
NP - non-deterministic polynomial time
Clique: <G,k>
Matching: <G,k>
∣v′∣=k,∀u,v∈V′,(u,v)∈E
Note: solution and proof are different
- For the above two problems, it happens that the proof = solution
Definition of NP
A decision problem X is in NP if an only if ∃ a polynomial time algorithm V such that
- An instance is "yes" instance ∃ a polynomial length string y s.t. V(x,y)=yes
- An instance x is "no" instance ⇒ no y can make V(x,y)=yes
Consider the Clique problem again
Clique∈NP
Vertex cover ∈NP
<G,k>
V′∈V,∣V′∣=k
Bipartite graph ∈NP
Vℓ∪Vr=V
Proves
P⊂NP
using zero length proof
NP-Complete

Definiton:
A problem X∈NP is called NP-Complete if for every Y∈NP, Y≤pX
Corollary: If both X,Y are NPC, then X≤pY, Y≤pX
Corollary: If X∈NPC, and X has a polynomial time algorithm, then NP=P
Corollary: Let X∈NPC, Y∈NP, then X≤pY implies Y∈NPC

3 SAT Problem (3 Satifiability)
CNF: Conjunctive normal form
(x1∨x2∨x3)∧(x2∨x3)∧(x1∨x2∨x3)∧(x1∨x3)
x1 is a literal
(x1∨x3) is a clause
x1=T,x2=F,x3=T
Theory: (Cook-Levin) 3 SAT is NP-Complete
EXACT−3SAT≤p3SAT
3SAT≤pEXACT−3SAT
u∨v→{u∨v∨yu∨v∨y
Create new variable y
Theory: 3SAT ≤p Independent Set
Ideas: variable T→ vertex is selecte
(x∨y∨z),(x∨y∨z),(x,∨y∨z),(x∨y)


- Polynomial time v
- yes⇒yes
- If satisfiable, then there are truth assignments to the variables s.t. each caluse has at least 1 true literal
- yes⇐yes
Corollary: Independent Set ∈NPC
To prove this
- IS←NP
- 3SAT≤pIS
3SAT≤pIS≤pVC
3SAT≤pIS≤pClique