Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.

Slides:



Advertisements
Similar presentations
NP-Completeness: Reductions
Advertisements

NP-Completeness More Reductions. Definitions P: is the class of all decision problems which can be solved in polynomial time, O(n^k) for some constant.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
Complexity 11-1 Complexity Andrei Bulatov NP-Completeness.
February 23, 2015CS21 Lecture 201 CS21 Decidability and Tractability Lecture 20 February 23, 2015.
Computability and Complexity 15-1 Computability and Complexity Andrei Bulatov NP-Completeness.
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
Fall 2006Costas Busch - RPI1 More NP-complete Problems.
Computability and Complexity 24-1 Computability and Complexity Andrei Bulatov Approximation.
NP-Completeness (2) NP-Completeness Graphs 4/17/2017 6:25 AM x x x x x
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 24 Instructor: Paul Beame.
Complexity ©D.Moshkovitz 1 Paths On the Reasonability of Finding Paths in Graphs.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
MCS 312: NP Completeness and Approximation algorithms Instructor Neelima Gupta
Lecture 22 More NPC problems
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
NP-complete Problems SAT 3SAT Independent Set Hamiltonian Cycle
Additional NP-complete problems
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 29.
28.
CSE 6311 – Spring 2009 ADVANCED COMPUTATIONAL MODELS AND ALGORITHMS Lecture Notes – Feb. 3, 2009 Instructor: Dr. Gautam Das notes by Walter Wilson.
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.
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.
Prof. Busch - LSU1 Busch Complexity Lectures: More NP-complete Problems.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
COMPLEXITY. Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several.
 2005 SDU Lecture15 P,NP,NP-complete.  2005 SDU 2 The PATH problem PATH = { | G is a directed graph that has a directed path from s to t} s t
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
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
More NP-complete problems
Richard Anderson Lectures NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
More NP-complete Problems
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
NP-Completeness (36.4-5) P: yes and no in pt NP: yes in pt NPH  NPC
CS21 Decidability and Tractability
Intro to Theory of Computation
CS154, Lecture 16: More NP-Complete Problems; PCPs
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
NP-Complete Problems.
Richard Anderson Lecture 26 NP-Completeness
CS21 Decidability and Tractability
NP-Completeness Yin Tat Lee
The Theory of NP-Completeness
CS154, Lecture 16: More NP-Complete Problems; PCPs
Umans Complexity Theory Lectures
CSE 589 Applied Algorithms Spring 1999
Instructor: Aaron Roth
Instructor: Aaron Roth
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
Lecture 23 NP-Hard Problems
Presentation transcript:

Theory of Computing Lecture 18 MAS 714 Hartmut Klauck

Before We have shown NP-completeness of 3-SAT: – a k-CNF is a CNF in which all clauses have 3 literals (or less) – k-SAT={set of all k-CNF that are satisfiable} Notes: Not hard to give a reduction from CNF-SAT to 3-SAT 2-SAT is in P (and hence not NP-complete unless P=NP) 3-SAT is the basis of our reductions from now on

Reductions We will show some reductions from 3-SAT to a few problems Due to transitivity we can use reductions from any of the problems for which we already have a reduction from 3-SAT – Often this is easier

Vertex Cover For an undirected Graph G a vertex cover is a subset S of the vertices such that every edge has at least one endpoint in S VC={G,k such that G has a vertex cover of size at most k} Theorem: VC is NP-complete Part 1: VC in NP is easy (guess S and check all edges)

Reduction VC Part 2: we reduce from 3-SAT Let F be a formula with variables x 1,…,x n and 3-clauses z 1,…,z m For each x i we use two vertices v i and w i connected by an edge (variable gadget) For each z i we use three vertices a i, b i, c i connected to form a triangle (clause gadget)

Reduction VC v i corresponds to the literal x i w i to the literal : x i We connect a i, b i, c i with the corresponding literal from clause z i We set k to n+2m Observation: For any vertex cover S one of v i and w i needs to be in S, and at least 2 of a i, b i, c i 1) Assume x satisfies F. We show that a small S exists. If x i =0 we choose w i else v i for S For each clause gadget at least one of a i, b i, c i is connected to a vertex in S. Choose other 2 vertices per clause gadget to form a VC of size n+2m

Reduction VC 2) Now assume there is a VC S of size at most k=n+2m S must contain either v i or w i S must contain two vertices for each clause gadget (triangle) Hence it cannot contain v i and w i Set x accordingly (x i =1 iff v i 2 S) Claim: this is a satisfying assignment Proof: every clause gadget must have one vertex not in S, connected to a literal node in S Hence x satisfies F

Clique We want to show that MaxClique is NP- complete – Surely it is in NP Reduction from VC Observation/reduction: (G,k) 2 VC iff (G c,n-k) 2 Max Clique – G c : complement of G

Observation If S is a vertex cover in G then all edges in G have one endpoint in S, there are no edges going from V-S to V-S Hence in the complement of G, V-S is a clique G c,n-k in MaxClique Note: we have shown that VC has a 2-approximation algorithm Max Clique does not have a n 1- ² approximation unless P=NP – Notice how a VC of size · 2k implies only a Clique of size ¸ n-2k, which can be much smaller than n-k, e.g., k=n/2

SetCover Input: set of m subsets s 1,…,s n of S, |S|=m Task: find the smallest set of s i such that S= [ i 2I s i We want | I | minimal SetCover:{s 1,…,s n,k: there is I µ {1,…,n}, | I |=k, [ i 2I s i = [ i=1…n s i } Theorem: SetCover is NP-complete – Part 1: 2 NP: guess I

SetCover Part 2: Reduction from VC G,k is mapped to a SetCover instance as follows: G=(V,E) Universe: E Subsets: s 1,…,s n s i : {edges adjacent to vertex i} k unchanged Then: (G,k) 2 VC iff (s 1,…,s n,k) 2 SetCover

Hamiltonian Cycle A Hamiltonian cycle in a directed G=(V,E) is a cycle that visits each vertex once HC={G: G has a Hamiltonian cycle} Theorem: HC is NP-complete In NP: guess the cycle Hardness: reduction from VC

HC G=(V,E) and k given (input to VC) Assume edges in E are ordered (e 1,…,e m ) New vertices: a 1,…,a k and vertices (u,e,b) where u 2 V, e 2 E is incident to u and b 2 {0,1} Edges: (u,e,0) to (u,e,1) type 1 (u,e,b) to (v,e,b) where e={u,v} type 2 (u,e,1) to (u,e’,0) where e,e’ inc. to u and there is no e’’ with e<e’’<e’ inc. to u type 3 (u,e,1) to all a i where e is max. edge at u type 4 all a i to (u,e,0) where e is the min. edge at u type 5

HC Take vertex cover S of size k Find the cycle: for v 2 S consider all the vertices (v,e,b) and all (u,e,b) where e={u,v} We traverse these from (v,e,0) in ascending order of e – (v,e,0) to (v’,e,0) to (v’,e,1) to (v,e,1) to (v,e’,0) etc. until (v,e,1) for max e at v reached. Then to a 1 and to the next (u,e,0) with u the next vertex in S and e min. at u A Hamitonian cycle exists Assume a Hamiltonian cycle ex. It must traverse all a i. Group all vertices visited between a i and a i+1 Claim: vertex cover of size k exists

Traveling Salesman Input: matrix of distances (edge weights),k Output: is there a Hamiltonian cycle of total edge weight at most k? Reduction from HC: – Use adjacency matrix as weights, k=n

Subgraph Isomorphism Given G,H, is H isomorphic to a subgraph of G? – subgraph: subset of vertices and edges – isomorphic: same up to renaming vertices Theorem: Subgraph isomorphism is NP- complete Reduction from Clique: Map G,k to G and H, where H is a k-clique (undirected case) Reduction from HC: Map G to G and H, where H is an n-cycle (directed case)

Note Graph Isomorphism (are G,H isomorphic?) is not known to be in P or NPC

Subset Sum Input: set S of integers, target t Is there a subset S’ µ S such that the elements in S’ sum to t? Theorem: Subset Sum is NP-complete Reduction from 3-SAT