More Reductions

Hamiltonian Cycle to Travelling Salesman

HCpTSPHC\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

nonono\Rightarrow no

yesyesyes \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,vV,(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

CliqueNPClique\in NP

Vertex cover NP\in NP

<G,k><G, k>

VV,V=kV'\in V, |V'|=k

Bipartite graph NP\in NP

VVr=VV_\ell\cup V_r=V

Proves

PNPP\subset NP

using zero length proof

NP-Complete

Definiton:

A problem XNPX\in NP is called NP-Complete if for every YNPY\in NP, YpXY\leq_p X

Corollary: If both X,YX, Y are NPCNPC, then XpYX\leq_p Y, YpXY\leq_p X

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

Corollary: Let XNPCX\in NPC, YNPY\in NP, then XpYX\leq_p Y implies YNPCY\in NPC

3 SAT Problem (3 Satifiability)

CNF: Conjunctive normal form

(x1x2x3)(x2x3)(x1x2x3)(x1x3)(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

(x1x3)(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

EXACT3SATp3SATEXACT-3SAT\leq_p 3SAT

3SATpEXACT3SAT3SAT\leq_p EXACT-3SAT

uv{uvyuvyu\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 TT \rightarrow vertex is selecte

(xyz),(xyz),(x,yz),(xy)(\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. yesyesyes \Rightarrow yes
    1. If satisfiable, then there are truth assignments to the variables s.t. each caluse has at least 1 true literal
  3. yesyesyes\Leftarrow yes

Corollary: Independent Set NPC\in NPC

To prove this
  1. ISNPIS\leftarrow NP
  2. 3SATpIS3SAT\leq_p IS

3SATpISpVC3SAT\leq_p IS \leq_p VC

3SATpISpClique3SAT\leq_p IS\leq_p Clique

results matching ""

    No results matching ""