More Reductions

Hamiltonian Cycle to Travelling Salesman

HC≤pTSPHC\leq_p TSP

  • Edges have weights in TSP
  • Minimize weight in a cycle

  • Is there a cycle with total weight ≤k\leq k (G′,k)(G', k)

<G′,n><G', n>, where n=Gn=G

We can prove

GG is yes ⇒\Rightarrow <G′,n><G', n> is yes

Also need to prove

no⇒nono\Rightarrow no

yes⇐yesyes \Leftarrow yes - easier to prove

NP

P - polynomial time

NP - non-deterministic polynomial time

Clique: <G,k><G, k>

Matching: <G,k><G, k>

∣v′∣=k,∀u,v∈V′,(u,v)∈E|v'|=k,\forall u, v \in V', (u, v)\in E

Note: solution and proof are different

  • For the above two problems, it happens that the proof = solution

Definition of NP

A decision problem XX is in NP if an only if ∃\exists a polynomial time algorithm VV such that

  • An instance is "yes" instance ∃\exists a polynomial length string yy s.t. V(x,y)=yesV(x, y)=yes
  • An instance xx is "no" instance ⇒\Rightarrow no yy can make V(x,y)=yesV(x, y)=yes
Consider the Clique problem again

Clique∈NPClique\in NP

Vertex cover ∈NP\in NP

<G,k><G, k>

V′∈V,∣V′∣=kV'\in V, |V'|=k

Bipartite graph ∈NP\in NP

Vℓ∪Vr=VV_\ell\cup V_r=V

Proves

P⊂NPP\subset NP

using zero length proof

NP-Complete

Definiton:

A problem X∈NPX\in NP is called NP-Complete if for every Y∈NPY\in NP, Y≤pXY\leq_p X

Corollary: If both X,YX, Y are NPCNPC, then X≤pYX\leq_p Y, Y≤pXY\leq_p X

Corollary: If X∈NPCX\in NPC, and XX has a polynomial time algorithm, then NP=PNP=P

Corollary: Let X∈NPCX\in NPC, Y∈NPY\in NP, then X≤pYX\leq_p Y implies Y∈NPCY\in NPC

3 SAT Problem (3 Satifiability)

CNF: Conjunctive normal form

(x1∨x2∨x3‾)∧(x2‾∨x3‾)∧(x1‾∨x2∨x3)∧(x1∨x3)(x_1\vee x_2\vee\overline{x_3})\wedge(\overline{x_2}\vee\overline{x_3})\wedge(\overline{x_1}\vee x_2\vee x_3)\wedge(x_1\vee x_3)

x1x_1 is a literal

(x1∨x3)(x_1 \vee x_3) is a clause

x1=T,x2=F,x3=Tx_1=T, x_2=F, x_3=T

Theory: (Cook-Levin) 3 SAT is NP-Complete

EXACT−3SAT≤p3SATEXACT-3SAT\leq_p 3SAT

3SAT≤pEXACT−3SAT3SAT\leq_p EXACT-3SAT

u∨v→{u∨v∨yu∨v∨y‾u\vee v \rightarrow \begin{cases} u\vee v \vee y\\ u\vee v \vee \overline{y} \end{cases}

Create new variable yy

Theory: 3SAT ≤p\leq_p Independent Set
Ideas: variable T→T \rightarrow vertex is selecte

(x‾∨y∨z‾),(x∨y‾∨z),(x,∨y∨z),(x‾∨y‾)(\overline{x}\vee y\vee \overline{z}),(x\vee\overline{y}\vee z), (x, \vee y\vee z), (\overline{x}\vee \overline{y})

  1. Polynomial time vv
  2. yes⇒yesyes \Rightarrow yes
    1. If satisfiable, then there are truth assignments to the variables s.t. each caluse has at least 1 true literal
  3. yes⇐yesyes\Leftarrow yes

Corollary: Independent Set ∈NPC\in NPC

To prove this
  1. IS←NPIS\leftarrow NP
  2. 3SAT≤pIS3SAT\leq_p IS

3SAT≤pIS≤pVC3SAT\leq_p IS \leq_p VC

3SAT≤pIS≤pClique3SAT\leq_p IS\leq_p Clique

results matching ""

    No results matching ""