Deadlock Detection with Graphs
A Resource Allocation Graph models processes and resources. A directed edge from a process to a resource represents a request, while an edge from a resource to a process represents an allocation. A cycle can indicate deadlock; for single-instance resources, a cycle is sufficient, while with multiple instances additional analysis is required.
Request edge: Process -> Resource.
Assignment edge: Resource -> Process.
For single-instance resources, a cycle indicates deadlock.
For multiple resource instances, a cycle alone may not prove deadlock.
Wait-for graphs can simplify process-to-process dependency analysis.