NP-Completeness. Algorithms

Similar documents
8 NP-complete problem Hard problems: demo

Computability Theory

P and NP (Millenium problem)

NP Completeness. Andreas Klappenecker [partially based on slides by Jennifer Welch]

W4231: Analysis of Algorithms

NP-Complete Reductions 2

NP-Hardness. We start by defining types of problem, and then move on to defining the polynomial-time reductions.

8.1 Polynomial-Time Reductions

Best known solution time is Ω(V!) Check every permutation of vertices to see if there is a graph edge between adjacent vertices

NP and computational intractability. Kleinberg and Tardos, chapter 8

W[1]-hardness. Dániel Marx. Recent Advances in Parameterized Complexity Tel Aviv, Israel, December 3, 2017

CMPSCI611: The SUBSET-SUM Problem Lecture 18

1 Definition of Reduction

P and NP CISC5835, Algorithms for Big Data CIS, Fordham Univ. Instructor: X. Zhang

Unit 8: Coping with NP-Completeness. Complexity classes Reducibility and NP-completeness proofs Coping with NP-complete problems. Y.-W.

Some Hardness Proofs

Example of a Demonstration that a Problem is NP-Complete by reduction from CNF-SAT

P and NP CISC4080, Computer Algorithms CIS, Fordham Univ. Instructor: X. Zhang

Chapter 10 Part 1: Reduction

Where Can We Draw The Line?

(p 300) Theorem 7.27 SAT is in P iff P=NP

W[1]-hardness. Dániel Marx 1. Hungarian Academy of Sciences (MTA SZTAKI) Budapest, Hungary

Chapter 8. NP-complete problems

NP-complete Reductions

SAT-CNF Is N P-complete

Chapter 8. NP and Computational Intractability. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Parameterized Reductions

Computational problems. Lecture 2: Combinatorial search and optimisation problems. Computational problems. Examples. Example

8.1 Polynomial-Time Reductions

! Greed. O(n log n) interval scheduling. ! Divide-and-conquer. O(n log n) FFT. ! Dynamic programming. O(n 2 ) edit distance.

Reductions. Linear Time Reductions. Desiderata. Reduction. Desiderata. Classify problems according to their computational requirements.

Graph Theory S 1 I 2 I 1 S 2 I 1 I 2

P = NP; P NP. Intuition of the reduction idea:

1 Introduction. 1. Prove the problem lies in the class NP. 2. Find an NP-complete problem that reduces to it.

Decision Problems. Observation: Many polynomial algorithms. Questions: Can we solve all problems in polynomial time? Answer: No, absolutely not.

Introduction to Algorithms. Lecture 24. Prof. Patrick Jaillet

1. Suppose you are given a magic black box that somehow answers the following decision problem in polynomial time:

! Greed. O(n log n) interval scheduling. ! Divide-and-conquer. O(n log n) FFT. ! Dynamic programming. O(n 2 ) edit distance.

9.1 Cook-Levin Theorem

Introduction to Graph Theory

CSCE750 Analysis of Algorithms Fall 2017 NP-Complete Problems

Module 6 NP-Complete Problems and Heuristics

Module 6 NP-Complete Problems and Heuristics

Complexity Classes and Polynomial-time Reductions

arxiv: v2 [cs.cc] 29 Mar 2010

Propositional Calculus: Boolean Algebra and Simplification. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

CS521 \ Notes for the Final Exam

Fixed Parameter Algorithms

Reductions and Satisfiability

Boolean Functions (Formulas) and Propositional Logic

Exact Algorithms Lecture 7: FPT Hardness and the ETH

CS154, Lecture 18: PCPs, Hardness of Approximation, Approximation-Preserving Reductions, Interactive Proofs, Zero-Knowledge, Cold Fusion, Peace in

Exercises Computational Complexity

Complexity of clique coloring and related problems

Prove, where is known to be NP-complete. The following problems are NP-Complete:

Lecture 7: Counting classes

CS 580: Algorithm Design and Analysis

3/7/2018. CS 580: Algorithm Design and Analysis. 8.1 Polynomial-Time Reductions. Chapter 8. NP and Computational Intractability

P -vs- NP. NP Problems. P = polynomial time. NP = non-deterministic polynomial time

Module 6 NP-Complete Problems and Heuristics

Vertex Cover is Fixed-Parameter Tractable

Introduction to Parameterized Complexity

Traveling Salesman Problem (TSP) Input: undirected graph G=(V,E), c: E R + Goal: find a tour (Hamiltonian cycle) of minimum cost

PCP and Hardness of Approximation

Characterizing Graphs (3) Characterizing Graphs (1) Characterizing Graphs (2) Characterizing Graphs (4)

FINAL EXAM SOLUTIONS

Finite Model Generation for Isabelle/HOL Using a SAT Solver

A New Reduction from 3-SAT to Graph K- Colorability for Frequency Assignment Problem

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Algorithms For Inference Fall 2014

Ch9: Exact Inference: Variable Elimination. Shimi Salant, Barak Sternberg

Recitation 4: Elimination algorithm, reconstituted graph, triangulation

Module 6 P, NP, NP-Complete Problems and Approximation Algorithms

Approximation slides 1. An optimal polynomial algorithm for the Vertex Cover and matching in Bipartite graphs

NP versus PSPACE. Frank Vega. To cite this version: HAL Id: hal

Parameterized Complexity - an Overview

NP-Completeness of 3SAT, 1-IN-3SAT and MAX 2SAT

Umans Complexity Theory Lectures

Chapter 8. NP-complete problems. Search problems. cient algorithms. Exponential search space

Partha Sarathi Mandal

Chapter 9 Graph Algorithms

SAT Solver. CS 680 Formal Methods Jeremy Johnson

END-TERM EXAMINATION

11/22/2016. Chapter 9 Graph Algorithms. Introduction. Definitions. Definitions. Definitions. Definitions

The Complexity of Camping

Decision Procedures. An Algorithmic Point of View. Decision Procedures for Propositional Logic. D. Kroening O. Strichman.

Chapter 9 Graph Algorithms

The NP-Completeness of Some Edge-Partition Problems

Algorithms. Algorithms 6.5 REDUCTIONS. introduction designing algorithms establishing lower bounds classifying problems intractability

COMP260 Spring 2014 Notes: February 4th

Steven Skiena. skiena

The NP-completeness of some edge-partitioning. problems

Lecture 21: Other Reductions Steven Skiena

ALGORITHMS EXAMINATION Department of Computer Science New York University December 17, 2007

Fixed-Parameter Algorithm for 2-CNF Deletion Problem

Chapter 9 Graph Algorithms

2SAT Andreas Klappenecker

Lecture 20: Satisfiability Steven Skiena. Department of Computer Science State University of New York Stony Brook, NY

Homework 4 Solutions

4.1 Review - the DPLL procedure

P vs. NP. Simpsons: Treehouse of Horror VI

Transcription:

NP-Completeness Algorithms

The NP-Completeness Theory Objective: Identify a class of problems that are hard to solve. Exponential time is hard. Polynomial time is easy. Why: Do not try to find efficient polynomial time solutions to these problems. Find approximation solutions. Design heuristic solutions. Consider typical instances. Algorithms 1

The NP-Completeness Theory Another objective: Bundle the problems together into an equivalence class of problems. Solving one of the problems in the class in polynomial time would imply a polynomial time solution to all of the other problems in the class. Proving that one of the problems in the class cannot be solved in polynomial time would imply that no other problem in the class can be solved in polynomial time. Algorithms 2

The Class of Problems P Definition: All the problems for which there exists a polynomial time algorithm. O(n k )-time for constant k and n. Polynomial time: In the input size independent of the hardware and software implementation. Turing machines. Today computers. Parallel Computers with polynomial number of processors. Future computers. Algorithms 3

Input Size O(log n) for an integer n. In graphs with n vertices and m edges, Õ(n + m) for adjacent lists and Õ(n2 ) for adjacency matrix. Definition: Õ(f(n)) = O(f(n)log k n) for some constant k. Algorithms 4

The Class of Problems NP NP stands for Non-deterministic polynomial. Definition I: All the problems that can be solved by a nondeterministic polynomial time algorithm. The original definition. Definition II: All the problems whose solution can be verified in polynomial time. A more natural definition. Theorem: Both definitions are equivalent. Algorithms 5

P vs. NP P NP: If a problem is solvable in polynomial time its solutions are verifiable in polynomial time. It is strongly believed that P NP. P NP Algorithms 6

All Problems The Halting Problem is not in NP and definitely not in P. Actually, it is un-solvable. There are many problems, though not natural problems, that are outside of NP. P NP All Problems Algorithms 7

Decision Problems vs. Optimization Problems Optimization problems: Find a solution that optimizes minimizes or maximizes the objective function value. Objective function values are taken from a finite ordered domain: v 1 < v 2 < < v h. Decision problems: Add a parameter v to the input and check if there exists a solution to the original input whose value is at least v (maximization problems) or at most v (minimization problems). A YES (TRUE) or NO (FALSE) answer. Algorithms 8

Decision Problems vs. Optimization Problems Optimization Decision: Find the optimal solution and then solve the decision problem. Decision Optimization: Solve the decision problem for all possible values for the objective function. Alternatively, do a binary search for the optimal value. Works only if there are not too many possible values for the result. Algorithms 9

Graph Problems Input: A simple and undirected graph G = (V,E). V : a set of n vertices. E: a set of m edges. Input Size: Polynomial in both n and m independent on the implementation. Algorithms 10

Independent Sets A set I of vertices is an independent set if there are no edges among them: u v I {(u,v) E}. Algorithms 11

The Independent Set Problem Input: A simple and undirected graph G with n vertices. Optimization Problem: Find the independent set with the maximum size in G. Decision Problem: Is there an independent set of size at least K in G for a parameter 1 K n? The parameter K is part of the input. Notation: The independent set problem is denoted by IND. Algorithms 12

Cliques A set C of vertices is a clique if all the edges among them exist: u v C {(u,v) E}. Algorithms 13

The Clique Problem Input: A simple and undirected graph G with n vertices. Optimization Problem: Find the clique with the maximum size in G. Decision Problem: Is there a clique of size at least K in G for a parameter 1 K n? The parameter K is part of the input. Notation: The clique problem is denoted by CLIQUE. Algorithms 14

Vertex Cover Sets A set V C of vertices is a vertex cover if the vertices in V C cover all the edges: e E u V C {u e}. Algorithms 15

The Vertex Cover Problem Input: A simple and undirected graph G with n vertices. Optimization Problem: Find the vertex cover with the minimum size in G. Decision Problem: Is there a vertex cover of size at most K in G for a parameter 1 K n? The parameter K is part of the input. Notation: The vertex cover problem is denoted by VC. Algorithms 16

Dominating Sets A set D of vertices is a dominating set if the vertices are neighbors to all other vertices: u V D v D {(u,v) E}. Algorithms 17

The Dominating Set Problem Input: A simple and undirected graph G with n vertices. Optimization Problem: Find the dominating set with the minimum size in G. Decision Problem: Is there a dominating set of size at most K in G for a parameter 1 K n? The parameter K is part of the input. Notation: The dominating set problem is denoted by DOM. Algorithms 18

Vertex Coloring An assignment of colors to vertices such that neighboring vertices are assigned different colors: (c : V {1,...,χ}) {(u,v) E c(u) c(v)}. Algorithms 19

The Vertex Coloring Problem Input: A simple and undirected graph G with n vertices. Optimization Problem: Find a coloring of G with the minimum number of colors. Decision Problem: Is there a coloring of G with at most K colors for a parameter 1 K n? The parameter K is part of the input. Notation: The vertex coloring problem is denoted by COL. For K = 3 the problem is denoted by 3-COL. Algorithms 20

Hamilton Paths A simple path that visits all the vertices of the graph exactly once: P = (v 1,v 2,...,v n ) V = {v 1,...,v n }. Algorithms 21

The Hamilton Path Problem Input: A simple and undirected graph G with n vertices. Optimization Problem: Find a simple path in G that visits all the vertices. Decision Problem: Is there a simple path in G of length n? Notation: The Hamilton path problem is denoted by HAM. Algorithms 22

Problems as Languages The set of all inputs of a decision problem A for which the answer is TRUE is the language L A The goal of a decision problem A is to identify the language L A. That is, for each input I to verify if I L A or I L A. The set NP is the set of all problems for which their language can be verified with a polynomial time algorithm. The set Co-NP is the set of all problems for which their complement language can be verified with a polynomial time algorithm. Algorithms 23

NP vs. Co-NP: Possible Relations NP=Co-NP P=NP=Co-NP P NP P Co-NP NP P Co-NP Algorithms 24

Reductions Definition: A is polynomially reducible to B if: Any input I A of A can be transformed to an input I B of B in polynomial time. The answer is TRUE to I B for problem B iff the answer is TRUE to I A for problem A. Notation: A p B (A B). A p B (A B). Corollary: If B is easy then A is easy and if A is hard then B is hard. Algorithms 25

Reducibility is Transitive Idea: Polynomial times polynomial is still polynomial. x k x h = x k+h. k + h is constant for constants k > 0 and h > 0. Theorem: A p B and B p C imply that A p C. Proof: Apply first the transformation from I A to I B and then the transformation from I B to I C. Algorithms 26

The Class of Problems NP-Hard Definition: Problem A is an NP-Hard problem (A NPH) if all the problems in NP are polynomially reducible to A. For all B NP: B p A. Remark: A problem in Np-Hard does not have to be in NP. NPH P NP Algorithms 27

The Class of Problems NP-Complete Definition: Problem A is an NP-Complete problem (A NPC) if it is an NP-Hard problem and also an NP problem. NPC = NPH NP. Lemma: If A P and A NPC then P = NP. Proof: Every B NP is polynomially reducible to A and therefore can be solved with a polynomial time algorithm. Corollary: If NP = NPC then P = NP. Algorithms 28

P NP? Conjecture: It is strongly believed that P NP. NPH NPC P NP Algorithms 29

Boolean Formulas Input: A boolean formula is an expression composes of boolean operations apply to boolean variables. Variables: x 1,x 2,...,x h. Literals: Variables and their negations: x 1, x 1,x 2, x 2,...,x h, x h. Operations: (OR or SUM); (AND or PRODUCT); (XOR);... Output: A boolean formula can get the value TRUE or FALSE depending on the TRUE or FALSE values assigned to the variables. Size: There are h variables and polynomial in h operations. Algorithms 30

Example ((x y) ( z w)) ( w) If w gets the value FALSE then the formula is TRUE. If w gets the value TRUE then the value of the formula is x y. The value of z does not influence the value of the formula. Algorithms 31

CNF Boolean Formulas Definition: A Conjunctive Normal Form (CNF) boolean formula is a formula that is a product of sums of literals. (x ȳ z w) (ȳ) (z w) ( x y w). Theorem: Every boolean formula can be represented as a CNF boolean formula. Proof: The operations NOT, AND, and OR are complete. Algorithms 32

The SAT Problem Input: A CNF formula Φ with h variables {x 1,...,x h } and k clauses: Φ = C 1 C 2 C k. Problem: Find a TRUE and FALSE assignment to the h variables, if exists, that satisfies the formula Φ. Decision problem: Is there a TRUE and FALSE assignment to the h variables that satisfies the formula Φ? Observation: If Φ is satisfied then each clause contains at least one TRUE literal. Notation: This problem is called SAT. Algorithms 33

SAT is an NP-Complete Problem The original first NP-Complete problem. SAT is an NP-Hard problem since there exists a polynomial time reduction from any problem in NP to SAT. SAT is an NP problem since it is possible to verify in polynomial time if a TRUE and FALSE assignment satisfies the formula Φ. Algorithms 34

Boolean Circuits Input: A boolean circuit is a logic circuit composes of the gates OR, AND, and NOT whose inputs are the variables x 1,x 2,...,x h or the outputs of other gates. Output: Only one output. Structure: No directed cycles. Size: There are h variables and polynomial in h gates. Algorithms 35

Example x y z ((x y) (x z)) ( x (y z)) Algorithms 36

The C-SAT Problem Input: A boolean circuit with h variables {x 1,...,x h } and k OR, AND, and NOT gates. Problem: Find a TRUE and FALSE assignment to the h variables, if exists, that produces a TRUE output to the circuit. Decision problem: Is there a TRUE and FALSE assignment to the h variables that produces a TRUE output to the circuit? Notation: This problem is called C-SAT. Algorithms 37

C-SAT is an NP-Complete Problem The today common first NP-Hard problem. C-SAT is an NP-Hard problem since there exists a polynomial time reduction from any problem in NP to C-SAT. C-SAT is an NP problem since it is possible to verify in polynomial time if a TRUE and FALSE assignment produces a TRUE output to the circuit. Algorithms 38

SAT vs. C-SAT Each one of the problems is polynomially reducible to the other in a natural way. It is easier to reduce all the NP problems to the C-SAT problem than to the SAT problem. Algorithms 39

How to Prove that a Problem is NP-Complete? Prove first that the problem is an NP problem. Prove next that the problem is an NP-Hard problem. Method I: Show a polynomial time reduction from any other problem in NP. Method II: Show a polynomial time reduction from an already known NP-Hard problem. Due to transitivity, all problems in NP are polynomially reducible to this problem. Algorithms 40

The 3-SAT Problem 3-SAT is SAT in which all the clauses in the formula Φ have exactly 3 literals. The most popular NPC problem. 3-SAT is an NP problem since it is possible to verify in polynomial time if a TRUE and FALSE assignment satisfies the formula Φ. SAT is polynomially reducible to 3-SAT and therefore 3-SAT is an NP-Hard problem. 2-SAT can be solved in polynomial time. Algorithms 41

Input: Variables: x 1,x 2,...,x h. The 3-SAT Problem A 3-CNF formula: Φ = C 1 C 2 C k. Clause r: C r = (l r 1,l r 2,l r 3) Literals: l r i {x 1, x 1,x 2, x 2,...,x h, x h } for 1 r k and 1 i 3. Problem: Find a TRUE and FALSE assignment to the h variables, if exists, such that Φ =TRUE? Decision Problem: Is there a TRUE and FALSE assignment to the variables such that Φ =TRUE? Algorithms 42

A Reduction Tree C-SAT SAT 3-SAT VC CLIQUE DOM IND 3-COL HAM Algorithms 43

Reduction from 3-SAT to CLIQUE For a Formula Φ construct the graph G(Φ): Each literal l r i is a vertex for 1 r k and 1 i 3. Vertices l r i and ls j are connected by an edge if r s and l r i is not the negation of ls j. G(Φ) can be constructed from Φ in polynomial time. It has 3k vertices and at most 3k(3k 3)/2 edges. Observation: Each clause is an independent set of size 3 in G(Φ). Therefore, the maximum size of a clique in G(Φ) is k (number of clauses in Φ). Algorithms 44

Example x y _ z x x y y z z Φ = (x ȳ z) ( x y z) (x y z) Algorithms 45

Reduction from 3-SAT to CLIQUE Theorem: G(Φ) has a clique of size k iff Φ can be satisfied. Proof : Let C be a clique of size k in G(Φ). If x i C then assign TRUE to x i, If x i C then assign FALSE to x i, otherwise assign TRUE or FALSE to x i, Consistency: x i and x i cannot be connected by an edge and therefore cannot belong together to the clique C. Φ =TRUE: the 3 vertices of any clause are independent set. Therefore C must contain exactly one vertex from each clause that gives this clause the TRUE value. Algorithms 46

Reduction from 3-SAT to CLIQUE Theorem: G(Φ) has a clique of size k iff Φ can be satisfied. Proof : Let x i {TRUE,FALSE} be a TRUE assignment to Φ. Let l 1 i 1,l 2 i 2,...,l k i k be the literals in the k clauses that give each clause a TRUE value. Since the TRUE assignment is consistent, it follows that any 2 of these literals are connected by an edge to form a clique of size k. Algorithms 47

CLIQUE is NPC CLIQUE is NP-Hard: 3-SAT p CLIQUE. Is there a TRUE assignment to the formula Φ? Does G(Φ) have a clique of size K = k? CLIQUE is NP-Complete: Can verify in polynomial time that a set of size K is a clique. Algorithms 48

Reduction from 3-SAT to Vertex Cover For a Formula Φ construct the graph G(Φ): Each variable x i is represented by 2 vertices x i and x i that are connected by an edge. Each clause (l r 1 l r 2 l r 3) is represented by a triangle on the 3 vertices l r 1,l r 2,l r 3. Each vertex l r j in a triangle is connected to the variable vertex that represents its value. G(Φ) can be constructed from Φ in polynomial time. It has 2h + 3k vertices and h + 6k edges. Algorithms 49

Example x _ x y y _ z z _ w w _ Φ = (x y z) ( x y z) (ȳ z w) Algorithms 50

Reduction from 3-SAT to Vertex Cover Theorem: G(Φ) has a vertex cover of size h + 2k iff Φ can be satisfied. Observation: Any vertex cover in G(Φ) must contains at least h + 2k vertices: h vertices to cover the h variable edges. 2k vertices to cover the k triangles. Algorithms 51

Reduction from 3-SAT to Vertex Cover Proof : Let C be a vertex cover of size h + 2k in G(Φ). C contains exactly one variable vertex and 2 triangle vertices. If x i C then assign TRUE to x i. If x i C then assign FALSE to x i. The 2 triangle vertices can cover only 2 of the edges connecting the triangle to the variable vertices. The third edge must be covered by a variable vertex. This variable vertex will give the corresponding triangle the true value. Algorithms 52

Reduction from 3-SAT to Vertex Cover Proof : Let x i {TRUE,FALSE} be a TRUE assignment to Φ. If x i =TRUE then add x i to the vertex cover C. If x i =FALSE then add x i to the vertex cover C. Each clause has a TRUE literal. The variable vertex corresponding to this literal covers the edge connecting this clause triangle to its variables. Add the other 2 vertices from the triangle to the vertex cover C. These 2 vertices cover the triangle edges and the other 2 edges connecting the triangle to the variable vertices. All together, C contains h + 2k vertices. Algorithms 53

Vertex Cover is NPC VC is NP-Hard: 3-SAT p VC. Is there a TRUE assignment to the formula Φ? Does G(Φ) have a vertex cover of size K = h + 2k? VC is NP-Complete: Can verify in polynomial time that a set of size K is a vertex cover. Algorithms 54

Independent Sets and Vertex Cover Sets Observation: I is an independent set in a graph iff V I is a vertex cover of the graph. Algorithms 55

IND is an NP-Complete Problem IND is NP-Hard: VC p IND. Is there a vertex cover of size K vc in a graph G? Is there an independent set of size K ind = n K vc in G? IND is NP-Complete: Can verify in polynomial time that a set of size K ind is an independent set. Algorithms 56

VC is an NP-Complete Problem VC is NP-Hard: IND p VC. Is there an independent set of size K ind in a graph G? Is there a vertex cover of size K vc = n K ind in G? VC is NP-Complete: Can verify in polynomial time that a set of size K is a vertex cover. Algorithms 57

Cliques and Independent Sets Observation: C is a clique in a graph iff C is an independent set in the complement graph. Algorithms 58

IND is an NP-Complete Problem IND is NP-Hard: CLIQUE p IND. Is there a clique of size K clique in a graph G? Is there an independent set of size K ind = K clique in the complement graph G of the graph G? IND is NP-Complete: Can verify in polynomial time that a set of size K ind is an independent set. Algorithms 59

CLIQUE is an NP-Complete Problem CLIQUE is NP-Hard: IND p CLIQUE. Is there an independent set of size K ind in a graph G? Is there a clique of size K clique = K ind in the complement graph G of the graph G? CLIQUE is NP-Complete: Can verify in polynomial time that a set of size K clique is a clique. Algorithms 60

Vertex Cover Sets and Cliques Observation: V C is a vertex cover in a graph iff V V C is a clique in the complement graph. Algorithms 61

VC is an NP-Complete Problem VC is NP-Hard: CLIQUE p VC. Is there a clique of size K clique in a graph G? Is there a vertex cover of size K vc = n K clique in the complement graph G of the graph G? VC is NP-Complete: Can verify in polynomial time that a set of size K vc is a vertex cover. Algorithms 62

CLIQUE is an NP-Complete Problem CLIQUE is NP-Hard: VC p CLIQUE. Is there a vertex cover of size K vc in a graph G? Is there a clique of size K clique = n K vc in the complement graph G of the graph G? CLIQUE is NP-Complete: Can verify in polynomial time that a set of size K clique is a clique. Algorithms 63

Reduction from Vertex Cover to Dominating Set For a graph G = (V,E) with n vertices and m edges construct the graph G = (V,E ): All the vertices of G are in G : V V. All the edges of G are in G : E E. For an edge e = (u,v) E add a vertex e V. Add the edges (u,e) and (e,v) to E. G can be constructed from G in polynomial time. G has n + m vertices and 3m edges. Algorithms 64

Example Algorithms 65

Reduction from Vertex Cover to Dominating Set Theorem: G has a vertex cover of size at most K iff G has a dominating set of size at most K. Observation: Every dominating set in G must contain one of the vertices e,u,v for any edge e = (u,v) E to dominate the vertex e V. Algorithms 66

Reduction from Vertex Cover to Dominating Set Theorem: G has a vertex cover of size at most K iff G has a dominating set of size at most K. Proof : Let the vertex cover of G be the dominating set for G. Every vertex cover is a dominating set and therefore all the G vertices in G are dominated. Every edge in G is covered and therefore all the new vertices are dominated. Algorithms 67

Reduction from Vertex Cover to Dominating Set Theorem: G has a vertex cover of size at most K iff G has a dominating set of size at most K. Proof : Let D be a dominating set in G. If u V is in the dominating set for G, then u V is in the vertex set for G. If e = (u,v) is in the dominating set for G, then select either u or v to be in the vertex set for G. Since every vertex e V is dominated, it follows that every edge e E is covered. Algorithms 68

Dominating Set is NPC DOM is NP-Hard: VC p DOM. Is there a vertex cover of size K vc in a graph G? Is there a dominating set of size K dom = K vc in the graph G? DOM is NP-Complete: Can verify in polynomial time that a set of size K dom is a dominating set. Algorithms 69