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?

Slides:



Advertisements
Similar presentations
NP-Hard Nattee Niparnan.
Advertisements

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.
The Theory of NP-Completeness
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Combinatorial Algorithms
Complexity 16-1 Complexity Andrei Bulatov Non-Approximability.
Complexity 11-1 Complexity Andrei Bulatov NP-Completeness.
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
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.
Techniques for Proving NP-Completeness
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
Computability and Complexity 24-1 Computability and Complexity Andrei Bulatov Approximation.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
The Maximum Independent Set Problem Sarah Bleiler DIMACS REU 2005 Advisor: Dr. Vadim Lozin, RUTCOR.
GRAPH Learning Outcomes Students should be able to:
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.
Approximation Algorithms Department of Mathematics and Computer Science Drexel University.
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.
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.
Lecture 22 More NPC problems
Prabhas Chongstitvatana1 NP-complete proofs The circuit satisfiability proof of NP- completeness relies on a direct proof that L  p CIRCUIT-SAT for every.
Approximation Algorithms
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.
Unit 9: Coping with NP-Completeness
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.
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.
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.
Discrete Optimization Lecture 6 – Part 2 M. Pawan Kumar
Discrete Optimization Lecture 4 M. Pawan Kumar
Lecture 25 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
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.
Approximation Algorithms by bounding the OPT Instructor Neelima Gupta
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
1 GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using.
Discrete Optimization MA2827 Fondements de l’optimisation discrète Material from M. Pawan Kumar, E. Demaine.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
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
P & NP.
Richard Anderson Lectures NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
Lecture 2-2 NP Class.
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
Lecture 5 NP Class.
Computability and Complexity
CS154, Lecture 16: More NP-Complete Problems; PCPs
NP-Completeness (2) NP-Completeness Graphs 11/23/2018 2:12 PM x x x x
Richard Anderson Lecture 28 NP-Completeness
Approximation Algorithms
Prabhas Chongstitvatana
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
Presentation transcript:

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? Clique Instance. A graph G and an integer k. Question. Has G a clique of cardinality k? Prove NP-completeness of Vertex cover and Clique.

Vertex cover, stable set, clique,…(2) Proposition 2.2. Let G be a graph and X ⊆ V(G). Then the following three statements are equivalent: (a) X is a vertex cover in G, (b) V(G)\X is a stable set in G, (c) V(G)\X is a clique in the complement of G.

NP-completeness of Vertex Cover Transform Stable Set to Vertex Cover. Let G = (V, E) and k constitute any instance of Stable Set. The corresponding instance of Vertex Cover is provided simply by the graph G′ = G and the integer k′ = n − k, where |V |= n.

Hamiltonian Circuit Instance: A graph G. Question: Is there a Hamiltonian circuit?

Hamiltonian Circuit Theorem 11.1 (Karp 1972) Hamiltonian Circuit is NP-complete.

Sketch of Proof «Vertex Cover» → «Hamiltonian Circuit» «Vertex Cover»: G = (V,E), an integer k ≥ 0. We must construct a graph G′ = (V′,E′) such that G′ has a Hamiltonian circuit if and only if G has a vertex cover H of size k or less. Let |E| = m.

Construction of G′ |V′| = 12m+k For each edge (v i, v j ) ∊ E, G′ contains a “cover-testing” component that will be used to ensure that at least one endpoint of that edges is among the selected k vertices. The component has 12 vertices u ij1, u ij2, u ij3, u ij4, u ij5, u ij6, u ji1, u ji2, u ji3, u ji4, u ji5, u ji6 and 14 edges. Additionally G′ has k “selector” vertices a 1, a 2,…, a k, which will be used to select k vertices from the vertex set V for G.

Component (v i, v j ) u ij1 u ij2 u ij3 u ij4 u ij5 u ij6 u ji1 u ji2 u ji3 u ji4 u ji5 u ji6 In the completed construction, the only vertices from this component that will be involved in any additional edges are u ij1, u ji1, u ij6, u ji6. This implies that any Hamiltonian circuit of G′ has to pass through these vertices by the exactly one of the three following ways.

Component (v i, v j ) u ij1 u ij2 u ij3 u ij4 u ij5 u ij6 u ji1 u ji2 u ji3 u ji4 u ji5 u ji6 v i ∊ H, v j ∉ H v i ∉ H, v j ∊ H v i ∊ H, v j ∊ H

Component v i Additional edges in our construction will serve to join pairs of cover-testing components or to join a cover testing component to a selector vertex. For each vertex v i let r denote a degree of v i in G. Arbitrarily order the edges incident on v i as (v i, v j 1 ), (v i, v j 2 ),…, (v i, v j r ). All the cover testing components corresponding to these edges are joined together by the following connecting edges:

Vertex Component u ij 1 1 u ij 1 6 u ij 2 1 u ij 2 6 u ij r 1 u ij r 6 u ij 3 1 u ij 3 6

Construction of G′ |V′| = 12m+k For each edge (v i, v j ) ∊ E, G′ contains a “cover-testing” component that will be used to ensure that at least one endpoint of that edges is among the selected k vertices. The component has 12 vertices u ij1, u ij2, u ij3, u ij4, u ij5, u ij6, u ji1, u ji2, u ji3, u ji4, u ji5, u ji6 and 14 edges. Additionally G′ has k “selector” vertices a 1, a 2,…, a k, which will be used to select k vertices from the vertex set V for G.

Selector vertices Each selector vertex a l join with the first and last vertices of every component v i. It is easy to see that G′ can be constructed from G in polynomial time.

Component of G′ u ij 1 1 u ij 1 6 u ij 2 1 u ij 2 6 u ij r 1 u ij r 6 u ij 3 1 u ij 3 6

Proof (1) We claim that G′ has a Hamiltonian circuit if and only if G has a vertex cover of size k or less. Suppose there is a Hamiltonian circuit for G′. Consider any portion of this circuit that begins at a selector vertex, ends at another selector vertex and that encounters no such vertex internally.

Component of G′ u ij 1 1 u ij 1 6 u ij 2 1 u ij 2 6 u ij r 1 u ij r 6 u ij 3 1 u ij 3 6

Proof (2) We claim that G′ has a Hamiltonian circuit if and only if G has a vertex cover of size k or less. Suppose there is a Hamiltonian circuit for G′. Consider any portion of this circuit that begins at a selector vertex, ends at another selector vertex and that encounters no such vertex internally. This portion of the circuit must pass through a set of cover-testing components corresponding to exactly those edge from E that are incident on some one particular vertex v i ∊ V.

Proof(3) Each of the cover-testing components is traversed in one of the three modes, and no vertex from any other cover-testing component is encountered.

Proof(4) So the k selector vertices divide the Hamiltonian circuit into k paths, each path corresponding to a distinct vertex v i ∊ V. Since the Hamiltonian circuit must include all vertices from every one of the cover-testing components, and since vertices from the cover-testing component for edge e ∊ E can be traversed only by a path corresponding to an endpoint of e, every edge in E must have at least one endpoint among those k selected vertices. Therefore, this set of k vertices forms the desired vertex cover for G.

Proof(5) Suppose V* is a vertex cover for G with |V*| ≤ k. Let us suppose that |V*| = k. Denote the elements of V* by v 1, v 2,…, v k. Choose the edges in the cover-testing component representing each edge e = {v i, v j } depending on whether {v i, v j } ∩ V* equals, respectively, {v i }, {v j }, or {v i, v j }.

Component (v i, v j ) u ij1 u ij2 u ij3 u ij4 u ij5 u ij6 u ji1 u ji2 u ji3 u ji4 u ji5 u ji6 v i ∊ H, v j ∉ H v i ∉ H, v j ∊ H v i ∊ H, v j ∊ H

Optimization problem Definition A (discrete) optimization problem is a quadruple Π = (X, (S x ) x ∈ X, c, goal), where – X is a language over {0, 1} decidable in polynomial time; –S x is a subset of {0,1} ∗ for each x ∈ X; there exists a polynomial p with size(y) ≤ p(size(x)) for all y ∈ S x and all x ∈ X, and the languages {(x, y) : x ∈ X, y ∈ S x } and {x ∈ X: S x = ∅ }are decidable in polynomial time; –c:{(x,y): x ∈ X, y ∈ S x } → Q is a function computable in polynomial time; and –goal ∈ {max, min}.

Optimization problem The elements of X are called instances of Π. For each instance x, the elements of S x are called feasible solutions of x. We write OPT(x) := goal{c(x, y) : y ∈ Sx }. An optimum solution of x is a feasible solution y of x with c(x, y) = OPT(x).

Algorithm An algorithm for an optimization problem (X, (S x ) x ∈ X, c, goal) is an algorithm A which computes for each input x ∈ X with non- empty S x a feasible solution y ∈ S x. We sometimes write A(x) := c(x, y). If A(x) = OPT(x) for all x ∈ X with non-empty S, then A is an exact algorithm.

Polynomial reduction The concept of polynomial reductions easily extends to optimization problems: a problem polynomially reduces to an optimization problem Π = (X, (S x )x ∈ X, c, goal) if it has an exact polynomial-time oracle algorithm using any function f with f(x) ∈ {y ∈ S x :c(x,y) = OPT(x)} for all x ∈ X with non-empty S x.

NP-hardness Definition An optimization problem or decision problem Π is called NP - hard if all problems in NP polynomially reduce to Π.

Exercise 11.1 Traveling Salesman Problem (TSP) Instance: A complete graph K n (n ≥ 3) and weights c : E(K n ) → Q +. Task: Find a Hamiltonian circuit T whose weight is minimum. Prove that the TSP is NP-hard.

Exercise 11.2 Zero Quadratic Assignment Problem (QAP 0 ) Given two n × n symmetric 0/1 matrices A = (a ij ) and B = (b ij ). Compute a permutation π of V = {1,..., n} so that Prove that the QAP 0 is NP-hard.

Homework The decision problem Clique is NP-complete. Is it still NP- complete if restricted to a) bipartite graphs, b) planar graphs. Prove that the following problems are NP-complete: a) Hamiltonian Path –Given a graph G, does G contain a Hamiltonian path? b) Shortest Path –Given a graph G, weights c : E(G) → Z, two vertices s,t ∈ V(G), and an integer k. Is there an s-t-path of weight at most k?