In a resource allocation graph, a deadlock exists if and only if:

A resource allocation graph is a directed graph used to represent the allocation of resources to processes and the requests for resources by processes. A cycle in the graph is a sequence of edges and vertices wherein the starting vertex is the same as the ending vertex, forming a loop. A deadlock happens when a group of processes wait for resources in such a way that none of them can move forward. This condition is indicated by the presence of a cycle in the resource allocation graph. If there is at least one cycle, it means that the processes in the cycle are keeping resources while also waiting for resources held by other processes in the same cycle.