Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP,...

51
Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time

Transcript of Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP,...

Page 1: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

Algorithms,Lecture3onNP:NondeterministicPolynomialTime

Page 2: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

ProblemXispolytimereducibletoYX≤PY

ifcansolveXusingpolycomputationandapolynumberofcallstoanalgorithmsolvingY.

“Uptopolyfactors,XisatleastaseasyasY”“Uptopolyfactors,YisharderthanX”

Page 3: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

DefinedNP:decision(yes/no)problemscancheckcertificatesforyesanswersinptime

Havepolytimeproofcheckers:ApolytimealgorithmAsothatifX(s)=yes,

thereexistsawsothatA(s,w)=yes,andifX(s)=no,

forallw,A(s,w)=no

Mostproblemsofform:doesthereexistwsothatsatisfiesconditionsimpliedbys?

Page 4: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

DefinedNP-Complete:1.X∈ NP,and2.XisNP-hard

XisNP-hardif:1.forallY∈ NP,Y≤P X,or2.CircuitSat ≤P X,or3.Y≤P X,forsomeNP-HardY,suchas

SAT,IndependentSet,VertexCover

Lastclass:

Page 5: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

Lastclass:ProvedCircuitSAT isNP-Hard.

ProvedCircuitSAT ≤P SAT.

Infact,provedCircuitSAT ≤P 3-SAT

Where3-SATisSAT,buteachclausehasatmost3terms.

Page 6: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

Lastclass:ProvedCircuitSAT isNP-Hard.

ProvedCircuitSAT ≤P SAT.

Infact,provedCircuitSAT ≤P 3-SAT

Where3-SATisSAT,buteachclausehasatmost3terms.Naturallyfollowsfromtheconstruction.

Page 7: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

SAT≤P 3-SAT,aself-containedproof

AorBisequivalentto∃ys.t. (Aory)and(Bory)

So,givenaclausewithmorethan3terms,like

Introduceanewvariabley,andreplacewithclauses:

x1Vx2Vx3 Vx4

x1Vx2VyandyVx3 Vx4

Page 8: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

SAT≤P 3-SAT,aself-containedproof

AorBisequivalentto∃ys.t. (Aory)and(Bory)

So,givenaclausewithmorethan3terms,like

Introduceanewvariabley,andreplacewithclauses:

x1Vx2Vx3 Vx4

x1Vx2VyandyVx3 Vx4

2-SATisinP

Page 9: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

Alsopossibletoforceeachvariabletoappearatmost3times

Sayavariablexappearsinkclauses.

Replacexwithknewvariables,x1,…,xk,oneforeachclauseinwhichitappears.

Addclausesx1Vx2 ,x2Vx3 ,…,xk-1Vxk ,xk Vx1

Onlysatisfiedifallareequal.

Page 10: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

Today

WillprovemoreproblemsareNP-complete:

3-coloringHamiltonianCycleTravellingSalespersonProblem

Page 11: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

k-Coloring

GivenagraphG=(V,E),doesthereexistf:V→ {1,2,…,k}(colors)

Sothatforall(u,v)∈ Ef(u) f(v)?

3-colorable Not3-colorable

6=

Page 12: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

3-colorable Not3-colorable

k-Coloring

GivenagraphG=(V,E),doesthereexistf:V→ {1,2,…,k}(colors)

Sothatforall(u,v)∈ Ef(u) f(v)?6=

Page 13: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

k-ColoringisNP-Complete

ClearlyinNP,becausecancheckaproposedcoloringToproveNP-hard,willshow3-SAT≤P 3-Coloring

GivenacollectionofclausesC1,…,Ck,eachwithatmost3terms,onvariablesx1,…,xnproducegraphG=(V,E)thatis3-colorableiff theclausesaresatisfiable

Page 14: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

3-ColoringisNP-Complete– variablegadgets

Create3specialnodes:T,F,B(base),andonenodeforeachterm:xi andxi

x1x1 x2x2 xnxn

Inevery3-coloring,oneofxi andxiiscoloredTandoneiscoloredF

T F

B

Page 15: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

xnxnx1

Create3specialnodes:T,F,B(base),andonenodeforeachterm:xi andxi

x1 x2x2

Inevery3-coloring,oneofxi andxiiscoloredTandoneiscoloredF

3-ColoringisNP-Complete– variablegadgets

FT

B

Page 16: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

Considerclausex1Vx2 Vxn

3-ColoringisNP-Complete– clausegadgets

x1 x2 xn

Claim:3-colorableiff termscoloredtosatisfyclause

T

B

Page 17: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

3-ColoringisNP-Complete– clausegadgets

x1 x2 xn

Claim:3-colorableiff termscoloredtosatisfyclause

1.IftermsallcoloredF,thencannot3-color

T

B

Page 18: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

3-ColoringisNP-Complete– clausegadgets

x1 x2 xn

Claim:3-colorableiff termscoloredtosatisfyclause

1.IftermsallcoloredF,thencannot3-color

T

B

Page 19: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

3-ColoringisNP-Complete– clausegadgets

x1 x2 xn

Claim:3-colorableiff termscoloredtosatisfyclause

1.IftermsallcoloredF,thencannot3-color

T

B

Page 20: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

xnx2x1

3-ColoringisNP-Complete– clausegadgetsClaim:3-colorableiff termscoloredtosatisfyclause

2.Ifsometermtrue,can3-color

T

B

Page 21: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

x2x1 xn

3-ColoringisNP-Complete– clausegadgetsClaim:3-colorableiff termscoloredtosatisfyclause

2.Ifsometermtrue,can3-color

T

B

Page 22: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

xnx2x1

3-ColoringisNP-Complete– clausegadgetsClaim:3-colorableiff termscoloredtosatisfyclause

2.Ifsometermtrue,can3-color

T

B

Page 23: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

3-ColoringisNP-Complete

x1x1 x2x2 xnxnx3x3

x1Vx2 Vxn

3-colorableiffsatisfiable

FT

B

Page 24: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

3-ColoringisNP-Complete

x1x1 x2x2 xnxnx3x3

x1Vx2 Vxn x2Vx3 Vxn

3-colorableiffsatisfiable

FT

B

Page 25: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

HamiltonianCycle:Acycleinagraphthathitseachvertexonce.

DirectedHamiltonianCycle:same,butinadirectedgraph

Page 26: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

DirectedHamCycleisNP-Complete

ClearlyinNP,becausecancheckifacycleisHamiltonian

ToproveNP-hard,willshowSAT≤P DirectedHamCycle

ProducedirectedgraphG=(V,E)thathasHamCycleiff theclausesaresatisfiable

Page 27: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

Start:creategraphwith2n HamCycles,thencreategadgetstorestrictthem

1:

2:

3:

n:

Page 28: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

Start:creategraphwith2n HamCycles,thencreategadgetstorestrictthem

1:

2:

3:

n:

Page 29: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

Start:creategraphwith2n HamCycles,thencreategadgetstorestrictthem

s

t

1:

2:3:

n:

Mustgotop-to-bottom,andcantraverseeachrowleft-to-right(True)orright-to-left(False)

Page 30: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

Start:creategraphwith2n HamCycles,thencreategadgetstorestrictthem

Mustgotop-to-bottom,andcantraverseeachrowleft-to-right(True)orright-to-left(False)

s

t

1:

2:3:

n:

Page 31: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

Clausegadgets TrueFalse

s

t

1:

2:3:

n:

clausex1 forcestraversefirstrow

Require:nootheredgestouchverticesingadget

Page 32: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

x1Vx2 Vxn

Clausegadgets TrueFalse

s

t

1:

2:3:

n:

clause

Forcestraverse1,or2,orn

Page 33: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

x1Vx2 Vxn

Clausegadgets TrueFalse

s

t

1:

2:3:

n:

clause

Forcestraverse1,or2,ornRequire:nootheredgestouchverticesingadget

Page 34: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

x1Vx2 Vxn

Clausegadgets TrueFalse

2:

clause

Toseemustcomebacktosamerow,notethatifdonotisnoHamiltonianpaththroughunuseddown-link

Page 35: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

x1Vx2 Vxn

Clausegadgets TrueFalse

1:

2:

n:

clause

Forcestraverse1,or2,orn

Page 36: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

x1Vx2 Vxn

Hamcycleiff satisfiable TrueFalse

s

t

1:

2:3:

n:

Pf.Ifsatisfiable,traverseinorderindicatedbyvars,pickingupeachclauseonceusingsometrueterm.

x1Vx2 Vx3

Page 37: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

x1Vx2 Vxn

Hamcycleiff satisfiable TrueFalse

s

t

1:

2:3:

n:

x1Vx2 Vx3Pf.IfHamCycle,mustgotoptobot

assignvars bydirection

ifvisiteachclausenode,thenismadetruebytermonrowfromwhichmakethevisit.

Page 38: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

voutvin

DirectedHamCycle≤PHamCycle

1. Indirectedproblem,answersameifreverseallarrows.

2.Totransformtoundirected,replaceeachvertexvwiththreevertices:vin,vbase,vout

vbuoutuin ub

u vReplacedirected(u,v)edgewith(uout ,vin )

Page 39: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

DirectedHamCycle≤PHamCycle

uoutuin ub

Claim:Iftheseareonlyedgestoub,thenineveryHamiltoniancycleub mustbeadjacenttouin

Proof:ifitisnot,thenonceenterubcannotgetout

Page 40: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

voutvin vbuoutuin ub

Replacedirected(u,v)edgewith(uout ,vin )

DirectedHamCycleinoriginal->HamCycle

woutwin wb

u v

w

DirectedHamCycle≤PHamCycle

Page 41: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

voutvin vbuoutuin ub

Replacedirected(u,v)edgewith(uout ,vin )

Lemma:EveryHamCycleintheundirectedgraphmustgoin,base,out,in,base,out,in,base,out,etc,mustcorrespondtoaHamCyc indirectedgraph

woutwin wb

u v

w

DirectedHamCycle≤PHamCycle

Page 42: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

TSP(TravellingSalespersonProblem)

Givennlocations,adistancefunctiond(u,v)andatotaldistanceD,doesthereexistatourthroughalllocationsoftotaldistanceatmostL?

http://www.tsp.gatech.edu/usa13509/usa13509_info.html

Page 43: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

TSP(TravellingSalespersonProblem)

Givennlocations,adistancefunctiond(u,v)andatotaldistanceD,doesthereexistatourthroughalllocationsoftotaldistanceatmostL?

http://www.tsp.gatech.edu/usa13509/usa13509_sol.html

Page 44: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

RL5915 optimal solutionAn optimal solution for RL5915 is given by the following tour, which has length 565530.

http://www.tsp.gatech.edu/rl5915/rl5915_sol.html

Page 45: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

TSPisNP-complete

HamCycle≤PTSP

GivengraphG=(V,E),createonelocationforeachvertex,

d(u,v)=1if(u,v)∈ E2otherwise

Targetdistance=|V|

Atourofalllocationsthatreturnstostartandhastotallength|V|mustuseexactly|V|edgesofG

Page 46: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

TSPisNP-complete

HamCycle≤PTSP

GivengraphG=(V,E),createonelocationforeachvertex,

d(u,v)=1if(u,v)∈ E2otherwise

Thisisanabstractdistancefunction.Satisfiesd(u,v)=d(v,u)forallu,v andd(u,w)≤ d(u,v)+d(v,w)forallu,v,w

Page 47: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

TSPisNP-complete

HamCycle≤PTSP

GivengraphG=(V,E),createonelocationforeachvertex,

d(u,v)=1if(u,v)∈ E2otherwise

Thisisanabstractdistancefunction.

RemainsNP-hardforintegerpointsinplane.

Page 48: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤

IssuewithPlanarTSP

Ifinputislocationsofpoints,insteadofdistances

TheproblemisnotknowntobeinNP,becausedonotknowifcancomparedistancesinpolynomialtime.

Forintegersx1,…,xn integert,donothavepolytimealgorithmtotestif

X

i

pxi t

Page 49: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤
Page 50: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤
Page 51: Algorithms, Lecture 3 on NP : Nondeterministic Polynomial Time · Defined NP-Complete: 1. X ∈NP, and 2. X is NP-hard X is NP-hard if: 1. for all Y ∈NP, Y ≤ P X, or 2. CircuitSat≤