
Certification and NP-Completeness 1 Definition of NP efficient certification the class of problems NP 2 NP-Complete Problems a definition of NP-complete circuit satisfiability 3-satifiability CS 401/MCS 401 Lecture 19 Computer Algorithms I Jan Verschelde, 1 August 2018 Computer Algorithms I (CS 401/MCS 401) Certification and NP-Completeness L-19 1 August 2018 1 / 32 Certification and NP-Completeness 1 Definition of NP efficient certification the class of problems NP 2 NP-Complete Problems a definition of NP-complete circuit satisfiability 3-satifiability Computer Algorithms I (CS 401/MCS 401) Certification and NP-Completeness L-19 1 August 2018 2 / 32 computing and checking a solution What is good about the independent set problem? If we have an independent set of size k in a graph, then with the independent set of size k as a given, verification that the graph has indeed an independent set of size k is easy. What is good about the 3-SAT problem? If we have a truth assignment for a 3-SAT problem, then with the assignment of the variables as a given, verification that the 3-SAT problem is satisfiable is easy. The point is that there is a difference between computing a solution to a difficult problem, and verifying whether a given output is indeed a solution. Computer Algorithms I (CS 401/MCS 401) Certification and NP-Completeness L-19 1 August 2018 3 / 32 we distinguish between problems and algorithms On problems: The input to our problem is encoded by a finite binary string s. The length of a string s is denoted by jsj. A decision problem X is identified with the set of strings on which the answer is "yes". On algorithms: An algorithm A takes on input a string s and returns "yes" or "no". A solves the problem X if for all strings s: A(s) = "yes" , s 2 X. Algorithm A has polynomial running time if there is a polynomial function p so that for every input string s, A terminates on s in at most O(p(jsj)) steps. Definition The set P is the set of all problems X for which there exists an algorithm A with a polynomial running time that solves X. Computer Algorithms I (CS 401/MCS 401) Certification and NP-Completeness L-19 1 August 2018 4 / 32 efficient certification To check a solution for a problem X, we need the input string s and a seperate certificate string t which contains evidence that s is a "yes" instance of X. Definition Algorithm B is an efficient certifier for problem X if B runs in polynomial time on the inputs s and t, and there is a polynomial function p so that for every string s, we have s 2 X if and only if there exists a string t such that jtj ≤ p(jsj) and B(s; t) = "yes". An efficient certifier evaluates proposed proofs if they are not too long, could be used in a brute force algorithm: try all inputs. Computer Algorithms I (CS 401/MCS 401) Certification and NP-Completeness L-19 1 August 2018 5 / 32 Certification and NP-Completeness 1 Definition of NP efficient certification the class of problems NP 2 NP-Complete Problems a definition of NP-complete circuit satisfiability 3-satifiability Computer Algorithms I (CS 401/MCS 401) Certification and NP-Completeness L-19 1 August 2018 6 / 32 the class of problems NP Definition The set NP collects all problems for which an efficient certifier exists. Theorem P ⊆ N P Proof. Consider a problem X 2 P So there is polynomial-time algorithm A to solve X. To show that X 2 N P, we need to find an efficient certifier for X. For inputs s and t, the certifier algorithm B returns the value of A(s). Why is B a efficient? A runs in a polynomial time. Why is B a certifier? Recall that X is decision problem. If s 2 X, then for every t of length at most p(jsj), B(s; t) = A(s) = "yes". Otherwise, B(s; t) = "no". Q.E.D. Computer Algorithms I (CS 401/MCS 401) Certification and NP-Completeness L-19 1 August 2018 7 / 32 an efficient certifier for the independent set problem Definition Given a graph G = (V ; E), a subset S ⊆ V is an independent set if for all u; v 2 S: (u; v) 62 E. Given a graph G and some number k, does G contain an independent set of size at least k? 1 2 1 2 3 4 5 3 4 5 6 7 6 7 The certificate t is the set S of at least k vertices. The certifier checks that, for all pairs u; v 2 S: (u; v) 62 E. Computer Algorithms I (CS 401/MCS 401) Certification and NP-Completeness L-19 1 August 2018 8 / 32 an efficient certifier for the set cover problem Given are U = f 1; 2;:::; n g, a collection Si ⊆ U, i = 1; 2;:::; m, and [ some number k. Is there an index set I = f i1; i2;:::; ik g: Sj = U ? j2I a collection a set cover The certificate t is the sequence of k subsets of U. The certifier checks that the union of the subsets equals U. Computer Algorithms I (CS 401/MCS 401) Certification and NP-Completeness L-19 1 August 2018 9 / 32 an efficient certifier for the 3-satisfiability problem The conjunction of clauses (x _ y _ z) ^ (x _ y _ z) ^ (x _ y _ z) has a satisfying truth assignment ν(x) = 1, ν(y) = 0, ν(z) = 0. The certificate t is an assignment ν to the Boolean variables. The certifier evaluates the clauses with respect to the assignment ν. Computer Algorithms I (CS 401/MCS 401) Certification and NP-Completeness L-19 1 August 2018 10 / 32 the question Is there a problem in NP that does not belong to P? Does P = NP? The general belief is P 6= NP. Computer Algorithms I (CS 401/MCS 401) Certification and NP-Completeness L-19 1 August 2018 11 / 32 Certification and NP-Completeness 1 Definition of NP efficient certification the class of problems NP 2 NP-Complete Problems a definition of NP-complete circuit satisfiability 3-satifiability Computer Algorithms I (CS 401/MCS 401) Certification and NP-Completeness L-19 1 August 2018 12 / 32 NP-complete problems What are the hardest problems in NP? Definition Problem X is an NP-complete problem if 1 X 2 N P, and 2 for all Y 2 N P: Y ≤P X. Every problem in NP can be reduced to an NP-complete problem. Theorem Suppose X is an NP-complete problem. Then X is solvable in polynomial time if and only if P = NP. Computer Algorithms I (CS 401/MCS 401) Certification and NP-Completeness L-19 1 August 2018 13 / 32 Theorem Suppose X is an NP-complete problem. Then X is solvable in polynomial time if and only if P = NP. Proof. If and only if means ) and (. ( If P = NP, then X can be solved in polynomial time as X 2 N P. ) Suppose X can be solved in polynomial time. For all Y 2 N P: Y ≤P X. By the Proposition on Slide 9 of Lecture 18, Y can be solved in polynomial time, and thus Y 2 P, so N P ⊆ P. By the Theorem on slide 7, P ⊆ N P, so P = NP. Q.E.D. Corollary If there is any problem in NP that cannot be solved in polynomial time, then no NP-complete problem can be solved in polynomial time. Computer Algorithms I (CS 401/MCS 401) Certification and NP-Completeness L-19 1 August 2018 14 / 32 Certification and NP-Completeness 1 Definition of NP efficient certification the class of problems NP 2 NP-Complete Problems a definition of NP-complete circuit satisfiability 3-satifiability Computer Algorithms I (CS 401/MCS 401) Certification and NP-Completeness L-19 1 August 2018 15 / 32 encoding a problem in NP Do NP-complete problems exist? Every problem in NP can be reduced to an NP-complete problem. Could there be two incomparable problems Y and Z so that there is no X 2 N P so that Y ≤P X and Z ≤P X? To prove a problem is NP-complete, we must show how it could encode any problem in NP. This is harder to reformulating specific problems. Computer Algorithms I (CS 401/MCS 401) Certification and NP-Completeness L-19 1 August 2018 16 / 32 a circuit: :(1 ^ x) ^ ((x _ 0) ^ (y _ z)) output: ^ : ^ ^ _ _ inputs: 1 x 0 y z Computer Algorithms I (CS 401/MCS 401) Certification and NP-Completeness L-19 1 August 2018 17 / 32 definition of a circuit A circuitK is a labeled, directed acyclic graph: The sources in K are nodes with no incoming edges. The sources are labeled either with a constant 0 or 1, or with the name of a distinct variable. Nodes labeled with the name of a variable are inputs to the circuit. Internal nodes are labeled with a Boolean operation, which is either the negation : (not), the disjunction _ (or), or the conjunction ^ (and). Nodes labeled with : have one incoming edge, nodes labeled with _ or ^ have two incoming edges. The output of the circuit is one single sink, with no outgoing edges. The output represents what the circuit computes. Computer Algorithms I (CS 401/MCS 401) Certification and NP-Completeness L-19 1 August 2018 18 / 32 the circuit satisfiability problem Assignments to the inputs of a circuit that results in the output one is called a satifying assignment.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages32 Page
-
File Size-