Presentation is loading. Please wait.

Presentation is loading. Please wait.

Intro to Theory of Computation

Similar presentations


Presentation on theme: "Intro to Theory of Computation"— Presentation transcript:

1 Intro to Theory of Computation
LECTURE 27 Last time Polynomial-time reductions NP-completeness Cook-Levin theorem Today Examples of NP-complete problems CS 464 Sofya Raskhodnikova 11/22/2018 S. Raskhodnikova; based on slides by N. Hopper and K. Wayne.

2 The class NP NP is the class of languages that have polynomial-time verifiers. 11/22/2018

3 I-clicker question (frequency: AC)
Recall: The running time of a verifier V( 〈𝑤,𝑐〉 ) is measured only in terms of length of w. If we allowed a verifier to run in time polynomial in the length of 𝑤,𝑐 , 𝐭𝐡𝐞 𝐜𝐥𝐚𝐬𝐬 𝐍𝐏 would be smaller be the same contain more (decidable only) languages contain more (even undecidable) languages none of the above t(n)= n log n 3/17/2016

4 I-clicker question (frequency: AC)
3SAT is an example of a problem that cannot be solved by an algorithm. True False It is an open question None of the above t(n)= n log n 3/17/2016

5 I-clicker question (frequency: AC)
3SAT is an example of a problem that cannot be solved by a polynomial time algorithm. True False It is an open question None of the above t(n)= n log n 3/17/2016

6 A language B is NP-complete if
Hardest problems in NP A language B is NP-complete if B∈𝐍𝐏 B is NP-hard,i.e., every language in NP is poly-time reducible to B. P NP B 11/22/2018

7 Establishing NP-completeness
Once we establish first "natural" NP-complete problems, others fall like dominoes. Recipe to establish NP-completeness of problem Y. Step 1. Show that Y is in NP. Step 2. Choose an NP-complete problem X (e.g., 3SAT). Step 3. Prove that X  p Y. 11/22/2018

8 SUBSET-SUM SSUM = { 𝑆,𝑡 ∣𝑆={ 𝑥 1 ,…, 𝑥 𝑟 },
and for some 𝑦 1 ,…, 𝑦 𝑟′ ⊆ 𝑥 1 ,…, 𝑥 𝑟 , we have 𝑦 1 +…+ 𝑦 𝑟′ =𝑡} Repetitions allowed. Examples: 5, 7, 23 ,46 〉 SSUM ∈ NP ∈𝑆𝑆𝑈𝑀 5, 15, 25 ,46 〉 ∉𝑆𝑆𝑈𝑀 Warning: should remove ``repetitions allowed’’. Otherwise, the reduction in the book does not work. Certificate: 𝑦 1 ,…, 𝑦 𝑟′ 11/22/2018

9 3SAT ≤ 𝒑 SUBSET-SUM SSUM = { 𝑆,𝑡 ∣𝑆={ 𝑥 1 ,…, 𝑥 𝑟 },
and for some 𝑦 1 ,…, 𝑦 𝑟′ ⊆ 𝑥 1 ,…, 𝑥 𝑟 , we have 𝑦 1 +…+ 𝑦 𝑟′ =𝑡} ``On input 〈𝜙〉, where 𝜙 is a 3CFN formula with variables 𝑥 1 ,…, 𝑥 ℓ and clauses 𝑐 1 ,…, 𝑐 𝑘 , Output a set S of numbers and target number t (constructed on the board) ’’ 11/22/2018

10 TSP (Traveling Salesman)
NP-Completeness All problems below are NP-complete and hence poly-time reduce to one another! by definition of NP-completeness CIRCUIT-SAT 3SAT 3SAT reduces to INDEPENDENT SET INDEPENDENT SET HAMPATH GRAPH 3-COLOR SUBSET-SUM Karp analyzed most juicy open problem in discrete math – showed most were NP-complete x -> y means x reduces to y (if you can solve y, then you can solve x) Then to join the NP complete club, you need a reduction from SAT (or any other current member) to you VERTEX COVER UHAMPATH PLANAR 3-COLOR SCHEDULING SET COVER TSP (Traveling Salesman) 11/22/2018

11 Some NP-Complete Problems
Six basic genres of NP-complete problems and paradigmatic examples. Packing problems: SET-PACKING, INDEPENDENT SET. Covering problems: SET-COVER, VERTEX-COVER. Constraint satisfaction problems: SAT, 3-SAT. Sequencing problems: HAMPATH, TSP. Partitioning problems: 3D-MATCHIN,G 3-COLOR. Numerical problems: SUBSET-SUM, KNAPSACK. Most NP problems are either known to be in P or NP-complete. Notable exceptions. Factoring, graph isomorphism, Nash equilibrium. Nash equilibria in two-person non-zero-sum game always exist, but major open question to *find* such a solution in poly-time. [Is there a corresponding decision problem or is only the search problem interesting from a computational complexity viewpoint?] 11/22/2018

12 An encyclopedia of NP-complete problems
11/22/2018


Download ppt "Intro to Theory of Computation"

Similar presentations


Ads by Google