NP-Completeness A language B is NP-complete iff B NP A NP A P B This property means B is NP hard 1
3SAT is NP-complete 2
Result Idea: B is known to be NP complete Use it to prove NP-Completeness of C IF C is NP-hard B is NP-complete and B P C and C NP THEN C is NP-complete 3
Result CLIQUE is NP-hard 3SAT is NP-complete and 3SAT P CLIQUE and CLIQUE NP THEREFORE CLIQUE is NP-complete 4
Result VERTEX-COVER is NP-hard 3SAT is NP-complete and 3SAT P VERTEX-COVER and VERTEX-COVER NP THEREFORE VERTEX-COVER is NP-complete 5
Result IF B is NP-complete and B P THEN P = NP 6
SAT P P = NP 3SAT P P = NP CLIQUE P P = NP VERTEX-COVER P P = NP 7
SAT = { Φ Φ is a satisfiable Boolean formula} SAT NP
Cook-Levin Theorem SAT is NP-complete In other words SAT NP A NP A P SAT 9
To prove A NP A P SAT define polynomial time computable function f: Σ * Σ * w Σ * w A f(w) SAT w Σ * w A Φ SAT 10
Consider any A NP NTM N that decides A in polytime n k For any input w Σ * valid tableau of configurations 11
Properties of a Valid Tableau There is exactly one symbol in each cell The first row is the ( legal ) start configuration Every subsequent row is generated legally 12
For any input w A there is an accepting (valid) tableau of configurations 13
Properties of an Accepting Tableau There is exactly one symbol in each cell The first row is the ( legal ) start configuration Every subsequent row is generated legally One of these rows is an accepting configuration 14
Proof Idea Given N and w construct a Boolean formula that is satisfiable exactly when N has an accepting tableau on input w 15
Constructing the formula Define Boolean formula with variables x ijs for 1 i n k 1 j n k s State Set Tape Alphabet Delimiter Want following semantics: x ijs is T iff cell (i, j) contains symbol s for some valid accepting tableau 16
x ijs is T iff cell (i, j) contains symbol s x 12q_0 is T whereas x 12 is F 17
Properties of an Accepting Tableau There is exactly one symbol in each cell The first row is the ( legal ) start configuration Every subsequent row is generated legally One of these rows is an accepting configuration 18
represent valid tableau with a Boolean formula with components Φ cell exactly one symbol per cell for any pair (i,j) the cell contains at least one symbol the cell contains at most one symbol 19
Properties of an Accepting Tableau There is exactly one symbol in each cell The first row is the ( legal ) start configuration Every subsequent row is generated legally One of these rows is an accepting configuration 20
represent valid tableau with a Boolean formula with components Φ cell exactly one symbol per cell Φ start legal starting configuration 21
Properties of an Accepting Tableau There is exactly one symbol in each cell The first row is the ( legal ) start configuration Every subsequent row is generated legally One of these rows is an accepting configuration 22
represent valid tableau with a Boolean formula with components Φcell exactly one symbol per cell Φstart legal starting configuration Φmove legal moves 23
represent valid tableau with a Boolean formula with components Φ move legal moves transition function N q1 b c, L q2 a b, R b a, R # a b q1 b c # a q2 b c c # a b q1 b c # a b a q2 c 24
represent valid tableau with a Boolean formula with components Φ move legal moves represented by legal windows transition function N q1 b c, L q2 a b, R b a, R 25
represent valid tableau with a Boolean formula with components Φ move legal moves represented by legal windows 26
Properties of an Accepting Tableau There is exactly one symbol in each cell The first row is the ( legal ) start configuration Every subsequent row is generated legally One of these rows is an accepting configuration 27
represent valid accepting tableau with a Boolean formula with components Φ cell exactly one symbol per cell Φ start legal starting configuration Φ move legal moves Φ accept legal accepting configuration 28
represent valid accepting tableau with Boolean formula Φcell Φstart Φmove Φaccept 29
SAT is NP-complete w Σ * w A there is a valid accepting tableau constructed formula is SATISFIABLE Corollary 7.42: 3SAT is NP-complete 30
HALTTM = { M, w : M is a TM that halts on input w} HALTTM is NP-hard In other words A NP A P HALTTM 31
3SAT P HALTTM define polynomial time computable function f: Σ * Σ * w Σ * w 3SAT f(w) HALT TM 32
Define TM M as follows M: On input w: 3SAT P HALTTM If w is not a valid 3CNF encoding then loop If w is a valid 3CNF encoding then check if w evaluates to True for any possible assignment to variables in w If yes then accept else loop w Σ * w 3SAT M, w HALT TM 33
HALTTM = { M, w : M is a TM that halts on input w} Is HALTTM NP-complete? 34
NP-hard NP-complete NP P All languages 35