More NP-complete problems

Slides:



Advertisements
Similar presentations
Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
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.
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.
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
Complexity 11-1 Complexity Andrei Bulatov NP-Completeness.
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.
Transitivity of  poly Theorem: Let ,  ’, and  ’’ be three decision problems such that   poly  ’ and  ’  poly  ’’. Then  poly  ’’. Proof:
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
NP Complete: The Exciting Conclusion Review For Final
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Lecture 22 More NPC problems
NP-complete Problems SAT 3SAT Independent Set Hamiltonian Cycle
Prabhas Chongstitvatana1 NP-complete proofs The circuit satisfiability proof of NP- completeness relies on a direct proof that L  p CIRCUIT-SAT for every.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
Unit 9: Coping with NP-Completeness
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
Instructor Neelima Gupta Table of Contents Class NP Class NPC Approximation Algorithms.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
Lecture 25 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
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?
NPC.
CSC 413/513: Intro to Algorithms
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.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
34.NP Completeness. Computer Theory Lab. Chapter 34P.2.
TU/e Algorithms (2IL15) – Lecture 10 1 NP-Completeness, II.
Costas Busch - LSU 1 More NP-complete Problems. Costas Busch - LSU 2 Theorem: If: Language is NP-complete Language is in NP is polynomial time reducible.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
The Theory of NP-Completeness
NP-Completeness A problem is NP-complete if: It is in NP
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
More NP-Complete and NP-hard Problems
NP Completeness Continued: Reductions
P & NP.
Richard Anderson Lectures NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
Lecture 2-2 NP Class.
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
Hard Problems Introduction to NP
Summary of the previous lecture
Lecture 5 NP Class.
CS154, Lecture 16: More NP-Complete Problems; PCPs
Lecture 24 NP-Complete Problems
ICS 353: Design and Analysis of Algorithms
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
Richard Anderson Lecture 28 NP-Completeness
Richard Anderson Lecture 29 NP-Completeness
Chapter 34: NP-Completeness
Additional NP-complete problems
Review: Reduction A problem A can be reduced to another problem B if any instance of A can be rephrased to an instance of B, the solution to which provides.
NP-Complete Problems.
Prabhas Chongstitvatana
CS 3343: Analysis of Algorithms
Richard Anderson Lecture 26 NP-Completeness
CS21 Decidability and Tractability
The Theory of NP-Completeness
CS154, Lecture 16: More NP-Complete Problems; PCPs
Richard Anderson Lecture 27 Survey of NP Complete Problems
Lecture 24 Classical NP-hard Problems
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
Lecture 24 Vertex Cover and Hamiltonian Cycle
Presentation transcript:

More NP-complete problems So far we have studied three problems involving satisfiability We will use 3-CNF-SAT to prove clique, vertex-cover, and subset-sum are NP-complete We also will use 3-CNF-SAT to prove our hamiltonian cycle problem and the traveling salesman problem are NP-complete This style of “proof” using reducibility is common with NP-complete problems

The Clique Problem Problem statement A naïve approach a clique is a set of vertices that form a connected subgraph of a given undirected graph the clique problem is to find a clique of maximum size as a decision problem we ask if a clique of size k exists A naïve approach given k, form all possible subsets of k vertices and test the complexity would be k is proportional to V, so this approach is superpolynomial

The Reduction Algorithm We need to show 3-CNF-SAT <=p CLIQUE for each clause we place a triple of vertices in V we put an edge between if r  s and the literals are consistent this graph can be computed in polynomial time a satisfying assignment and a clique suppose the 3-sat problem has a satisfying assignment then at least one literal per term is assigned 1 picking each true literal in every clause produces a clique in the graph

An Example The vertices corresponding to the true items in each 3 tuple are white above, the others are shaded these white vertices form a clique conversely, given the clique x3 and x2 both true then (0,0,1) or (1,0,1) satisfy the equation

The Vertex-cover Problem Problem statement a vertex cover of an undirected graph is a set of vertices V’ V such that if (u,v)  G then either u  V’ or v  V’ or both the vertex cover problem is to find the smallest subset that covers an undirected graph it is straightforward to show verification is polynomial we need to show CLIQUE <=p VERTEX-COVER the fundamental idea is to use the complement of a graph, that is, a graph with the same vertices but the set of edges complemented

The Reduction Algorithm (a) contains the clique V’ = {u,v,x,y} (b) is the complement graph where V - V’ = {w,z} is a vertex cover for the graph the proof is completed by showing that G has a clique of size k iff the complement of G has a vertex cover of size |V| - k

The Subset-sum Problem Problem statement given the set S = {s1, s2, s3, … sn } of positive integers and t, is there a subset of S that adds up to t verification for a given subset is easy we must show VERTEX-COVER <=p SUBSET-SUM the heart of the reduction is to use the incidence matrix |V| x |E| for the graph G = (V, E) an example construction is shown; the details of showing that G has a vertex cover of size k iff there is a subset S’ whose sum is t are given in the text

In (a) the vertex cover is {v1,v3,v4}; (b) shows the corresponding rows of the incidence matrix In (c) we embed the matrix in rows x0 through x4 with a leading one; rows y0 through y4 are the base-4 numbers 1, 4, 16, 64, 256; the same xi are included as the vi and all yi are included except those corresponding the edges incident on two vertices in the vertex cover (y1 in this case) The Reduction

The Hamiltonian Cycle Problem This reduction is complex and is based on “widgets” This is an A widget Any hamiltonian cycle must go through the zi in one of two ways as shown in (b) and (c) We treat an A widget as a simple pair of edges (a, a’) and (b, b’) with the restriction that any hamiltonian cycle must contain exactly one of these edges We will draw an A widget as shown in (d)

B Widget b1, b2, b3, b4 are the only vertices connecting to G (a)-(e) show five possible traversals two others are possible by flipping (b) and (e) drawing (f) indicates at least one of the paths pointed to by B must be taken

The graph induced by a formula The satisfying assignment s(x1) = 0, s(x2) = 1, s(x3) = 1corresponds to the hamiltonian cycle shown if s(xm) = 1 then the edge em is in the cycle; if s(xm) = 0 then not(em) is included

Some of the Details

The Traveling Salesman Problem The problem a salesman must visit n cities, each exactly once and go back to the start each edge has a cost and the goal is to find the tour with minimum cost The verification part is easy: make sure all edges are in the graph and their sum is at most k

Showing HAM-CYCLE <=p TSP Let G = (V,E) be hamiltonian we form G’ = (V, E’) where E’ = {(i, j): i, j  V} and the cost is this is easily done in polynomial time Claim: G has a hamiltonian cycle iff G’ has a tour of cost 0 if G has hamitonian cycle h, then each edge in G’ has cost 0, by definition, so a tour of total cost 0 exists if G’ has a tour of total cost at most 0, but edges are either 0 or 1, so the total cost must be exactly 0 so h’ only contains edges from E in G, so h is also a hamiltonian cycle for graph G