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.

Slides:



Advertisements
Similar presentations
Polynomial-time reductions We have seen several reductions:
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.
NP-Completeness: Reductions
NP and NP Complete. Definitions A problem is in the class P if there is a polynomial time solution to the problem A problem is in the class NP if there.
NP-Completeness More Reductions. Definitions P: is the class of all decision problems which can be solved in polynomial time, O(n^k) for some constant.
Department of Computer Science & Engineering
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
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 
Graphs 4/16/2017 8:41 PM 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.
The Theory of NP-Completeness
NP-Complete Problems Problems in Computer Science are classified into
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
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.
Chapter 11: Limitations of Algorithmic Power
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 22 Instructor: Paul Beame.
P, NP, and NP-Complete Suzan Köknar-Tezel.
1 The Theory of NP-Completeness 2 NP P NPC NP: Non-deterministic Polynomial P: Polynomial NPC: Non-deterministic Polynomial Complete P=NP? X = P.
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
The Complexity of Optimization Problems. Summary -Complexity of algorithms and problems -Complexity classes: P and NP -Reducibility -Karp reducibility.
NP-complete Problems SAT 3SAT Independent Set Hamiltonian Cycle
Summary  NP-hard and NP-complete  NP-completeness proof  Polynomial time reduction  List of NP-complete problems  Knapsack problem  Isomprphisim.
Polynomial-time reductions We have seen several reductions:
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.
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.
The Theory of Complexity for Nonpreemptive Scheduling 1.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
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.
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
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.
NP-Algorithms Tractable vs Intractable Some problems are intractable: as they grow large, we are unable to solve them in reasonable time.
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.
Lecture 25 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
NPC.
NP Completeness Piyush Kumar. Today Reductions Proving Lower Bounds revisited Decision and Optimization Problems SAT and 3-SAT P Vs NP Dealing with NP-Complete.
CSC 413/513: Intro to Algorithms
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 Ch 10 - NP-completeness Tractable and intractable problems Decision/Optimization problems Deterministic/NonDeterministic algorithms Classes P and NP.
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.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
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.
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.
The Theory of NP-Completeness
P & NP.
Richard Anderson Lecture 26 NP-Completeness
NP-Completeness Yin Tat Lee
ICS 353: Design and Analysis of Algorithms
Richard Anderson Lecture 25 NP-Completeness
NP-Complete Problems.
The Theory of NP-Completeness
Presentation transcript:

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 efficient algorithms. However, there are many problems for which no polynomial-time algorithm is known. We strongly suspect that many problems cannot be solved efficiently.

Toward NP-Completeness: Introduction In the last few weeks, we have been dealing with several “hard” problems, like: –Graph k-coloring: K n possible color assignments –Knapsack problem –Graph Hamilton Circuit –Bin-Packing(recall knapsack) –Euclidean TSP(Traveling Salesman Problem)

Toward NP-Completeness: SAT Satisfiability(SAT) problem: –Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several sums(or). For example, where addition and multiplication correspond to the and and or Boolean operations, and each variable is either 0 (false) or 1 (true). A Boolean expression is said to be satisfiable if there exists an assignment of 0s and 1s to its variables such that the value of the expression is 1.

Toward NP-Completeness: SAT Example: Can x, y, z be set so that this expression is true? (NO, in the above case.) –The SAT problem is to determine whether a given expression is satisfiable(without necessarily finding a satisfying assignment). 2 n different truth assignments. At least one is true All three the same At least one is false

Toward NP-Completeness: Preliminary Decision problem: problems with answer either “yes” or “no”. (e.g. Is there any TSP tour on graph G has length  k?) Decision problem can be viewed as language- recognition problem: (e.g. Is (G,k)  TSP?) –U: the set of possible inputs to the decision problem. –L  U is the set of inputs which yield “yes” –L: the language corresponding to the problem.

Toward NP-Completeness: Preliminary Definition: Let L 1 and L 2 be two languages from the input spaces U 1 and U 2. We say that L 1 is Polynomially reducible to L 2  a polynomial-time algorithm that converts each inputs u 1  U 1 to another input u 2  U 2 such that u 1  L 1 iff u 2  U 2. Note: The algorithm is polynomial in the size of the input u 1. We assume that the notion of size is well defined in the input spaces U 1 and U 2, so, in particular, the size of u 2 is also polynomial in the size of u 1.

Toward NP-Completeness: Preliminary Theorem: If L 1 polynomially reducible to L 2 and  polynomial-time algorithm for L 2, then  a polynomial-time algorithm for L 1. ( Denoted as L 1  L 2.) Corollary 1: L 1  L 2, and L 2  L 3 L 1  L 3 Corollary 2: L 1  L 2, and L 2  L 1 polynomially equivalent. Note that: Problems we mentioned above are “non- solvable”.(Roughly speaking, “solvable” means  a polynomial-time algorithm.) They are equivalent: solve one solve all.

Toward NP-Completeness: Preliminary Definition: X is poly-time reducible to Y in sense of Turing, written, if there exists an algorithm for solving X that would be polynomial if we took no account of the time needed to solve arbitrary instances of Y. Example: –X: Smallest_Factor  2? Y: Prime? Claim: –Z: # Distinct_Factors? Claim:

Toward NP-Completeness: Definitions and Classifications Class of Decision Problems: P: Problems could be solved by deterministic algorithm in polynomial time. NP: Problems for which  a non-deterministic algorithm whose running time is a polynomial in the size of the input. –“small” solutions in poly-size.(like “certificate”) –Solution could be easily checked in poly-time. Non-deterministic poly-time algorithm. Note: Whether P = NP is not known, but most people believe P != NP.

Toward NP-Completeness: Definitions and Classifications NP-Hard: A problem X is called an NP-hard problem if every problems in NP is polynomially reducible to X. NP-Complete: A problem X is called an NP- complete problem if: 1)X belongs to NP, and 2)X is NP-hard. Also, X is NP-complete if X  NP and Y is polynomially reducible to X for some Y that is NP-complete. NP-Complete problems are the hardest problems in NP.

Toward NP-Completeness: Cook’s theorem: The SAT problem is NP-complete. Once we have found an NP-complete problem, proving that other problems are also NP-complete becomes easier. Given a new problem Y, it is sufficient to prove that Cook’s problem, or any other NP-complete problems, is polynomially reducible to Y.

NP-Completeness Proof The following five problems are NP-complete: vertex cover(VC), dominating set(DS), 3SAT, 3-coloring, and clique. Definition:  A vertex cover of G=(V, E) is V’  V such that every edge in E is incident to some v  V’. Vertex Cover(VC): Given undirected G=(V, E) and integer k, does G have a vertex cover with  k vertices? CLIQUE: Does G contain a clique of size  k?

NP-Completeness Proof  A dominating set D of G=(V, E) is D  V such that every v  V is either in D or adjacent to at least one vertex of D. DS: given G, k, does G have a dominating set of size  k ? 3SAT: Give a Boolean expression in DNF such that each clause has exactly 3 variables, determine satisfiability.

NP-Completeness Proof: Reduction To prove NP-completeness of a new problem, we must first prove that the problem belongs to NP, which is usually(but not always!!!) easy, then reduce a known NP-complete problem to our problem in polynomial time. The reduction order used for the five problems mentioned above is illustrated in the figure below. To make them easier to understand, we present the proofs in order of difficulty rather than the tree order. This order is indicated in the figure by the numbers of the edges.

NP-Completeness Proof: Reduction Vertex Cover Clique3SAT SAT 3-Colorability Dominating Set All NP problems

NP-Completeness Proof: Vertex Cover(VC) Problem: Given undirected G=(V, E) and integer k, does G have a vertex cover with  k vertices? Theorem: the VC problem is NP-complete. Proof: ( Reduction from CLIQUE, i.e. given CLIQUE is NP-complete) –VC is NP. This is trivial since we can guess a cover of size  k and check it easily in poly-time. –Goal: Transform arbitrary CLIQUE instance into VC instance such that CLIQUE answer is “yes” iff VC answer is “yes”.

NP-Completeness Proof: Vertex Cover(VC) –Claim: CLIQUE(G, k) has same answer as VC (, n-k), where n = |V|. –Observe: If C = (u, F) clique in G, then v-u is VC in.

NP-Completeness Proof: Vertex Cover(VC) –Observe: If D is a VC in, then has no edge between vertices in V-D. So, we have k-clique in G n-k VC in –Can transform in polynomial time.

NP-Completeness Proof: DS  Definition: A dominating set D of G=(V, E) is D  V such that every v  V is either in D or adjacent to at least one vertex of D. Problem: given G, k, does G have a dominating set of size  k ? Theorem: DS is NP-complete Proof: (reduction from VC) DS  NP Given instance (G,k) of VC, make every edge of G into a triangle and answer DS.

NP-Completeness Proof: DS G’ has DS D of size k iff G has VC C of size k. –Without loss of generality, assume D  V, D has a DS  every edge hits some vertex in D  D is a VC in G –C is a VC  new and old vertices dominated. vw u z v vz w u vu z zu uw vw G:G’:

NP-Completeness Proof: 3SAT 3SAT: Give a Boolean expression in DNF such that each clause has exactly 3 variables, determine satisfiability. Theorem: 3SAT is NP-Complete Proof: 3SAT  NP Let E be an arbitrary instance of SAT arbitrary clause of E And k  4

NP-Completeness Proof: 3SAT C’ is satisfiable iff C is satisfiable: –C’= 1  at least one x i = 1  C = 1 –C = 1  at least one x i = 1  can set y i ’s so that C’ = 1

NP-Completeness Proof: CLIQUE Problem: Does G=(V,E) contain a clique of size k? Theorem: Clique is NP-Complete. (reduction from SAT) Idea: Make “column” of k vertices for each clause with k variables. –No edge within a column. –All other edges present except between and

NP-Completeness Proof: CLIQUE Example: G = G has m-clique (m is the number of clauses in E), iff E is satisfiable. (Assign value 1 to all variables in clique)