CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 32.

Slides:



Advertisements
Similar presentations
COMPLEXITY THEORY CSci 5403 LECTURE XVI: COUNTING PROBLEMS AND RANDOMIZED REDUCTIONS.
Advertisements

1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
MCS 312: NP Completeness and Approximation algorithms Instructor Neelima Gupta
Lecture 23. Subset Sum is NPC
© The McGraw-Hill Companies, Inc., Chapter 8 The Theory of NP-Completeness.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
Complexity 11-1 Complexity Andrei Bulatov NP-Completeness.
CS21 Decidability and Tractability
February 23, 2015CS21 Lecture 201 CS21 Decidability and Tractability Lecture 20 February 23, 2015.
Approximation Algorithms Lecture for CS 302. What is a NP problem? Given an instance of the problem, V, and a ‘certificate’, C, we can verify V is in.
Algorithms in Exponential Time. Outline Backtracking Local Search Randomization: Reducing to a Polynomial-Time Case Randomization: Permuting the Evaluation.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
88- 1 Chapter 8 The Theory of NP-Completeness P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class.
Time Complexity.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 24 Instructor: Paul Beame.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
Complexity ©D.Moshkovitz 1 Paths On the Reasonability of Finding Paths in Graphs.
February 25, 2015CS21 Lecture 211 CS21 Decidability and Tractability Lecture 21 February 25, 2015.
Prof. Swarat Chaudhuri COMP 482: Design and Analysis of Algorithms Spring 2013 Lecture 22.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 31.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
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.
NP-Completeness: 3D Matching
1 The TSP : NP-Completeness Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell.
MCS 312: NP Completeness and Approximation algorithms Instructor Neelima Gupta
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 27.
CSEP 521 Applied Algorithms Richard Anderson Lecture 10 NP Completeness.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Prabhas Chongstitvatana1 NP-complete proofs The circuit satisfiability proof of NP- completeness relies on a direct proof that L  p CIRCUIT-SAT for every.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Basic genres.  Packing problems: SET-PACKING, INDEPENDENT SET.  Covering problems: S ET-COVER, VERTEX-COVER.  Constraint satisfaction problems: SAT,
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 33.
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.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
The Theory of Complexity for Nonpreemptive Scheduling 1.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
30.
1.1 Chapter 3: Proving NP-completeness Results Six Basic NP-Complete Problems Some Techniques for Proving NP-Completeness Some Suggested Exercises.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 29.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 25.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
28.
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.
CSE 421 Algorithms Richard Anderson Lecture 28 Survey of NP Complete Problems NP-Complete P.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
TU/e Algorithms (2IL15) – Lecture 10 1 NP-Completeness, II.
More NP-Complete and NP-hard Problems
More NP-complete problems
Richard Anderson Lecture 26 NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
CS21 Decidability and Tractability
Lecture 24 NP-Complete Problems
Richard Anderson Lecture 25 NP-Completeness
Richard Anderson Lecture 28 NP-Completeness
Chapter 8 NP and Computational Intractability
More NP-complete problems
Richard Anderson Lecture 27 Survey of NP Complete Problems
Lecture 24 Classical NP-hard Problems
Hamiltonian Circuit (HC) problem
Presentation transcript:

CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 32

Traveling Salesperson Problem TSP: Given a set of n cities and a pairwise distance function d(u, v), is there a tour of length  D? All 13,509 cities in US with a population of at least 500 Reference:

Traveling Salesperson Problem TSP: Given a set of n cities and a pairwise distance function d(u, v), is there a tour of length  D? Optimal TSP tour Reference:

Traveling Salesperson Problem 11,849 holes to drill in a programmed logic array Reference:

Traveling Salesperson Problem Optimal TSP tour Reference:

Traveling Salesperson Problem TSP: given a set of n cities and a pairwise distance function d(u, v), is there a tour of length  D? HAM-CYCLE: given a graph G = (V, E), does there exists a simple cycle that contains every node in V? Claim: HAM-CYCLE  P TSP Pf: –Given instance G = (V, E) of HAM-CYCLE, create n cities with distance function –TSP instance has tour of length  n iff G has Hamiltonian cycle

3-Dimensional Matching Example: Given n instructors, n courses, and n times, and a list of the possible courses and times each instructor is willing to teach, is it possible to make an assignment so that all courses are taught at different times? InstructorCourseTime WayneCOS 423MW 11-12:20 WayneCOS 423TTh 11-12:20 WayneCOS 226TTh 11-12:20 WayneCOS 126TTh 11-12:20 TardosCOS 523TTh 3-4:20 TardosCOS 423TTh 11-12:20 TardosCOS 423TTh 3-4:20 KleinbergCOS 226TTh 3-4:20 KleinbergCOS 226MW 11-12:20 KleinbergCOS 423MW 11-12:20

3-Dimensional Matching 3D-MATCHING: Given disjoint sets X, Y, and Z, each of size n and a set T  X  Y  Z of triples, does there exist a set of n triples in T such that each element of X  Y  Z is in exactly one of these triples? Claim: 3-SAT  P 3D-MATCHING Pf: Given an instance  of 3-SAT, we construct an instance of 3D-matching that has a perfect matching iff  is satisfiable

3-Dimensional Matching Construction (part 1) –Create gadget for each variable x i with 2k core and tip elements –No other triples will use core elements –In gadget i, 3D-matching must use either both grey triples or both blue ones x1x1 x3x3 x2x2 core k = 2 clauses n = 3 variables true false clause 1 tips number of clauses set x i = trueset x i = false

3-Dimensional Matching Construction (part 2) –Now we add elements to model the clauses and to constrain the assignments we can choose –In the language of 3D-matching, the clause tells us: “The matching on the cores of the gadgets should leave the grey tips of the first gadget free; or it should leave the blue tips of the second gadget free; or it should leave the grey tips of the third gadget free”

3-Dimensional Matching Construction (part 2) –For each clause C j create two core elements and three triples –Exactly one of these triples will be used in any 3D-matching –For sample clause j, ensures any 3D-matching uses either (i) grey core of x 1 or (ii) blue core of x 2 or (iii) grey core of x 3 x1x1 x3x3 x2x2 clause 1 tips core true false clause j gadget

3-Dimensional Matching Almost done with the construction, but there’s still one problem –Suppose the set of clauses has a satisfying assignment –Then we make corresponding choices of grey/blue for each variable gadget –But this leaves at least one free tip for each clause gadget

3-Dimensional Matching Construction (part 3) –For each tip, add a cleanup gadget x1x1 x3x3 x2x2 core cleanup gadget true false clause 1 gadget clause 1 tips

3-Dimensional Matching Suppose there is a perfect 3D-matching in the instance we have constructed –In each variable gadget x i the matching chooses either all the grey triples or all the blue triples grey  set x i = 1 in the 3-SAT instance blue  set x i = 0 in the 3-SAT instance –Consider clause C j ; has it been satisfied? Yes, the two core elements have been covered and thus at least one of the three variable gadgets corresponding to a term in C j made the “correct” grey/blue decision; this induces a variable assignment that satisfies C j But, have we constructed a 3D-matching? What are the X, Y, and Z sets?

3-Dimensional Matching Claim: Instance has a 3D-matching iff  is satisfiable Detail: What are X, Y, and Z? Does each triple contain one element from each of X, Y, Z? x1x1 x3x3 x2x2 core cleanup gadget true false clause 1 gadget clause 1 tips

3-Dimensional Matching Claim: Instance has a 3D-matching iff  is satisfiable Detail: What are X, Y, and Z? Does each triple contain one element from each of X, Y, Z? x1x1 x3x3 x2x2 core cleanup gadget clause 1 gadget clause 1 tips