Fun with Reductions
Transcript of Fun with Reductions
![Page 1: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/1.jpg)
Yu ChengDec 5, 2017
Fun with Reductions
![Page 2: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/2.jpg)
Outline
Show• Vertex 3-Coloring
• Hamiltonian Cycle
• Super Mario
are NP-Hard.
Dec5,2017 YuCheng
![Page 3: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/3.jpg)
Recap
• P vs NP
• (Polynomial-time) Reductions
• 3-Satisfiability (3SAT)
Dec5,2017 YuCheng
![Page 4: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/4.jpg)
“Easy to verify” problems: NP
• All decision problems such that we can verify the correctness of a solution in polynomial time.
ProverVerifier:OK,thatisindeed asolution.
input
![Page 5: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/5.jpg)
Polynomial time reductions
• Reduce A to B: a polynomial time algorithm that mapsinstances of A to instances of problem B, such that the answers are the same.
• 𝐴 ≤# 𝐵: B is at least as hard as A.
If you can solve B (in poly time) then you can solve A.
Areduction
B
![Page 6: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/6.jpg)
3-Satisfiability (3SAT)
![Page 7: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/7.jpg)
Gadget-Based Reductions
𝐴 ≤# 𝐵:
Given instances of A, output instances of B.Build gadgets for pieces of A.Put the pieces together.
3SAT ≤# 𝑋
![Page 8: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/8.jpg)
Fun with Hardness Proofs
Algorithmic Lower Bounds: Fun with Hardness Proofs
Erik Demaine
http://courses.csail.mit.edu/6.890/fall14/lectures/
Dec5,2017 YuCheng
![Page 9: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/9.jpg)
Outline
Show• Vertex 3-Coloring
• Hamiltonian Cycle
• Super Mario
are NP-Hard.
Dec5,2017 YuCheng
![Page 10: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/10.jpg)
Vertex 3-Coloring
Input: a graph
Output: color each vertex using 1 of the 3 colors, sothat adjacent vertices do not get the same color.
Dec5,2017 YuCheng
![Page 11: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/11.jpg)
3-Coloring:
Dec5,2017 YuCheng
![Page 12: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/12.jpg)
3-Coloring: Yes instance
Dec5,2017 YuCheng
![Page 13: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/13.jpg)
3-Coloring: No instance
Dec5,2017 YuCheng
![Page 14: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/14.jpg)
3SAT ≤# 3-Coloring
Satisfiable formula ⟺
Unsatisfiable formula ⟺
Dec5,2017 YuCheng
![Page 15: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/15.jpg)
Dec5,2017 YuCheng
![Page 16: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/16.jpg)
Dec5,2017 YuCheng
![Page 17: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/17.jpg)
Dec5,2017 YuCheng
![Page 18: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/18.jpg)
Dec5,2017 YuCheng
![Page 19: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/19.jpg)
3SAT ≤# 3-Coloring
•Consequence:3-Coloring is NP-Complete.(Because 3-Coloring is also in NP.)
Dec5,2017 YuCheng
![Page 20: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/20.jpg)
Outline
Show• Vertex 3-Coloring
• Hamiltonian Cycle
• Super Mario
are NP-Hard.
Dec5,2017 YuCheng
![Page 21: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/21.jpg)
Hamiltonian Cycle
Dec5,2017 YuCheng
![Page 22: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/22.jpg)
Hamiltonian Cycle
Dec5,2017 YuCheng
• Input: a (directed) graph.
• Solution: a cycle visiting every vertex exactly once.
![Page 23: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/23.jpg)
Variable Gadget
Dec5,2017 YuCheng
![Page 24: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/24.jpg)
Clause Gadget
Dec5,2017 YuCheng
![Page 25: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/25.jpg)
3SAT ≤# Hamiltonian Cycle
Dec5,2017 YuCheng
![Page 26: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/26.jpg)
Dec5,2017 YuCheng
![Page 27: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/27.jpg)
Dec5,2017 YuCheng
![Page 28: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/28.jpg)
3SAT ≤# Hamiltonian Path
Dec5,2017 YuCheng
3SAT ≤# Hamiltonian Cycle
?
![Page 29: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/29.jpg)
Dec5,2017 YuCheng
![Page 30: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/30.jpg)
Outline
Show• Vertex 3-Coloring
• Hamiltonian Cycle
• Super Mario
are NP-Hard.
Dec5,2017 YuCheng
![Page 31: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/31.jpg)
![Page 32: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/32.jpg)
![Page 33: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/33.jpg)
![Page 34: Fun with Reductions](https://reader034.fdocuments.us/reader034/viewer/2022052501/628b2942f141f425f52f000b/html5/thumbnails/34.jpg)