P vs. NP What now?
Attribution These slides were prepared for the New Jersey Governor s School course The Math Behind the Machine taught in the summer of 2011 by Grant Schoenebeck Large parts of these slides were copied or modified from the previous years courses given by Troy Lee in 2010 and Ryan and Virginia Williams in 2009.
Questions? You are given the complete graph of Facebook. What questions would you ask? (What questions could we hope to answer?)
So What Now? Relax worst case Use CPLEX/SAT solver Relax time constraints Relax exact optimal
Proving conp statements Resolution x A x B A B Can try to take 3-SAT formula and resolve! Thm: any false statement will resolve to x x Thm: RANDOM 3-Sat will take time 2 n to resolve. Phases of hardness
Approximation Algorithms Cannot solve Vertex Cover, but can we find a good approximation for it? Recall VertexCover: Given (G, k) a graph and integer: Are there k nodes in G that are incident on all edges? Can we approximate it? Wait! That would require us to prove an approximate conp statement: that the VertexCover is not too small.
X Vertex Cover Approximation min v V x v (u, v) E x v + x u 1 v V : x v {0, 1} 0 x v 1 Integrality Gap = IP LP 2 by rounding 2: complete graph IP = n-1 LP = n/2
Greedy Set Cover SetCover: Given list of n items S and subsets of S: S 1, S 2,, S m and integer k: are there k subsets that cover S? Take largest set, then largest set with respect to remaining elements and repeat as necessary. At each step, greedy covers at least a 1-1/OPT fraction of what is left. So takes at most x steps where 1 1 x = n so x = O(log(n)m) OPT
Traveling Salesmen Problem TSP: Given a list of cities and pairwise distances between them, is there a tour which visits each city exactly once and has length at most k? Find Minimum Spanning Tree Find optimal matching on odd degree vertices Now take Eulerian cycle.
P vs. NP Game Show Numbers Graphs Logic Networks 128 128 128 128 256 256 256 256 512 512 512 512
Primality Testing Given a number n, decide if n is prime. Agrawal, Kayal, and Saxena gave an algorithm for testing primality with running time about
Quadratic Equations Given positive integers a,b,c, do there exist positive integers x and y such that NP-Complete!
Factoring Given a number n, and m < n, does n have a factor d satisfying 1 < d < m? Currently the best algorithm for factoring takes time about It is widely believed that factoring is not NP-complete.
Hamiltonian Cycle Given a graph, is there a cycle which visits all vertices exactly once? NP-Complete!
Hamiltonian Puzzle Can a knight visit all squares on a chess board exactly once?
Independent Set Given a graph G and integer k, are there at least k vertices with no edges between them? NP-Complete!
Eulerian Cycle Given a graph G, is there a cycle which traverses each edge exactly once? Thm: A graph has an Eulerian cycle if and only if every vertex has even degree.
Euler s Walk Is it possible to take a walk around Konigsberg crossing each bridge exactly once? Euler showed that you cannot!
Circuits Composed of AND,OR,NOT gates AND OR AND AND Can have fan out > 1 AND 0 1 OR 1 1 NOT 1 0 0 Means you don t have to recompute things. 0
Circuit SAT AND OR AND AND Given a circuit with variable inputs, is there a setting of the variables which evaluates to 1? AND OR 1 NOT 0 NP-Complete!
3-SAT Given a set of clauses, each consisting of the OR of three variables or their negations, does there exist a Boolean assignment satisfying all the clauses? NP-Complete!
2-SAT Given a set of clauses, each consisting of the OR of two variables or their negations, does there exist a Boolean assignment satisfying all the clauses? Solvable in polynomial time.
Cuts A cut is a set of edges whose removal leaves a graph disconnected.
Balanced Cut Given a graph G and integer k, is there a cut of at most k edges that separates the vertices into two unconnected parts S,T satisfying NP-Complete!
Minimum Spanning Tree Challenge Round!
Minimum Spanning Tree A tree is a connected acyclic graph. A minimum spanning tree of a weighted graph G is the smallest weight tree that is a subgraph of G and includes all the vertices of G.
Minimum Spanning Tree
Find MST in this graph...
Traveling Salesman Problem Challenge Round!
Traveling Salesman Problem Given n cities and the pairwise distances between them, find the shortest tour which visits each city exactly once.
Find the shortest tour in this graph...