This problem is based on 8.4 from the Kleinberg and Tardos textbook.

Suppose you’re consulting for a group that manages a high-performance real-time system in which asynchronous processes make use of shared resources. Thus, the system has a set of *n* *processes* and a set of *m* *resources*. Each process specifies a set of resources that it requests to use. Each resource might be requested by many processes at once, but it can only be used by a single process at a time.

Your job is to allocate resources to processes that request them. If a process is allocated all the resources it requests, then it is *active*; otherwise, it is *blocked*. You want to perform the allocation so that as many processes as possible are active.

Thus, we phrase the *Resource Reservation Problem* (RR) as follows: Given a set of processes and resources, the set of requested resources for each process, and a number *k*, is it possible to allocate resources to processes so that at least *k* processes will be active?

- For this part and the next part
**only**, assume you **do** have a polynomial-time algorithm for RR. Give a polynomial-time algorithm to determine the **largest** *k* for which you can allocate resources to processes so that at least *k* processes will be active.
- Still assuming you have a polynomial-time algorithm for RR, give a polynomial-time algorithm to determine a maximum-size set of processes that can be simultaneously active. (The specific processes, not just how many there are.)
- Now stop assuming you have a polynomial-time algorithm for RR, and consider the following list of problems. For each problem either give a polynomial-time algorithm or prove that the problem is NP-complete. (In the former case, your “algorithm” may be a reduction to another problem that you know can be solved in polynomial time.
*Hint:* One of these can be solved in polynomial time by reduction to the “maximum matching problem”, which can be solved in polynomial time.)
- The general Resource Reservation Problem defined above.
- The special case of the problem when
*k* = 2.
- The special case of the problem when
*k* = 10.
- The special case of the problem when there are two types of resources—say, robotic dogs and robotic cats—and each process requires exactly one resource of each type. (In other words, each process requires one specific robotic dog and one specific robotic cat.)
- The special case of the problem when each resource is requested by at most two processes.