1 / 64

Inspiration Versus Perspiration: The P = ? NP Question

Great Theoretical Ideas In Computer Science. Inspiration Versus Perspiration: The P = ? NP Question. Lecture. CS 15-251. Computational Complexity Theory.

Download Presentation

Inspiration Versus Perspiration: The P = ? NP Question

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Great Theoretical Ideas In Computer Science Inspiration Versus Perspiration:The P =? NP Question Lecture CS 15-251

  2. Computational Complexity Theory • Computational Complexity Theory is the study of how much of a given resource (such as time, space, parallelism, randomness, algebraic operations, communication, or quantum steps) is required to perform the computations that interest us the most.

  3. WORST-CASE TIME • We say that a program takes worst-case time T(n), if some input of size n takes T(n) steps, and no input of size n takes longer. • The input size is measured in bits, unless stated otherwise.

  4. A Graph Named “Gadget”

  5. K-COLORING • A k-coloring of a graph is an assignment of one color ro each vertex such that: • No more than k colors are used • No two adjacent vertices receive the same color • A graph is called k-colorable iff it has a k-coloring

  6. A CRAYOLA Question! • Is Gadget 2-colorable? No, it contains a triangle.

  7. A CRAYOLA Question! • Is Gadget 3-colorable? Yes.

  8. 2 CRAYOLAS • Given a graph G, what is a fast algorithm to decide if it can be 2-colored? PERSPIRATION; BRUTE FORCE: Try out all 2n ways of 2 coloring G.

  9. 3 CRAYOLAS • Given a graph G, what is a fast algorithm to decide if it can be 3-colored?

  10. K-CLIQUES • A K-clique is a set of K nodes with all k(K-1)/2 possible edges between them.

  11. This graph contains a 4-clique

  12. Given an n-node graph G and a number k, how can you decide if G contains a k-clique? • PERSPIRATION: Try out all n choose k possible locations for the k clique • INSPIRATION: ?

  13. INDEPENDENT SET • An independent set is a set of node with no edges between them. This graph contains an independent set of size 3.

  14. Given an n-node graph G and a number k, how can you decide if G contains an independent set of size k? • PERSPIRATION: Try out all n choose k possible locations for independent set • INSPIRATION: ?

  15. Combinational Circuits • AND, OR, NOT, 0, 1 gates wired together with no feedback allowed.

  16. x1 x2 x3 AND AND AND OR OR OR OR

  17. CIRCUIT-SATISFIABILITY(decision version) • Given a circuit with n-inputs and one output, is there a way to assign 0-1 values to the input wires so that the output value is 1 (true)?

  18. CIRCUIT-SATISFIABILITY(search version) • Given a circuit with n-inputs and one output, find an assignment of 0-1 values to the input wires so that the output value is 1 (true), or determine that no such assignment exists?

  19. Given a circuit, is it satisfiable? • PERSPIRATION: Try out all 2n assignments • INSPIRATION: ?

  20. We have seen 4 problems: coloring, clique, independent set, and circuit SAT. They all have a common story: A large space of possibilities only a tiny fraction of which satisfy the constraints. Brute force takes too long, and no feasible algorithm is known.

  21. CLIQUE / INDEPENDENT SET • Two problems that are cosmetically different, but substantially the same

  22. Complement Of G • Given a graph G, let G*, the complement of G, be the graph obtained by the rule that two nodes in G* are connected if and only if the corresponding nodes of G are not connected

  23. <G*, k> BUILD:Indep. SetOracle GIVEN:Clique Oracle Let G be an n-node graph. <G,k>

  24. <G*, k> BUILD:CliqueOracle GIVEN: Indep. Set Oracle Let G be an n-node graph. <G,k>

  25. Thus, we can quickly reduce clique problem to an independent set problem and vice versa. There is a fast method for one if and only if there is a fast method for the other.

  26. Given an oracle for circuit SAT, how can you quickly solve 3-colorability?

  27. Vn(X,Y) • Let Vn be a circuit that takes an n-node graph X and an assignment of colors to nodes Y, and verifies that Y is a valid 3 coloring of X. I.e., Vn(X,Y)=1 iff Y is a 3 coloring of X. • X is expressed as an n choose 2 bit sequence. Y is expressed as a 2n bit sequence. • Given n, we can construct Vn in time O(n2).

  28. Vn(G,Y) BUILD:3-colorOracle GIVEN:SATOracle Let G be an n-node graph. G

  29. Given an oracle for circuit SAT, how can you quickly solve k-clique?

  30. Vn,k(X,Y) • Let Vn be a circuit that takes an n-node graph X and a subset of nodes Y, and verifies that Y is a k-clique X. I.e., Vn(X,Y)=1 iff Y is a k-clique of X. • X is expressed as an n choose 2 bit sequence. Y is expressed as an n bit sequence. • Given n, we can construct Vn,k in time O(n2).

  31. Vn,k(G,Y) BUILD:CliqueOracle GIVEN:SATOracle Let G be an n-node graph. <G,k>

  32. Given an oracle for 3-colorability, how can you quickly solve circuit SAT?

  33. T F Y X Output

  34. F T Y X Output

  35. F T Y X Output

  36. T F X NOT gate

  37. y z x NOT OR OR x y z

  38. y z x NOT OR OR x y z Satisfiabilty of this circuit = 3-colorability of this graph

  39. Graph composed of gadgets that mimic the gates in C BUILD:SATOracle GIVEN:3-colorOracle Let C be an n-input circuit. C

  40. Formal Statement • The is a polynomial-time function f such that: • C is satisfiable <-> f(C) is 3 colorable

  41. 4 Problems All Equivalent • If you can solve one quickly then you can solve them all quickly: • Circuit-SAT • Clique • Independent Set • 3 Colorability

More Related