NP-completeness The Chinese University of Hong Kong Fall 2008

Slides:



Advertisements
Similar presentations
Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
Advertisements

1 NP-completeness Lecture 2: Jan P The class of problems that can be solved in polynomial time. e.g. gcd, shortest path, prime, etc. There are many.
Department of Computer Science & Engineering
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
Theory of Computing Lecture 16 MAS 714 Hartmut Klauck.
Computability and Complexity 13-1 Computability and Complexity Andrei Bulatov The Class NP.
NP-completeness Sipser 7.4 (pages 271 – 283). CS 311 Fall The classes P and NP NP = ∪ k NTIME(n k ) P = ∪ k TIME(n k )
NP and NP-completeness
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
Analysis of Algorithms CS 477/677
NP-complete examples CSC3130 Tutorial 11 Xiao Linfu Department of Computer Science & Engineering Fall 2009.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture NP-Completeness Jan Maluszynski, IDA, 2007
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.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Polynomial.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Efficient.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
NP-COMPLETENESS PRESENTED BY TUSHAR KUMAR J. RITESH BAGGA.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
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.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong The Cook-Levin.
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.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
CSE 6311 – Spring 2009 ADVANCED COMPUTATIONAL MODELS AND ALGORITHMS Lecture Notes – Feb. 3, 2009 Instructor: Dr. Gautam Das notes by Walter Wilson.
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.
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.
April 13 th Class Notes Hw# 5 will be worth 50 points and it will be posted tonight or tomorrow.
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.
Computability Examples. Reducibility. NP completeness. Homework: Find other examples of NP complete problems.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
NP-Completeness A problem is NP-complete if: It is in NP
The NP class. NP-completeness
NP-Complete Problems.
P & NP.
Chapter 10 NP-Complete Problems.
Computational Complexity Theory
NP and NP-completeness
Richard Anderson Lectures NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
Lecture 22 Complexity and Reductions
Reducibility The Chinese University of Hong Kong Fall 2010
NP-complete problems The Chinese University of Hong Kong Fall 2008
NP-Completeness Yin Tat Lee
CS21 Decidability and Tractability
Intro to Theory of Computation
ICS 353: Design and Analysis of Algorithms
Intro to NP Completeness
More on DFA minimization and DFA equivalence
Richard Anderson Lecture 28 NP-Completeness
Efficient computation
Prabhas Chongstitvatana
More undecidable languages
CS 3343: Analysis of Algorithms
NP-Completeness Yin Tat Lee
More on NP-completeness
More NP-complete problems
NP-Completeness Lecture for CS 302.
More undecidable languages
A Few Sample Reductions
Instructor: Aaron Roth
Instructor: Aaron Roth
Lecture 23 NP-Hard Problems
Presentation transcript:

NP-completeness The Chinese University of Hong Kong Fall 2008 CSC 3130: Automata theory and formal languages NP-completeness Andrej Bogdanov http://www.cse.cuhk.edu.hk/~andrejb/csc3130

P and NP P = languages that can be decided on a TM with polynomial running time (problems that admit efficient algorithms) NP = languages decidable on a nondeterministic TM with polynomial running time (solutions can be checked efficiently) decidable We believe that NP is bigger than P, but we are not 100% sure NP P

Evidence that NP is bigger than P CLIQUE = {(G, k): G is a graph with a clique of k vertices} IS = {(G, k): G is a graph with an independent set of k vertices} VC = {(G, k): G is a graph with a vertex cover of k vertices} SAT = {f: f is a satisfiable Boolean formula} These (and many others) are in NP Their solutions, once found, are easy to verify But no efficient algorithms are known for any of them The fastest known algorithms take time ≈2n

Equivalence of certain NP languages We strongly suspect that problems like CLIQUE, SAT, etc. require time ≈2n to solve We do not know how to prove this, but what we can prove is that If any one of them is tractable (by a polynomial- time algorithm), then all of them are tractable

Equivalence of certain NP languages All these problems are as hard as one another Moreover, they are at the “frontier” of NP They are at least as hard as any problem in NP NP clique independent set vertex-cover P satisfiability

Polynomial-time reductions What do we mean when we say, for example, We mean that Or, we can convert an imaginary poly-time algorithm for IS into one for CLIQUE “CLIQUE is at least as hard as IS” If CLIQUE has a polynomial-time algorithm, so does IS

Polynomial-time reductions CLIQUE = {(G, k): G is a graph with a clique of k vertices} IS = {(G, k): G is a graph with an independent set of k vertices} Theorem 1 2 If CLIQUE has a polynomial-time algorithm, so does IS 3 4 {1, 4}, {2, 3, 4}, {1} are cliques {1, 2}, {1, 3}, {4} are independent sets

Polynomial-time reductions If CLIQUE has a polynomial-time algorithm, so does IS Proof: Suppose CLIQUE has an algorithm A We want to use it to solve IS G, k reject if not accept if G has IS of size k reject if not accept if G’ has clique of size k A G’, k’

Reducing IS to CLIQUE We look for a polynomial-time transformation s.t.: If G’ has a clique of size k’, then G has an IS of size k R G, k G’, k’ If G’ does not have a clique of size k’, then G has no IS of size k 1 2 3 4 1 2 3 4 flip all edges G G’ set k’ = k ISs of size k cliques of size k’

✓ ✓ Reducing IS to CLIQUE R On input (G, k) Construct G’ by flipping all edges of G Set k’ = k Output (G’, k’) R G, k G’, k’ independent sets in G cliques in G’ If G’ has a clique of size k’, then G has an IS of size k ✓ If G’ does not have a clique of size k’, then G has no IS of size k ✓

Reduction recap We showed that by converting an imaginary algorithm for CLIQUE into one for IS To do this, we came up with a reduction that transforms instances of IS into ones for CLIQUE If CLIQUE has a polynomial-time algorithm, so does IS

Polynomial-time reductions Language L polynomial-time reduces to L’ if there exists a polynomial-time computable map R that takes an instance x of L into instance y of L’ s.t. x ∈ L if and only if y ∈ L’ L (IS) L’ (CLIQUE) x (G, k) R y (G’, k’) x ∈ L y ∈ L’ (G has IS of size k) (G’ has clique of size k’)

Meaning of poly-time reductions Saying L reduces to L’ means L is easier than L’ In other words, if we can solve L’, then we can also solve L Theorem Proof If L reduces to L’ and L’ ∈ P, then L ∈ P acc R algorithm for L’ x y rej x ∈ L y ∈ L’ algorithm accepts

Notes about reductions The direction of the reduction is very important This makes sense, because “A is easier than B” and “B is easier than A” mean different things However, it is possible that L reduces to L’ and L’ reduces to L This means that L and L’ are as hard as one another For example, IS and CLIQUE reduce to one another

The Cook-Levin Theorem Every L ∈ NP reduces to SAT SAT = {f: f is a satisfiable Boolean formula} So every problem in NP is easier than SAT But SAT itself is in NP, so SAT must be the “hardest problem” in NP: If SAT ∈ P, then P = NP

Interpretation of Cook-Levin Theorem Optimistic view: Pessimistic view: If we manage to solve SAT, then we can also solve CLIQUE, scheduling, and almost anything Since we do not believe P = NP, it is unlikely that we will ever have a fast algorithm for SAT