resource-allocation graph -> how to resource allocated for graph.
set of vertices(V)->
1. set of process {P 1 ,P 2 ,P 3, P 4 ,P 5.... P n }
2. set of resources{R 1 ,R 2 ,R 3 ,R 4 ,R 5 ....R n }
set of edges->
1. P i R j (request edge)
2. R j P i (assignment edge)
resource type= (squre)
process type= (circle)
in above question resources allocation graph is
process P = {P 1 ,P 2 ,P 3, P 4 ,P 5 }
resources R= {R 1 ,R 2 ,R 3 ,R 4 ,R 5 }
no cycle are create so not go to deadlock process.
wait for graph -> use only process
if P 1 is waiting for R 3 and R 3 is assigned for P 4 then we draw only P 1 P 4 .
if P 2 is waiting for R 3 and R 3 is assigned for P 4 then we draw only P 2 P 4 .
etc....
no cycle are create so not go deadlock and say system is safe state.