Deadlocks can be modeled using directed graphs. Some terminology from graph theory Directed graph: A directed graph is a pair (N, E), where N is a nonempty set of nodes and E is a set of directed edges. A directed edge is an ordered pair (a, b), where a and b are nodes in N. Path : A path is a sequence of nodes (a, b, c, ... , i, j) of a directed graph such that (a, b), (b, c), ... , (i, j) are directed edges. Cycle : A cycle is a path whose first and last nodes are the same. Reachable set: The reachable set of a node a is the set of all nodes b such that a path exists from a to b. Knot: A knot is a collection of vertices and edges with the property that every vertex in the knot has outgoing edges, and all outgoing edges from vertices in the knot terminate at other vertices in the knot. A knot always contains one or more cycles . Deadlock Modeling The graph has a set of nodes {a, b, c, d, e,f } and a set of directed edges {(a, b), (b, c), (c, d), (d, e), ( e,j ), (f, a), ( e,b )} cycles (a, b, c, d, e, f, a) and (b, c, d, e, b). Reachable set from node a is (a,b,c,d,,e,f) A knot {a, b, c, d, e, f) that contains the two cycles of the graph.