HW7_Solution

HW7_Solution - HW7 SOLUTION 1. Chapter 8 Problem 2: First,...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: HW7 SOLUTION 1. Chapter 8 Problem 2: First, to see that the problem is in NP , we notice that given a customer set X with size k, we can verify that if these customers is diverse in time O ( kn ). To show NP-hardness, we reduce from Set Packing problem. Given a set U of n elements, a collection S 1 ,...,S m of subsets of U and a number k ,for each set S i = { p 1 ,...,p j } , we have a customer i purchasing p 1 ,...,p j If there exist a collection i 1 ,...,i k of those S i with the property that no two of them intersect, then X = { i 1 ,...,i k } is the diverse set of { 1 ,...,m } since S i j T S i j = if i j 6 = i j ,i j ,i j X Conversely, if X is a solution to the Diverse Set problem, then for any i,j X,i 6 = j , by the definition of diversity, S i T S j = , thus X is a collection of S 1 ,...,S m with the property that no two of them intersect. This proves that the reduction is correct and its obvious that it is done in polynomial time. Problem 4 : For each process i = 1 ,...n , we let R i { 1 ,...,m } denote the set of resource that process i requests. The question is then : is there a collection of k of these sets R i that are pairwise disjoint? (a) The Resource Reservation problem is in NP because given a set of k process, we merely have to check that their corresponding sets R i have pairwise empty intersections, which clearly works in polynomial time. Notice that this immediately implies that all special cases in parts ( b )- ( d ) are also in NP We will show in part ( d ) that that special case is NP - hard already, so the general problem is also NP - hard (b) when k = 2, all we need to do is to find if there are two sets with empty...
View Full Document

Page1 / 3

HW7_Solution - HW7 SOLUTION 1. Chapter 8 Problem 2: First,...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online