Complexity Theory
Eric Price
UT Austin
CS 331, Spring 2020 Coronavirus Edition
Eric Price (UT Austin) Complexity Theory 1 / 16
Complexity Theory Eric Price UT Austin CS 331, Spring 2020 - - PowerPoint PPT Presentation
Complexity Theory Eric Price UT Austin CS 331, Spring 2020 Coronavirus Edition Eric Price (UT Austin) Complexity Theory 1 / 16 Note on Reductions For an algorithm : want to solve NEW. Know how to solve OLD. Reduce NEW to OLD: Eric Price (UT
Eric Price (UT Austin) Complexity Theory 1 / 16
Eric Price (UT Austin) Complexity Theory 2 / 16
◮ Reduce from “Finding largest square in polytope” to LP. Eric Price (UT Austin) Complexity Theory 2 / 16
◮ Reduce from “Finding largest square in polytope” to LP. ◮ Reduce from “Tile a region with dominos” to network flow. Eric Price (UT Austin) Complexity Theory 2 / 16
◮ Reduce from “Finding largest square in polytope” to LP. ◮ Reduce from “Tile a region with dominos” to network flow. ◮ Reduce from “Solve a word ladder” to shortest path. Eric Price (UT Austin) Complexity Theory 2 / 16
◮ Reduce from “Finding largest square in polytope” to LP. ◮ Reduce from “Tile a region with dominos” to network flow. ◮ Reduce from “Solve a word ladder” to shortest path.
Eric Price (UT Austin) Complexity Theory 2 / 16
◮ Reduce from “Finding largest square in polytope” to LP. ◮ Reduce from “Tile a region with dominos” to network flow. ◮ Reduce from “Solve a word ladder” to shortest path.
◮ Reduce SAT to 3SAT Eric Price (UT Austin) Complexity Theory 2 / 16
◮ Reduce from “Finding largest square in polytope” to LP. ◮ Reduce from “Tile a region with dominos” to network flow. ◮ Reduce from “Solve a word ladder” to shortest path.
◮ Reduce SAT to 3SAT ◮ Reduce 3SAT to max-independent set Eric Price (UT Austin) Complexity Theory 2 / 16
◮ Reduce from “Finding largest square in polytope” to LP. ◮ Reduce from “Tile a region with dominos” to network flow. ◮ Reduce from “Solve a word ladder” to shortest path.
◮ Reduce SAT to 3SAT ◮ Reduce 3SAT to max-independent set
Eric Price (UT Austin) Complexity Theory 2 / 16
Eric Price (UT Austin) Complexity Theory 3 / 16
Eric Price (UT Austin) Complexity Theory 3 / 16
Eric Price (UT Austin) Complexity Theory 3 / 16
Eric Price (UT Austin) Complexity Theory 3 / 16
Eric Price (UT Austin) Complexity Theory 3 / 16
Eric Price (UT Austin) Complexity Theory 4 / 16
Eric Price (UT Austin) Complexity Theory 4 / 16
Eric Price (UT Austin) Complexity Theory 4 / 16
Eric Price (UT Austin) Complexity Theory 5 / 16
Eric Price (UT Austin) Complexity Theory 5 / 16
1 For all x ∈ L, ∃p ∈ {0, 1}∗ of poly. length s.t. V(x, p) = 1. 2 For all x /
Eric Price (UT Austin) Complexity Theory 5 / 16
1 For all x ∈ L, ∃p ∈ {0, 1}∗ of poly. length s.t. V(x, p) = 1. 2 For all x /
Eric Price (UT Austin) Complexity Theory 5 / 16
1 For all x ∈ L, ∃p ∈ {0, 1}∗ of poly. length s.t. V(x, p) = 1. 2 For all x /
Eric Price (UT Austin) Complexity Theory 6 / 16
1 For all x ∈ L, ∃p ∈ {0, 1}∗ of poly. length s.t. V(x, p) = 1. 2 For all x /
Eric Price (UT Austin) Complexity Theory 6 / 16
1 For all x ∈ L, ∃p ∈ {0, 1}∗ of poly. length s.t. V(x, p) = 1. 2 For all x /
Eric Price (UT Austin) Complexity Theory 6 / 16
1 For all x ∈ L, ∃p ∈ {0, 1}∗ of poly. length s.t. V(x, p) = 1. 2 For all x /
◮ Then “is x ∈ L” is the same as ∃p : V(x, p) = 1 Eric Price (UT Austin) Complexity Theory 6 / 16
1 For all x ∈ L, ∃p ∈ {0, 1}∗ of poly. length s.t. V(x, p) = 1. 2 For all x /
◮ Then “is x ∈ L” is the same as ∃p : V(x, p) = 1 ◮ Which is just CircuitSAT on V(x, ·) Eric Price (UT Austin) Complexity Theory 6 / 16
1 For all x ∈ L, ∃p ∈ {0, 1}∗ of poly. length s.t. V(x, p) = 1. 2 For all x /
◮ Then “is x ∈ L” is the same as ∃p : V(x, p) = 1 ◮ Which is just CircuitSAT on V(x, ·)
Eric Price (UT Austin) Complexity Theory 6 / 16
Eric Price (UT Austin) Complexity Theory 7 / 16
Eric Price (UT Austin) Complexity Theory 7 / 16
Eric Price (UT Austin) Complexity Theory 7 / 16
Eric Price (UT Austin) Complexity Theory 7 / 16
Eric Price (UT Austin) Complexity Theory 7 / 16
Eric Price (UT Austin) Complexity Theory 8 / 16
Eric Price (UT Austin) Complexity Theory 8 / 16
◮ Show that, given an oracle for B, can solve A in poly time Eric Price (UT Austin) Complexity Theory 8 / 16
◮ Show that, given an oracle for B, can solve A in poly time ◮ Can call B many times, do intermediate processing, etc. Eric Price (UT Austin) Complexity Theory 8 / 16
◮ Show that, given an oracle for B, can solve A in poly time ◮ Can call B many times, do intermediate processing, etc. ◮ If B ∈ P then A ∈ P. Eric Price (UT Austin) Complexity Theory 8 / 16
◮ Show that, given an oracle for B, can solve A in poly time ◮ Can call B many times, do intermediate processing, etc. ◮ If B ∈ P then A ∈ P.
Eric Price (UT Austin) Complexity Theory 8 / 16
◮ Show that, given an oracle for B, can solve A in poly time ◮ Can call B many times, do intermediate processing, etc. ◮ If B ∈ P then A ∈ P.
◮ Transform any instance x of A into a (very specific) instance x′ of B
Eric Price (UT Austin) Complexity Theory 8 / 16
◮ Show that, given an oracle for B, can solve A in poly time ◮ Can call B many times, do intermediate processing, etc. ◮ If B ∈ P then A ∈ P.
◮ Transform any instance x of A into a (very specific) instance x′ of B
◮ Such that x is YES for A if, and only if, x′ is YES for B. Eric Price (UT Austin) Complexity Theory 8 / 16
1 Transform an arbitrary instance x of A into a very specific instance y
Eric Price (UT Austin) Complexity Theory 9 / 16
1 Transform an arbitrary instance x of A into a very specific instance y
2 Show how to transform any certificate for x into a certificate for y. Eric Price (UT Austin) Complexity Theory 9 / 16
1 Transform an arbitrary instance x of A into a very specific instance y
2 Show how to transform any certificate for x into a certificate for y. ◮ (Certificate: satisfying assignment / max independent set /
Eric Price (UT Austin) Complexity Theory 9 / 16
1 Transform an arbitrary instance x of A into a very specific instance y
2 Show how to transform any certificate for x into a certificate for y. ◮ (Certificate: satisfying assignment / max independent set /
◮ Hence if x is YES, y must be YES. Eric Price (UT Austin) Complexity Theory 9 / 16
1 Transform an arbitrary instance x of A into a very specific instance y
2 Show how to transform any certificate for x into a certificate for y. ◮ (Certificate: satisfying assignment / max independent set /
◮ Hence if x is YES, y must be YES. 3 Show how to transform any certificate for y into a certificate for x. Eric Price (UT Austin) Complexity Theory 9 / 16
1 Transform an arbitrary instance x of A into a very specific instance y
2 Show how to transform any certificate for x into a certificate for y. ◮ (Certificate: satisfying assignment / max independent set /
◮ Hence if x is YES, y must be YES. 3 Show how to transform any certificate for y into a certificate for x. ◮ Hence if y is YES, x must be YES. Eric Price (UT Austin) Complexity Theory 9 / 16
1 Transform an arbitrary instance x of A into a very specific instance y
2 Show how to transform any certificate for x into a certificate for y. ◮ (Certificate: satisfying assignment / max independent set /
◮ Hence if x is YES, y must be YES. 3 Show how to transform any certificate for y into a certificate for x. ◮ Hence if y is YES, x must be YES. 4 To prove NP-completeness: show B ∈ NP by showing that arbitrary
Eric Price (UT Austin) Complexity Theory 9 / 16
◮ Independent set reduces to vertex cover ⋆ Vertex cover reduces to directed Hamiltonian cycle ⋆ Directed Hamiltonian cycle reduces to undirected hamiltonian cycle
◮ Chromatic number reduces to exact cover ⋆ Exact cover reduces to subset sum. Eric Price (UT Austin) Complexity Theory 10 / 16
Eric Price (UT Austin) Complexity Theory 11 / 16
Eric Price (UT Austin) Complexity Theory 11 / 16
Eric Price (UT Austin) Complexity Theory 11 / 16
Eric Price (UT Austin) Complexity Theory 11 / 16
◮ be = 0001000004, with a 1 at position e. Eric Price (UT Austin) Complexity Theory 11 / 16
◮ be = 0001000004, with a 1 at position e. ◮ av = 101001000100104, with a 1 at position e if v ∈ e, and another 1
Eric Price (UT Austin) Complexity Theory 11 / 16
◮ be = 0001000004, with a 1 at position e. ◮ av = 101001000100104, with a 1 at position e if v ∈ e, and another 1
Eric Price (UT Austin) Complexity Theory 11 / 16
◮ be = 0001000004, with a 1 at position e. ◮ av = 101001000100104, with a 1 at position e if v ∈ e, and another 1
Eric Price (UT Austin) Complexity Theory 11 / 16
1 Transform an arbitrary instance x of A into a very specific instance y
◮ be = 0001000004, with a 1 at position e. ◮ av = 101001000100104, with a 1 at position e if v ∈ e, and another 1
◮ T = k4|E| +
e 2 · 4e
Eric Price (UT Austin) Complexity Theory 12 / 16
1 Transform an arbitrary instance x of A into a very specific instance y
◮ be = 0001000004, with a 1 at position e. ◮ av = 101001000100104, with a 1 at position e if v ∈ e, and another 1
◮ T = k4|E| +
e 2 · 4e
2 Show how to transform any certificate for x into a certificate for y. ◮ Done: given cover S, take av for v ∈ S and some be as necessary. ◮ Hence if x is YES, y must be YES. Eric Price (UT Austin) Complexity Theory 12 / 16
1 Transform an arbitrary instance x of A into a very specific instance y
◮ be = 0001000004, with a 1 at position e. ◮ av = 101001000100104, with a 1 at position e if v ∈ e, and another 1
◮ T = k4|E| +
e 2 · 4e
2 Show how to transform any certificate for x into a certificate for y. ◮ Done: given cover S, take av for v ∈ S and some be as necessary. ◮ Hence if x is YES, y must be YES. 3 Show how to transform any certificate for y into a certificate for x. Eric Price (UT Austin) Complexity Theory 12 / 16
1 Transform an arbitrary instance x of A into a very specific instance y
◮ be = 0001000004, with a 1 at position e. ◮ av = 101001000100104, with a 1 at position e if v ∈ e, and another 1
◮ T = k4|E| +
e 2 · 4e
2 Show how to transform any certificate for x into a certificate for y. ◮ Done: given cover S, take av for v ∈ S and some be as necessary. ◮ Hence if x is YES, y must be YES. 3 Show how to transform any certificate for y into a certificate for x. ◮ Certificate for y is a set of SV and SE with
Eric Price (UT Austin) Complexity Theory 12 / 16
1 Transform an arbitrary instance x of A into a very specific instance y
◮ be = 0001000004, with a 1 at position e. ◮ av = 101001000100104, with a 1 at position e if v ∈ e, and another 1
◮ T = k4|E| +
e 2 · 4e
2 Show how to transform any certificate for x into a certificate for y. ◮ Done: given cover S, take av for v ∈ S and some be as necessary. ◮ Hence if x is YES, y must be YES. 3 Show how to transform any certificate for y into a certificate for x. ◮ Certificate for y is a set of SV and SE with
◮ In base 4, the e = (u, v)th digit appears in au, av, and be. Eric Price (UT Austin) Complexity Theory 12 / 16
1 Transform an arbitrary instance x of A into a very specific instance y
◮ be = 0001000004, with a 1 at position e. ◮ av = 101001000100104, with a 1 at position e if v ∈ e, and another 1
◮ T = k4|E| +
e 2 · 4e
2 Show how to transform any certificate for x into a certificate for y. ◮ Done: given cover S, take av for v ∈ S and some be as necessary. ◮ Hence if x is YES, y must be YES. 3 Show how to transform any certificate for y into a certificate for x. ◮ Certificate for y is a set of SV and SE with
◮ In base 4, the e = (u, v)th digit appears in au, av, and be. ◮ Hence no overflows, and one of au or av must be picked for each e ∈ E. Eric Price (UT Austin) Complexity Theory 12 / 16
1 Transform an arbitrary instance x of A into a very specific instance y
◮ be = 0001000004, with a 1 at position e. ◮ av = 101001000100104, with a 1 at position e if v ∈ e, and another 1
◮ T = k4|E| +
e 2 · 4e
2 Show how to transform any certificate for x into a certificate for y. ◮ Done: given cover S, take av for v ∈ S and some be as necessary. ◮ Hence if x is YES, y must be YES. 3 Show how to transform any certificate for y into a certificate for x. ◮ Certificate for y is a set of SV and SE with
◮ In base 4, the e = (u, v)th digit appears in au, av, and be. ◮ Hence no overflows, and one of au or av must be picked for each e ∈ E. ◮ Exactly k of the au picked so 4|E| term matches. Eric Price (UT Austin) Complexity Theory 12 / 16
1 Transform an arbitrary instance x of A into a very specific instance y
◮ be = 0001000004, with a 1 at position e. ◮ av = 101001000100104, with a 1 at position e if v ∈ e, and another 1
◮ T = k4|E| +
e 2 · 4e
2 Show how to transform any certificate for x into a certificate for y. ◮ Done: given cover S, take av for v ∈ S and some be as necessary. ◮ Hence if x is YES, y must be YES. 3 Show how to transform any certificate for y into a certificate for x. ◮ Certificate for y is a set of SV and SE with
◮ In base 4, the e = (u, v)th digit appears in au, av, and be. ◮ Hence no overflows, and one of au or av must be picked for each e ∈ E. ◮ Exactly k of the au picked so 4|E| term matches. ◮ Hence SV is a vertex cover. Eric Price (UT Austin) Complexity Theory 12 / 16
Eric Price (UT Austin) Complexity Theory 13 / 16
◮ PP: failure probability < 1/2.
Eric Price (UT Austin) Complexity Theory 14 / 16
Eric Price (UT Austin) Complexity Theory 15 / 16
Eric Price (UT Austin) Complexity Theory 15 / 16
Eric Price (UT Austin) Complexity Theory 15 / 16
Eric Price (UT Austin) Complexity Theory 15 / 16
Eric Price (UT Austin) Complexity Theory 15 / 16
Eric Price (UT Austin) Complexity Theory 15 / 16
◮ Given a circuit f and input x, what is f (x)?
◮ SAT: given f , determine if ∃x : f (x) = 1? ◮ Given a puzzle, find the solution ◮ Easy to verify once the solution is found.
◮ TQBF: ∃x1∀x2∃x3 · · · ∀xn : f (x) = 1 ◮ Think chess: do I have a move, so no matter what you do, I can find a
◮ Puzzles/games with exponentially many moves may be harder. ◮ Go: actually EXPTIME-complete to solve a position. ◮ Zelda: actually PSPACE-complete to solve a level. Eric Price (UT Austin) Complexity Theory 16 / 16
Eric Price (UT Austin) Complexity Theory 17 / 16
Eric Price (UT Austin) Complexity Theory 18 / 16