Single Instance for Each Resource Type
Maintain a wait-for graph:
- Nodes are processes.
- If process i is waiting for a resource held by process j then there is an edge from i to j.
- Exactly the same as a resource allocation graph but optimize it for the search by collapsing edges.
- Similar optimization could be done also for the resource allocation graph algorithm.
Periodically invoke an algorithm that searches for cycles in the graph.
Complexity (in wait-for graph):