Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique.

Slides:



Advertisements
Similar presentations
Analysis of Algorithms
Advertisements

Polynomial-time reductions We have seen several reductions:
Reducibility Class of problems A can be reduced to the class of problems B Take any instance of problem A Show how you can construct an instance of problem.
What is Intractable? Some problems seem too hard to solve efficiently. Question 1: Does an efficient algorithm exist?  An O(a ) algorithm, where a > 1,
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
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 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
CSE332: Data Abstractions Lecture 27: A Few Words on NP Dan Grossman Spring 2010.
1 Lecture 4 Topics –Problem solving Subroutine Theme –REC language class The class of solvable problems Closure properties.
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Definition of complexity class NP –Nondeterministic computation –Problems.
Reduction Techniques Restriction Local Replacement Component Design Examples.
1 Lecture 10 Proving more specific problems are not recursive Reduction technique –Use subroutine theme to show that if one problem is unsolvable, so is.
The Theory of NP-Completeness
NP-complete and NP-hard problems
Analysis of Algorithms CS 477/677
Computational Complexity, Physical Mapping III + Perl CIS 667 March 4, 2004.
Example: HP ≤ p HC Hamiltonian Path –Input: Undirected Graph G = (V,E) –Y/N Question: Does G contain a Hamiltonian Path? Hamiltonian Cycle –Input: Undirected.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
Odds and Ends HP ≤ p HC (again) –Turing reductions Strong NP-completeness versus Weak NP-completeness Vertex Cover to Hamiltonian Cycle.
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.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 22 Instructor: Paul Beame.
Complexity Issues Mark Allen Weiss: Data Structures and Algorithm Analysis in Java Lydia Sinapova, Simpson College.
P, NP, and NP-Complete Suzan Köknar-Tezel.
Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique.
Hardness Results for Problems
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
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.
Complexity Classes (Ch. 34) The class P: class of problems that can be solved in time that is polynomial in the size of the input, n. if input size is.
Approximation Algorithms
CSC 172 P, NP, Etc. “Computer Science is a science of abstraction – creating the right model for thinking about a problem and devising the appropriate.
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.
CSE332: Data Abstractions Lecture 24.5: Interlude on Intractability Dan Grossman Spring 2012.
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.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
NP-Complete problems.
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.
LIMITATIONS OF ALGORITHM POWER
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
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
1 Ch 10 - NP-completeness Tractable and intractable problems Decision/Optimization problems Deterministic/NonDeterministic algorithms Classes P and NP.
Lecture. Today Problem set 9 out (due next Thursday) Topics: –Complexity Theory –Optimization versus Decision Problems –P and NP –Efficient Verification.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
1 P and NP. 2 Introduction The Traveling Salesperson problem and thousands of other problems are equally hard in the sense that if we had an efficient.
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.
34.NP Completeness. Computer Theory Lab. Chapter 34P.2.
TU/e Algorithms (2IL15) – Lecture 10 1 NP-Completeness, II.
CSC 172 P, NP, Etc.
The Theory of NP-Completeness
NP-Completeness A problem is NP-complete if: It is in NP
NP-Complete Problems.
P & NP.
Richard Anderson Lectures NP-Completeness
NP-Completeness Yin Tat Lee
Richard Anderson Lecture 25 NP-Completeness
Computation Basics & NP-Completeness
NP-Completeness Yin Tat Lee
The Theory of NP-Completeness
CSE 589 Applied Algorithms Spring 1999
Presentation transcript:

Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique

Fundamental Setting When faced with a new problem , we alternate between the following two goals 1.Find a “good” algorithm for solving  Use algorithm design techniques 2.Prove a “hardness result” for problem  No “good” algorithm exists for problem 

Complexity Class P P is the set of problems that can be solved using a polynomial-time algorithm –Sometimes we focus only on decision problems –The task of a decision problem is to answer a yes/no question If a problem belongs to P, it is considered to be “efficiently solvable” If a problem is not in P, it is generally considered to be NOT “efficiently solvable” Looking back at previous slide, our goals are to: 1.Prove that  belongs to P 2.Prove that  does not belong to P

Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique

Absolute Hardness Results Fuzzy Definition –A hardness result for a problem  without reference to another problem Examples –Solving the clique problem requires  (n) time in the worst-case –Solving the clique problem requires  (2 n ) time in the worst-case. –The clique problem is not in P.

Proof Techniques Diagonalization –We don’t cover, but can be used to prove superpolynomial times required for some problems Information Theory argument –  (nlog n) lower bound for sorting –Typically not a superpolynomial lower bounds “Size of input” argument –Prove that solving the graph connectivity problem requires  (V 2 ) time –Prove that solving the maximum clique problem requires  (V 2 ) time –Typically not a superpolynomial lower bound

Status Many natural problems can be shown to be in P –Graph connectivity –Shortest Paths –Minimum Spanning Tree Very few natural problems have been proven to NOT be in P –Variants of halting problem are one example Many natural problems cannot be placed in or out of P –Satisfiability –Clique Problem –Hamiltonian Path –Traveling Salesperson

Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique

Relative Hardness Results Fuzzy Definition –A hardness result for a problem  without reference to another problem Examples –Satisfiability is at least as hard as Hamiltonian Path to solve –If Satisfiability is unsolvable, then Hamiltonian Path is unsolvable. –If Satisfiability is in P, then Hamiltonian Path is in P –If Hamiltonian Path is not in P, then Satisfiability is not in P

Important Observation We are interested in relative hardness results BECAUSE of our inability to prove absolute hardness results That is, if we could prove strong absolute hardness results, we would not be as interested in relative hardness results Example –If I could prove “Satisfiability is not in P”, then I would be less interested in proving “If Hamiltonian Path is not in P, then Satisfiability is not in P”.

Relative Hardness Proof Technique We show that  2 is at least as hard as  1 in the following way Informal: We show how to solve problem  1 using a procedure P 2 that solves  2 as a subroutine

Examples Multiplication and Squaring –square(x) = mult(x,x) Proves multiplication is at least as hard as squaring –mult(x,y) = (square(x+y) – square(x-y))/4 Prove squaring is at least as hard as multiplication Assumes that addition, subtraction, and division by 4 can be done with no substantial increase in complexity Specific complexity of multiplication may be higher as there are two calls to square, but the difference is polynomially bounded

Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique

Decision Problems We now restrict our attention to decision problems Key characteristic: 2 types of inputs –Yes input instances –No input instances Almost all natural problems can be converted into an equivalent decision problem without changing the complexity of the problem –One technique: add an extra input variable that represents the solution for the original problem

No loss of complexity Example using clique problem –Non-decision Problems Input: Graph G=(V,E) Task: Output size of maximum clique in G Task 2: Output a maximum sized clique of G –Decision Problems Input: Graph G=(V,E), integer k <= |V| Y/N Question: Does G contain a clique of size k? Your task –Show that if we can solve decision clique in polynomial-time, then we can solve the non-decision clique problems in polynomial-time.

Reduction Technique In CSE 460, I use the terminology “Answer- preserving input transformation” A many-one reduction R is a computable function mapping inputs of problem  1 to inputs of problem  2 –R is computable by some program/algorithm –x is a yes input to  1  R(x) is a yes input to  2 Notation:  1 <= m  2

Pictoral Representation of Reduction P 1 solves  1 x Input to  1 Yes/No P2 solves  2 Y/N R R(x)

Solvability Implications P 1 solves  1 P 2 solves  2 R No Input to  1 No Input to  2 Yes Input to  1 Yes Input to  2 Yes No If many-one reduction R exists, then: If  2 is solvable, then  1 is solvable If  1 is not solvable, then  2 is not solvable

Relative hardness properties Suppose  1 <= m  2 Consequences –If  2 is solvable, then  1 is solvable –If  1 is not solvable, then  2 is not solvable Thus, in some sense,  1 is no harder than  2 However, for all solvable problems  1 and     1 <= m  2 and  2 <= m  1, so this does not help us define the relative hardness of solvable problems

Polynomial-time Reductions A polynomial-time many-one reduction R is a computable function mapping inputs of problem  1 to inputs of problem  2 –R is computable by some program/algorithm in polynomial-time –x is a yes input to  1  R(x) is a yes input to  2 Notation:  1 <= p  2

“In P” Implications P 1 solves  1 in polynomial-time P 2 solves  2 in poly time R No Input to  1 No Input to  2 Yes Input to  1 Yes Input to  2 Yes No If polynomial time many-one reduction R exists, then: If  2 is in P, then  1 is in P If  1 is not in P, then  2 is not in P

Relative hardness properties Suppose  1 <= p  2 Consequences –If  2 is in P, then  1 is in P –If  1 is not in P, then  2 is not in P Thus, in exactly the sense we want,  1 is no harder than  2

Showing  1 <=  2 For any x input for  1, specify what R(x) will be Show that R(x) has polynomial size relative to x –You should show that R runs in polynomial time; I only require the size requirement above Show that if x is a yes instance for  1, then R(x) is a yes instance for  2 Show that if x is a no instance for  1, then R(x) is a no instance for  2 –Often done by showing that if R(x) is a yes instance for  2, then x must have been a yes instance for  1

Example: HP <= p HC Hamiltonian Path –Input: Undirected Graph G = (V,E) –Y/N Question: Does G contain a Hamiltonian Path? Hamiltonian Cycle –Input: Undirected Graph G = (V,E) –Y/N Question: Does G contain a Hamiltonian Cycle?

Specification of R(x) Consider any undirected graph G = (V,E) as input x R(x) will be a graph G’ = (V’, E’) where –V’ = V union {v} where v is not in V –E’ = E union {(v,w) | w in V} Argument that R(x) has polynomial size –We add exactly 1 node and |V| edges.

x is yes  R(x) is yes Suppose graph G has a Hamiltonian Path Let this path be v 1, v 2, …, v n We now argue that v 1, v 2, …, v n, v is a Hamiltonian Cycle in G’ –First, all nodes in V’ are included exactly once above or else v 1, v 2, …, v n would not be a HP in G –Since G’ has all the edges that G has, (v i,v i+1 ) is an edge in E’ for 1 <= i <= n-1 –Finally, since E’ contains edge (v,w) for all w in V, it must be the case that E’ contains edges (v n, v) and (v,v 1 ).

R(x) is yes  x is yes Suppose graph G’ has a Hamiltonian Cycle Let this cycle be v 1, v 2, …, v n, v We now argue that v 1, v 2, …, v n is a Hamiltonian Path in G –First, all nodes in V are included exactly once above or else v 1, v 2, …, v n, v would not be a HC in G’ –Since the only extra edges in E’ compared to E are edges involving node v, it must be the case that E contains edge (v i,v i+1 ) for 1 <= i <= n-1

Turing Reducibility Phil made a suggestion for an alternate reduction. Given graph G, output  (n 2 ) graphs G v,w = (V,E v,w ) where –E v,w = E union {(v,w)} where v,w are nodes in V This is not a polynomial-time reduction because we are outputting  (n 2 ) graphs. However, this idea can be used to show that if HC can be solved in polynomial time, then HP can be solved in polynomial time. –Run each graph G v,w through our procedure that solves HC. –If HC says yes for any one of these graphs, return yes. –Otherwise return no. This more general reduction is often called a Turing reduction. We allow ourselves to use the procedure that solves HC (or  2 ) a polynomial number of times rather than just once.