A) a) Page 121 of the textbook states that the search version of the

advertisement
A)
a) Page 121 of the textbook states that the search version of the Interval scheduling problem can be
solved in polynomial time. We also know that if the search version can be solved in polynomial time, so
can the decision version. Since it is in polynomial space, it can be reduced to any problem in the NP
space i.e, we can solve the problem without any calls to the vertex cover problem. Hence YES
b) We have a polynomial time solution for Interval scheduling. We do not have a polynomial solution for
Independent Set. Hence if it were possible that we could reduce from Independent Set to Interval
scheduling, it would mean that NP = P. Hence UNKNOWN
B) to show that a problem is NP complete, we need to show that
i) it is in NP by giving a polynomial time certifier
ii) Solve(reduce) any of the known NP complete problems using this problem
i)
ii)
Given a solution with k customers, we will need mxn time to verify that they do not have
any common customers (we go through all the customers for each product).
Hence
we have a polynomial time certifier
The Independent set problem can be reduced to the Diverse subset problem as follows:
Draw a graph G with a vertex for each customer. Draw an edge between the customers only
if they have a product in common. If two vertices do not have an edge connecting them,
they do not have a product in common. So, we need to find customers who do not have
connecting edges. This is exactly the Independent set problem! So, we can see that the
diverse subset problem can be reduced to the independent set problem. But this is NOT
what we want to prove. We want to prove that independent set ≤p Diverse subset.
This too can be easily shown. For a given graph, create a table. Add a customer for each
vertex and a product for each edge. If there is an edge between two vertices, increment
count for that product for both the customers connected by that edge. Now, if we have a
diverse subset of k customers in the array, it is clear that there is an independent set of k
vertices. Hence, independent set ≤p Diverse subset
Hence the Diverse subset problem is NP complete.
C) to show that a problem is NP complete, we need to show that
i) it is in NP by giving a polynomial time certifier
ii) Solve(reduce) any of the known NP complete problems using this problem
i)
ii)
Given a set of k counselors, we can identify if we have an expert in each sport, by going
through the expertise of each counselor (n) up to a maximum count of the number of
sports(m). Hence we can verify the solution in mxn = polynomial time. Hence we have a
polynomial time certifier.
We can solve the vertex cover problem using the Efficient Recruiting problem. Proof:
If we have a vertex cover problem on a graph G, construct a counselor for each vertex and a
sport for each edge. The two vertices connecting the edge are the experts in that sport.
Now, if we find the minimum number of counselors that will be an expert in all sports, we
will be finding the minimum number of vertices that cover all edges.
Hence, Vertex Cover ≤p Efficient Recruiting
Hence the problem in NP complete
D)
a) we can write a polynomial time certifier for the problem. When we are given k processes, we can
verify that they do not have any common resource by going through the resource of each of the
processes in polynomial time. Hence the problem in NP
We can reduce the independent set problem to the resource reservation problem as follows: for each
vertex, we create a process and for each resource, we create an edge. If there is an edge between two
vertices, then it implies that both the processes corresponding to the two vertices are requesting for
that resource. So, if there are K processes that do not have any common resource requirements, then
the graph will not have any edges between those k vertices. Effectively, we have an independent set of
size k. Hence Independent set ≤p Resource reservation
Hence Resource reservation is NP Complete
b) For k = 2, it takes a maximum of O(n2) steps if we try by brute force. Hence it is polynomial.
For every process Pi
For every process Pi + 1
If process have a conflict
return false.
Endif
End for
End For
Return true.
c) This can be converted into a bipartite graph problem. Create a graph G with a vertex for each person
and resource. For every process, add an edge between the person and resource it requires. Now the
requirement that a process and resource must be allocated to only one process can be translated to a
bipartite matching( with persons in one set and resources in the other). Now, if we get a bipartite
matching of size k, return Yes, else no. This is polynomial time.
d)
E) to show that a problem is NP complete, we need to show that
i) it is in NP by giving a polynomial time certifier
ii) Solve(reduce) any of the known NP complete problems using this problem
i)
Download