Dead-Lock Detection can be described using a directed graph, called as ‘wait-for graph’.
Wait-for Graph with no cycles :
Graph consists of (V, E), where V is a set of vertices and E is a set of edges.
The set of vertices consist of all the vertices in the system.
Each edge in the set of E of edges is an ordered pair Ti 🠒 Tj.
i.e., Transaction Ti is waiting for transaction Tj to release a data item.
Wait-for Graph with cycles :