# Wait-for graph

One such deadlock detection algorithm makes use of a wait-for graph to track which other processes a process is currently blocking on. In a wait-for graph, processes are represented as nodes, and an edge from process ${\displaystyle P_{i}}$ to ${\displaystyle P_{j}}$ implies ${\displaystyle P_{j}}$ is holding a resource that ${\displaystyle P_{i}}$ needs and thus ${\displaystyle P_{i}}$ is waiting for ${\displaystyle P_{j}}$ to release its lock on that resource. If the process is waiting for more than a single resource to become available (the trivial case), multiple edges may represent a conjunctive (and) or disjunctive (or) set of different resources or a certain number of equivalent resources from a collection. In the conjunctive case, graph cycles imply the possibility of a deadlock, whereas in the disjunctive case knots are indicative of deadlock possibility. There is no simple algorithm for detecting the possibility of deadlock in the final case. (Srinavasan, Rajaram 2011)