Define the Wait for graph
Ans: The wait-for-graph is a directed graph and consist of nodes and directed arcs; the nodes of the graph are active transactions. An arc of the graph is inserted among two nodes if there is a data-item is needed by the node at the tail of the arc that is being held by the node at the head of the arc. If there is a transaction Ti, waiting for a data-item that is presently allocated and held by transaction Tj, after that there is a directed arc from the node for transaction Ti, to the node for transaction Tj. The wait-for-graph is employed for detection of deadlock in the system. If there is cycle exits in the graph, all the transaction (denoted as nodes) are in deadlock, which are in the cycle.