Reduction Techniques Restriction Local Replacement Component Design Examples.

Slides:



Advertisements
Similar presentations
Analysis of Algorithms
Advertisements

Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
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.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
Complexity 11-1 Complexity Andrei Bulatov NP-Completeness.
February 23, 2015CS21 Lecture 201 CS21 Decidability and Tractability Lecture 20 February 23, 2015.
Hardness Results for Problems P: Class of “easy to solve” problems Absolute hardness results Relative hardness results –Reduction technique.
Computability and Complexity 15-1 Computability and Complexity Andrei Bulatov NP-Completeness.
Techniques for Proving NP-Completeness
Computability and Complexity 16-1 Computability and Complexity Andrei Bulatov NP-Completeness.
NP-Completeness (2) NP-Completeness Graphs 4/17/2017 6:25 AM x x x x x
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.
Complexity ©D.Moshkovitz 1 Paths On the Reasonability of Finding Paths in Graphs.
Hardness Results for Problems
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.
1 The TSP : NP-Completeness Approximation and Hardness of Approximation All exact science is dominated by the idea of approximation. -- Bertrand Russell.
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.
MCS 312: NP Completeness and Approximation algorithms Instructor Neelima Gupta
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
Lecture 22 More NPC problems
CSEP 521 Applied Algorithms Richard Anderson Lecture 10 NP Completeness.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
NP-complete Problems SAT 3SAT Independent Set Hamiltonian Cycle
1 3-COLOURING: Input: Graph G Question: Does there exist a way to 3-colour the vertices of G so that adjacent vertices are different colours? 1.What could.
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.
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.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Unit 9: Coping with NP-Completeness
Instructor Neelima Gupta Table of Contents Class NP Class NPC Approximation Algorithms.
1.1 Chapter 3: Proving NP-completeness Results Six Basic NP-Complete Problems Some Techniques for Proving NP-Completeness Some Suggested Exercises.
NP-Completeness (Nondeterministic Polynomial Completeness) Sushanth Sivaram Vallath & Z. Joseph.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 29.
1 Suppose I construct a TM M f which: 1. Preserves its input u. 2. Simulates a machine M b on input ε. 3. If M b hangs on input ε, force an infinite loop.
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 NP-complete problems. Homework Vertex Cover Instance. A graph G and an integer k. Question. Is there a vertex cover of cardinality k?
CSC 413/513: Intro to Algorithms
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
Given this 3-SAT problem: (x1 or x2 or x3) AND (¬x1 or ¬x2 or ¬x2) AND (¬x3 or ¬x1 or x2) 1. Draw the graph that you would use if you want to solve this.
Prof. Busch - LSU1 Busch Complexity Lectures: More NP-complete Problems.
SUBSET-SUM Instance: A set of numbers denoted S and a target number t.
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.
34.NP Completeness. Computer Theory Lab. Chapter 34P.2.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
More NP-Complete and NP-hard Problems
More NP-complete problems
Richard Anderson Lectures NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
More NP-complete Problems
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness Proofs
Richard Anderson Lecture 26 NP-Completeness
CS21 Decidability and Tractability
CS154, Lecture 16: More NP-Complete Problems; PCPs
NP-Completeness (2) NP-Completeness Graphs 11/23/2018 2:12 PM x x x x
More NP-complete Problems
Richard Anderson Lecture 25 NP-Completeness
NP-Completeness Yin Tat Lee
CS154, Lecture 16: More NP-Complete Problems; PCPs
More NP-complete problems
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
Presentation transcript:

Reduction Techniques Restriction Local Replacement Component Design Examples

Restriction Show that a special case of the problem you are interested in is NP-complete. For example: –Long Path Problem –Input: Graph G = (V,E), Integer k –Yes/No Question: Does G have a simple path of length at least k? –What special case of this problem is another problem we have considered?

Local Replacement Make many independent (non-interacting) local changes to the structure. Example: Reducing SAT to 3SAT Work on each clause of the SAT instance independently as follows

Easy Cases Suppose a clause contains k literals: if k = 1 (meaning C i = {z 1 } ), we can add in two new variables v 1 and v 2, and transform this into 4 clauses: {v 1, v 2, z 1 } {v 1,  v 2, z 1 } {  v 1, v 2, z 1 } {  v 1,  v 2, z 1 } if k = 2 ( C i = {z 1, z 2 } ), we can add in one variable v 1 and 2 new clauses: {v 1, z 1, z 2 } {  v 1, z 1, z 2 } if k = 3 ( C i = {z 1, z 2, z 3 } ), we move this clause as-is.

Harder Case if k > 3 ( C i = {z 1, z 2, …, z k } ) we can add in k - 3 new variables (v 1, …, v k-3 ) and k - 2 clauses: {z 1, z 2, v 1 } {  v 1, z 3, v 2 } {  v 2, z 4, v 3 } … {  v k-3, z k-1, z k } Thus, in the worst case, n clauses will be turned into n 2 clauses. This cannot move us from polynomial to exponential time.

Component Design These are the more elaborate problems where we design complex interacting components Examples: –Reducing 3SAT to independent set –Reducing independent set to Hamiltonian Cycle

Truth Assignment Component For each variable, we can create two vertices: … v 1  v 1 v 2  v 2 v 3  v 3 v n  v n If we connect a variable and its negation, we can be sure that only one of them is in the independent set. We will set our integer bound for independent set to force one vertex from each pair to be chosen.

Clause Component … v 1  v 1 v 2  v 2 v 3  v 3 v n  v n For each clause, we create a triangle: v 3  v 7 v1v1  v 3  v 4 v2v2 v 5 v 6 v4v4 At most one vertex in a triangle can be in the independent set. We will set our integer bound for independent set to force one vertex from each triangle to be chosen.

Opposing literals rule v 1  v 1 v 2  v 2 v 3  v 3 v 5  v 5  v 1  v 3 v2 v2  v 2  v 4 v1 v1  v 4 v 5 v2v2 v 4  v 4 v 4 v 5 v3 v3 C ={  v 1, v 2,  v 3 }, {v 1,  v 2,  v 4 }, {  v 2,  v 4, v 5 }, {v 3, v 4, v 5 }

Independent Set to Ham Cycle Edge Component: For every edge in the Minimum Vertex Cover problem, we create a component in the Hamiltonian Cycle Problem: v u u u v v

Observations…. u u v v u u v v u u v v There are only three possible ways that a cycle can include all of the vertices in this component. Key property: If a path enters v (u), it leaves on v’ (u’)

u u u u Node Selection u v v w w u x x All components that represent edges connected to node u are strung together into a chain. If there are V vertices, then we will have V of these chains, all interwoven. Choosing a node u corresponds to traversing such a chain

u v v v u u u u w w u x x y y v v z z v vu yw xz Vertex cover = (v,u)

u v v v u u u u w w u x x y y v v z z v vu yw xz Vertex cover = (v,w,x)

Tying the Chains Together If we want to know if its possible to cover the original graph using only k vertices, this would be the same as seeing if we can include all of the vertices using only k chains. How can we include exactly k chains in the Hamiltonian Cycle problem? We must add k extra vertices and connect each of them to the beginning and end of every chain. Since each vertex con only be included once, this allows k chains in the final cycle.

Beginning a Transform

The Final Transform for k=1