CSCI 256 Data Structures and Algorithm Analysis Lecture 22 Some slides by Kevin Wayne copyright 2005, Pearson Addison Wesley all rights reserved, and some.

Slides:



Advertisements
Similar presentations
Polynomial-time reductions We have seen several reductions:
Advertisements

Vertex Cover Dominating Set These slides are based on the Lecture Notes by David Mount for the course CMSC 451 at the University of Maryland. The Copyright.
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.
The Theory of NP-Completeness
Complexity ©D Moshkovitz 1 Approximation Algorithms Is Close Enough Good Enough?
COMP 482: Design and Analysis of Algorithms
Complexity 16-1 Complexity Andrei Bulatov Non-Approximability.
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
Computational problems, algorithms, runtime, hardness
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
Polynomial-Time Reductions
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
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.
Hardness Results for Problems
1 Algorithm Design Patterns and Anti-Patterns Algorithm design patterns.Ex. n Greed.O(n log n) interval scheduling. n Divide-and-conquer. O(n log n) FFT.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Piyush Kumar (Lecture 7: Reductions)
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.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 27.
Lecture 22 More NPC problems
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
1 Chapter 10 Extending the Limits of Tractability Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.
Approximation Algorithms
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.
Sailesh Prabhu Prof. Swarat Chaudhuri COMP 482: Design and Analysis of Algorithms Spring 2013.
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 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Graph Colouring L09: Oct 10. This Lecture Graph coloring is another important problem in graph theory. It also has many applications, including the famous.
30.
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.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 29.
CPS Computational problems, algorithms, runtime, hardness (a ridiculously brief introduction to theoretical computer science) Vincent Conitzer.
28.
NP-completeness NP-complete problems. Homework Vertex Cover Instance. A graph G and an integer k. Question. Is there a vertex cover of cardinality k?
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.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
NP Hard Problems Instructor Neelima Gupta Presentation Edited by Sapna Grover.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
Approximation Algorithms based on linear programming.
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.
34.NP Completeness. Computer Theory Lab. Chapter 34P.2.
The NP class. NP-completeness
Data Structures and Algorithm Analysis Lecture 24
P & NP.
Richard Anderson Lectures NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
Polynomial-Time Reduction
Richard Anderson Lecture 26 NP-Completeness
NP-Completeness Yin Tat Lee
Intro to Theory of Computation
Intro to Theory of Computation
Computability and Complexity
Parameterised Complexity
Richard Anderson Lecture 25 NP-Completeness
Richard Anderson Lecture 28 NP-Completeness
Chapter 8 NP and Computational Intractability
Richard Anderson Lecture 28 NP Completeness
Richard Anderson Lecture 27 NP Completeness
NP-Completeness Yin Tat Lee
CSE 6408 Advanced Algorithms.
Richard Anderson Lecture 25 NP Completeness
Presentation transcript:

CSCI 256 Data Structures and Algorithm Analysis Lecture 22 Some slides by Kevin Wayne copyright 2005, Pearson Addison Wesley all rights reserved, and some by Iker Gondra

Transition point Till now we’ve looked at developing efficient algorithms for a wide range of problems Now we look to quantify or characterize the range of problems that can’t be solved efficiently We’ll use the notion of reduction to help compare the relative difficulty of different problems

The Universe NP-Complete NP P Millennium Prize Problems Copyright © 1990, Matt Groening

Classify Problems According to Computational Requirements Q: Which problems will we be able to solve in practice? –A working definition. [Cobham 1964, Edmonds 1965, Rabin 1966] Those with polynomial-time algorithms Desiderata: Classify problems according to those that can be solved in polynomial-time and those that cannot Frustrating news: Huge number of fundamental problems have defied classification for decades – i.e. can’t give a poly time alg and can’t prove that none exists This chapter: Show that these fundamental problems are "computationally equivalent" and appear to be different manifestations of one really hard problem

Polynomial-Time Reduction Desiderata': Suppose we could solve Y in polynomial-time. What else could we solve in polynomial time? Reduction: Problem X polynomial reduces to problem Y if arbitrary instances of problem X can be solved using –Polynomial number of standard computational steps, plus –Polynomial number of calls to an oracle (a black box) that solves problem Y Notation: X  P Y computational model supplemented by special piece of hardware that solves instances of Y in a single step

Lemma Suppose X  P Y. If Y can be solved in polynomial time, then X can be solved in polynomial time Remark – when you are reading the text note that the text talks of Y  P X

Lemma Suppose X  P Y. If X cannot be solved in polynomial time, then Y cannot be solved in polynomial time

Polynomial-Time Reduction Purpose: Classify problems according to relative difficulty Design algorithms: If X  P Y and Y can be solved in polynomial-time, then X can also be solved in polynomial time Establish intractability: If X  P Y and X cannot be solved in polynomial-time, then Y cannot be solved in polynomial time Establish equivalence: If X  P Y and Y  P X, we use notation X  P Y up to cost of reduction

Independent Set –Goal is to find S of maximum size

Decision Problem Call the above an optimization version of the problem There is another way to formulate the problem – as a decision problem A decision problem is a class of problems for which there is a yes or no answer for each instance of the problem. We rephrase the Independent Set problem as the following decision problem

Independent Set – Decision version - Given a graph G = (V, E) and an integer k, does G contain an independent set of size at least k? –Ex: Instance: For G below, is there an independent set of size  6? Yes –Ex: Instance: For G below, is there an independent set of size  7? No independent set Sample Application: find set of mutually non-conflicting points

Equivalence between decision and optimization versions Given a method to solve the optimization version, we automatically solve each instance of the associated decision problem; and if we have a method to solve each instance of the decision then we can solve the optimization version (for given G, the the largest k for which there is a yes answer gives us the answer to the optimization version for G)

Vertex Cover –Given a graph G = (V, E), a subset S of the vertices is a vertex cover if every edge in E has at least one endpoint in S. Goal is to find S of minimum size

Vertex Cover – Associated decision version – if you can do optimization version you can do decision version and vice versa Convert to decision version of the problem –Given a graph G = (V, E) and an integer k, does G contain a vertex cover of size at most k? –Ex: Instance: For G, Is there a vertex cover of size  4? Yes –Ex: Instance: For G, Is there a vertex cover of size  3? No vertex cover Sample Application: place guards within an art gallery so that all corridors are visible at any time

Relative difficulty of the two problems We don’t know how to solve the independent set problem or vertex cover problem in polynomial time; but we can show that they are equivalently hard First we need the following theorem:

Vertex Cover and Independent Set Theorem: S is an independent set iff V  S is a vertex cover. Recall: Given a graph G = (V, E), a subset S of the vertices is independent if there are no edges between vertices in S. Recall: Given a graph G = (V, E), a subset S of the vertices is a vertex cover if every edge in E has at least one endpoint in S.

Vertex Cover and Independent Set Theorem: S is an independent set iff V  S is a vertex cover  –Let S be any independent set –Consider an arbitrary edge, (u, v) ε E –S independent  u  S or v  S  u  V  S or v  V  S –Thus, V  S covers (u, v)  –Let V  S be any vertex cover –Consider two nodes u  S and v  S –Observe (u, v)  E (V  S is a vertex cover so if (u,v) ε E, u  V- S or v  V – S so u  S or v  S -- a contradiction –Thus, no two nodes in S are joined by an edge  S indep set

Vertex Cover and Independent Set Reductions to each other: Theorem: VERTEX-COVER  P INDEPENDENT-SET If we have a black box to solve the Vertex Cover problem then we can decide if G has an independent set of size at least k by asking the black box whether G has a Vertex Cover of size at most n-k. Conversely if we have a black box to solve the Independent set problem we can decide if G has a vertex cover problem of size at most k by asking the black box if G has an independent set of size at least n-k

Set Cover SET COVER: Given a set U of elements, a collection S 1, S 2,..., S m of subsets of U, and an integer k, does there exist a collection of  k of these sets whose union is equal to U? Sample application –m available pieces of software –Set U of n capabilities that we would like our system to have –The ith piece of software provides the set S i  U of capabilities –Goal: achieve all n capabilities using fewest pieces of software U = { 1, 2, 3, 4, 5, 6, 7 } k = 2 S 1 = {3, 7}S 4 = {2, 4} S 2 = {3, 4, 5, 6}S 5 = {5} S 3 = {1}S 6 = {1, 2, 6, 7}

Claim: VERTEX-COVER  P SET-COVER –Pf: Given a VERTEX-COVER instance, i.e., a graph G = (V, E), and an integer, k, we construct a set cover instance whose size equals the size of the vertex cover instance, so G has a vertex cover of size k iff for the set U, and subsets S 1, S 2,..., S m of U, there exists a collection of  k of these sets whose union is equal to U

Vertex Cover Reduces to Set Cover Claim: VERTEX-COVER  P SET-COVER Construction –Create SET-COVER instance k = k, U = { i | e i  E), S v = { i : e i incident to v } (note S v  U) –Set-cover of size  k iff vertex cover of size  k SET COVER U = { 1, 2, 3, 4, 5, 6, 7 } k = 2 S a = {3, 7}S b = {2, 4} S c = {3, 4, 5, 6}S d = {5} S e = {1}S f = {1, 2, 6, 7} a d b e fc VERTEX COVER k = 2 e1e1 e2e2 e3e3 e5e5 e4e4 e6e6 e7e7