Theory of Computation, Feodor F. Dragan, Kent State University 1 NP-Completeness P: is the set of decision problems (or languages) that are solvable in.

Slides:



Advertisements
Similar presentations
NP-Hard Nattee Niparnan.
Advertisements

NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Concept of Completeness and hardness for a complexity class Definition.
The Theory of NP-Completeness
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Complexity 11-1 Complexity Andrei Bulatov NP-Completeness.
Computability and Complexity 15-1 Computability and Complexity Andrei Bulatov NP-Completeness.
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Definition of complexity class NP –Nondeterministic computation –Problems.
Graphs 4/16/2017 8:41 PM NP-Completeness.
1 Polynomial Church-Turing thesis A decision problem can be solved in polynomial time by using a reasonable sequential model of computation if and only.
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
The Theory of NP-Completeness
NP-complete and NP-hard problems
Analysis of Algorithms CS 477/677
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
Chapter 11: Limitations of Algorithmic Power
Toward NP-Completeness: Introduction Almost all the algorithms we studies so far were bounded by some polynomial in the size of the input, so we call them.
Clique Cover Cook’s Theorem 3SAT and Independent Set
P, NP, and NP-Complete Suzan Köknar-Tezel.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
Lecture 22 More NPC problems
Computational Complexity Theory Lecture 2: Reductions, NP-completeness, Cook-Levin theorem Indian Institute of Science.
NP Complexity By Mussie Araya. What is NP Complexity? Formal Definition: NP is the set of decision problems solvable in polynomial time by a non- deterministic.
MCS 312: NP Completeness and Approximation algorthms Instructor Neelima Gupta
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
NP-COMPLETENESS PRESENTED BY TUSHAR KUMAR J. RITESH BAGGA.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
CSC401 – Analysis of Algorithms Chapter 13 NP-Completeness Objectives: Introduce the definitions of P and NP problems Introduce the definitions of NP-hard.
Techniques for Proving NP-Completeness Show that a special case of the problem you are interested in is NP- complete. For example: The problem of finding.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
1 P P := the class of decision problems (languages) decided by a Turing machine so that for some polynomial p and all x, the machine terminates after at.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
1 Chapter 34: NP-Completeness. 2 About this Tutorial What is NP ? How to check if a problem is in NP ? Cook-Levin Theorem Showing one of the most difficult.
Design and Analysis of Algorithms - Chapter 101 Our old list of problems b Sorting b Searching b Shortest paths in a graph b Minimum spanning tree b Primality.
NP-Completeness (Nondeterministic Polynomial Completeness) Sushanth Sivaram Vallath & Z. Joseph.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
CSE 589 Part V One of the symptoms of an approaching nervous breakdown is the belief that one’s work is terribly important. Bertrand Russell.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
NPC.
CSC 413/513: Intro to Algorithms
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong NP-complete.
COMPLEXITY. Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several.
1 The Theory of NP-Completeness 2 Review: Finding lower bound by problem transformation Problem X reduces to problem Y (X  Y ) iff X can be solved by.
Computability Examples. Reducibility. NP completeness. Homework: Find other examples of NP complete problems.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
TU/e Algorithms (2IL15) – Lecture 10 1 NP-Completeness, II.
Richard Anderson Lecture 26 NP-Completeness
Hard Problems Introduction to NP
Summary of the previous lecture
NP-Completeness Yin Tat Lee
Richard Anderson Lecture 25 NP-Completeness
NP-Completeness Proofs
Chapter 11 Limitations of Algorithm Power
NP-Complete Problems.
NP-Completeness Yin Tat Lee
CSE 589 Applied Algorithms Spring 1999
Instructor: Aaron Roth
CHAPTER 7 Time complexity
Lecture 23 NP-Hard Problems
Presentation transcript:

Theory of Computation, Feodor F. Dragan, Kent State University 1 NP-Completeness P: is the set of decision problems (or languages) that are solvable in polynomial time. NP: is the set of decision problems (or languages) that can be verified in polynomial time. Polynomial reduction: L1 L2 means that there is a polynomial time computable function f such that x L1 if and only if f(x) L2. A more intuitive to think about this, is that if we had a subroutine to solve L2 in polynomial time, then we could use it to solve L1 in polynomial time Polynomial reductions are transitive, that is, if L1 L2 and L2 L3, then L1 L3. NP­Hard: L is NP­hard if for all L’ NP, L’ L. Thus, if we could solve L in polynomial time, we could solve all NP problems in polynomial time. NP­Complete: L is NP­complete if (1) L NP and (2) L is NP­hard. The importance of NP­complete problems should now be clear. If any NP­complete problem (and generally any NP­hard problem) is solvable in polynomial time, then every NP­complete problem (and in fact every problem in NP) is also solvable in polynomial time. Conversely, if we can prove that any NP­complete problem cannot be solved in polynomial time, then every NP­complete problem (and generally every NP­hard problem) cannot be solved in polynomial time. Thus all NP­complete problems are equivalent to one another (in that they are either all solvable in polynomial time, or none are).

Theory of Computation, Feodor F. Dragan, Kent State University 2 NP-Completeness (cont.) The figure below illustrates one way that the sets P, NP, NP­hard, and NP­ complete (NPC) might look. We say might because we do not know whether all of these complexity classes are distinct or whether they are all solvable in polynomial time. One is Graph Isomorphism, which asks whether two graphs are identical up to a renaming of their vertices. It is known that this problem is in NP, but it is not known to be in P. The other is QBF, which stands for Quantified Boolean Formulas. In this problem you are given a Boolean formula with quantifiers ( and ) and you want to know whether the formula is true or false. An alternative way to show that a problem is NPC is to use transitivity of. Lemma: L is NP­complete if (1) L NP and (2) L’ L for some NP­complete language L’. Note: The known NP­complete problem L’ is being reduced to candidate NP­ complete problem L. Keep this order in mind.

Theory of Computation, Feodor F. Dragan, Kent State University 3 Cook-Levin's Theorem and Reductions Unfortunately, to use this lemma, we need to have at least one NP­complete problem to start the ball rolling. Stephen Cook and Leonid Levin showed (~ 1970) that such a problem existed. Cook-Levin's theorem is rather complicated to prove. First we'll try to give a brief intuitive argument as to why such a problem might exist. For a problem to be in NP, it must have an efficient verification procedure. Virtually all NP problems can be stated in the form, ``does there exists X such that P(X)'', where X is some structure (e.g. a set, a path, a partition, an assignment, etc.) and P(X) is some property that X must satisfy (e.g. the set of objects must fill the knapsack, or the path must visit every vertex, or you may use at most k colors and no two adjacent vertices can have the same color). In showing that such a problem is in NP, the certificate consists of giving X, and the verification involves testing that P(X) holds. In general, any set X can be described by choosing a set of objects, which in turn can be described as choosing the values of some Boolean variables. Similarly, the property P(X) that you need to satisfy, can be described as a Boolean formula. Cook and Levin were looking for the most general possible property he could, since this should represent the hardest problem in NP to solve. They reasoned that computers (which represent the most general type of computational devices known) could be described entirely in terms of Boolean circuits, and hence in terms of Boolean formulas. If any problem were hard to solve, it would be one in which X is an assignment of Boolean values (true/false, 0/1) and P(X) could be any Boolean formula. This suggests the following problem, called the Boolean satisfiability problem.

Theory of Computation, Feodor F. Dragan, Kent State University 4 Boolean Satisfiability Problem SAT: Given a Boolean formula, is there some way to assign truth values (0/1, true/false) to the variables of the formula, so that the formula evaluates to true? A Boolean formula is a logical formula which consists of variables, and the logical operations meaning the negation of x, Boolean­or ( ) and Boolean­and ( ). Given a Boolean formula, we say that it is satisfiable if there is a way to assign truth values (0 or 1) to the variables such that the final result is 1. (As opposed to the case where no matter how you assign truth values the result is always 0.) For example, is satisfiable, by the assignment On the other hand, is not satisfiable. (Observe that the last two clauses imply that one of and must be true and the other must be false. This implies that neither of the subclauses involving and in the first two clauses can be satisfied, but cannot be set to satisfy them either.) Cook-Levin’s Theorem: SAT is NP-complete. Proof will be given in class.

Theory of Computation, Feodor F. Dragan, Kent State University 5

6

7 Reduction f from A to SAT

Theory of Computation, Feodor F. Dragan, Kent State University 8 Reduction f from A to SAT (cont.)

Theory of Computation, Feodor F. Dragan, Kent State University 9 Reduction f from A to SAT (cont.)

Theory of Computation, Feodor F. Dragan, Kent State University 10 Reduction f from A to SAT (cont.)

Theory of Computation, Feodor F. Dragan, Kent State University 11 Complexity of the Reduction f

Theory of Computation, Feodor F. Dragan, Kent State University 12 3­Conjunctive Normal Form (3­CNF) In fact, it turns out that a even more restricted version of the satisfiability problem is NP­complete. A literal is a variable or its negation, x or. A formula is in 3­conjunctive normal form (3­CNF) if it is the Boolean­and of clauses where each clause is the Boolean­or of exactly 3 literals. For example is in 3­CNF form. 3SAT is the problem of determining whether a formula in 3­CNF is satisfiable. It turns out that it is possible to modify the proof of Cook's theorem to show that 3SAT is also NP­complete. As an aside, note that if we replace the 3 in 3SAT with a 2, then everything changes. If a Boolean formula is given in 2SAT, then it is possible to determine its satisfiability in polynomial time. (It turns out that the problem can be reduced to computing the strong components in a directed graph.) Thus, even a seemingly small change can be the difference between an efficient algorithm and none.

Theory of Computation, Feodor F. Dragan, Kent State University 13

Theory of Computation, Feodor F. Dragan, Kent State University 14 More NP­completeness proofs Now that we know that 3SAT is NP­complete, we can use this fact to prove that other problems are NP­complete.