A Few Sample Reductions

Slides:



Advertisements
Similar presentations
Analysis of Algorithms
Advertisements

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.
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.
Great Theoretical Ideas in Computer Science for Some.
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
CSE332: Data Abstractions Lecture 27: A Few Words on NP Dan Grossman Spring 2010.
Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique.
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 22 Instructor: Paul Beame.
Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique.
The Maximum Independent Set Problem Sarah Bleiler DIMACS REU 2005 Advisor: Dr. Vadim Lozin, RUTCOR.
Hardness Results for Problems
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.
CPS Computational problems, algorithms, runtime, hardness (a ridiculously brief introduction to theoretical computer science) Vincent Conitzer.
Introduction to NP Instructor: Neelima Gupta 1.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
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.
Construction We constructed the following graph: This graph has several nice properties: Diameter Two Graph Pebbling Tim Lewis 1, Dan Simpson 1, Sam Taggart.
Advanced Algorithms NP-hard and NP-Complete Problems Instructor: Saeid Abrishami Ferdowsi University of Mashhad.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Limitation of Computation Power – P, NP, and NP-complete
The NP class. NP-completeness
NP-Complete Problems.
More NP-complete problems
NP-completeness Ch.34.
P & NP.
Chapter 10 NP-Complete Problems.
Introduction to Approximation Algorithms
Computational problems, algorithms, runtime, hardness
EMIS 8373: Integer Programming
Richard Anderson Lectures NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
Advanced Algorithms Analysis and Design
Great Theoretical Ideas in Computer Science
Richard Anderson Lecture 26 NP-Completeness
7.4 Functions Designed by Skip Tyler.
NP-Completeness Yin Tat Lee
Analysis and design of algorithm
ICS 353: Design and Analysis of Algorithms
Richard Anderson Lecture 25 NP-Completeness
Richard Anderson Lecture 28 NP-Completeness
Approximation Algorithms
Linear Programming Duality, Reductions, and Bipartite Matching
Computation Basics & NP-Completeness
Chapter 11 Limitations of Algorithm Power
Objectives The student will be able to:
NP-Complete Problems.
Functions.
NP-completeness The Chinese University of Hong Kong Fall 2008
CPS 173 Computational problems, algorithms, runtime, hardness
CS 3343: Analysis of Algorithms
Richard Anderson Lecture 26 NP-Completeness
NP-Completeness Yin Tat Lee
CSE 6408 Advanced Algorithms.
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
Objectives The student will be able to:
Objectives The student will be able to:
CSC 380: Design and Analysis of Algorithms
Sec 6-4 Learning Objectives The student will be able to:
Objectives The student will be able to:
Richard Anderson Lecture 25 NP Completeness
Objectives The student will be able to:
Unit 2.1 What is a Function?.
Algorithms CSCI 235, Spring 2019 Lecture 36 P vs
Objectives The student will be able to:
ADVANCED COMPUTATIONAL MODELS AND ALGORITHMS
Objectives The student will be able to:
Functions BY : Ms. MANITA.
Presentation transcript:

A Few Sample Reductions Charles Cusack Department of Computer Science Hope College

Decision problems A decision problem Examples include Involves input, which is known as the instance Asks a yes or no question Examples include Steiner Systems Maximum Clique 0-1 Integer Programming Exact Cover by 3-Sets

Steiner System Consider the list of all 3-subsets of a set of 7 elements on the right This is an instance of Steiner System The question is: Is there a subset of these such that every pair of points occurs exactly once? Here is one solution → Since there is a solution, we say that this is a yes-instance If there wasn’t a solution it would be called a no-instance 1 2 3 1 2 4 1 2 5 1 2 6 1 2 7 1 3 4 1 3 5 1 3 6 1 3 7 1 4 5 1 4 6 1 4 7 1 5 6 1 5 7 1 6 7 2 3 4 2 3 5 2 3 6 2 3 7 2 4 5 2 4 6 2 4 7 2 5 6 2 5 7 2 6 7 3 4 5 3 4 6 3 4 7 3 5 6 3 5 7 3 6 7 4 5 6 4 5 7 4 6 7 5 6 7 1 2 3 1 2 4 1 2 5 1 2 6 1 2 7 1 3 4 1 3 5 1 3 6 1 3 7 1 4 5 1 4 6 1 4 7 1 5 6 1 5 7 1 6 7 2 3 4 2 3 5 2 3 6 2 3 7 2 4 5 2 4 6 2 4 7 2 5 6 2 5 7 2 6 7 3 4 5 3 4 6 3 4 7 3 5 6 3 5 7 3 6 7 4 5 6 4 5 7 4 6 7 5 6 7 1 2 3 1 4 5 1 6 7 2 4 6 2 5 7 3 4 7 3 5 6

Maximum Clique Does the following graph contain 7 vertices that are all connected to one another? Here is one such set:

0-1 Integer Programming Is there a set of the rows of the matrix to the right such that every column of the selected rows contains exactly one “1”? Here is a solution: 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 2 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 3 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 4 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 5 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 6 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 7 0 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 8 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 9 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 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1 0 0 0 0 0 0 1 0 0 0 22 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 0 23 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 24 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 25 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 26 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0 0 0 27 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 28 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0 29 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 30 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 31 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 32 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 33 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 14 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 20 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 23 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 27 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 28 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0

Exact Cover by 3-Sets Let X = {0,1,...,20}. To the right is a collection of 3-sets from X. Is there a subset of the collection such that every element of X is contained in exactly one subset? Here is one solution: 0 1 6 0 2 7 0 3 8 0 4 9 0 5 10 1 2 11 1 3 12 1 4 13 1 5 14 2 3 15 2 4 16 2 5 17 3 4 18 3 5 19 4 5 20 6 7 11 6 8 12 6 9 13 6 10 14 7 8 15 7 9 16 7 10 17 8 9 18 8 10 19 9 10 20 11 12 15 11 13 16 11 14 17 12 13 18 12 14 19 13 14 20 15 16 18 15 17 19 16 17 20 18 19 20 0 1 6 0 2 7 0 3 8 0 4 9 0 5 10 1 2 11 1 3 12 1 4 13 1 5 14 2 3 15 2 4 16 2 5 17 3 4 18 3 5 19 4 5 20 6 7 11 6 8 12 6 9 13 6 10 14 7 8 15 7 9 16 7 10 17 8 9 18 8 10 19 9 10 20 11 12 15 11 13 16 11 14 17 12 13 18 12 14 19 13 14 20 15 16 18 15 17 19 16 17 20 18 19 20 0 1 6 2 3 15 4 5 20 7 9 16 8 10 19 11 14 17 12 13 18

NP-Complete All of these problems are in a class called NP-complete An instance of any NP-complete problem can be mapped to an instance of any other NP-complete problem in such a way that yes-instances get mapped to yes-instances and no-instances get mapped to no-instances This means that an algorithm to solve one NP-complete problem “works” on all NP-complete problems In this sense, NP-complete problems are all equivalent to each other

Examples Revisited 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 2 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 3 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 4 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 5 0 1 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 6 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 7 0 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 8 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 9 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 10 0 0 1 0 1 0 0 0 0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 0 1 1 0 0 1 34 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 1 6 0 2 7 0 3 8 0 4 9 0 5 10 1 2 11 1 3 12 1 4 13 1 5 14 2 3 15 2 4 16 2 5 17 3 4 18 3 5 19 4 5 20 6 7 11 6 8 12 6 9 13 6 10 14 7 8 15 7 9 16 7 10 17 8 9 18 8 10 19 9 10 20 11 12 15 11 13 16 11 14 17 12 13 18 12 14 19 13 14 20 15 16 18 15 17 19 16 17 20 18 19 20 1 2 3 1 2 4 1 2 5 1 2 6 1 2 7 1 3 4 1 3 5 1 3 6 1 3 7 1 4 5 1 4 6 1 4 7 1 5 6 1 5 7 1 6 7 2 3 4 2 3 5 2 3 6 2 3 7 2 4 5 2 4 6 2 4 7 2 5 6 2 5 7 2 6 7 3 4 5 3 4 6 3 4 7 3 5 6 3 5 7 3 6 7 4 5 6 4 5 7 4 6 7 5 6 7

P = NP ? Is there an efficient algorithm to solve any NP-complete problem? This is one of the most important open questions in theoretical computer science. If the answer is “no” then there are thousands of problems for which no efficient algorithm will ever be found to solve If the answer is “yes” then many problems for which there was not an efficient algorithm will automatically be efficiently solvable (in theory) Unfortunately, most researchers believe the answer is “no” Nobody has been able prove this