Deadlock detection
Deadlock detection is usually handled by the construction of a wait-for graph (WFG)
that shows the transaction dependencies; that is, transaction Ti is dependent on Tj
if transaction Tj holds the lock on a data item that Ti is waiting for. The WFG is a directed
graph G = (N, E) that consists of a set of nodes N and a set of directed edges E, which is
constructed as follows: