What is a Resource Allocation Graph, and how can it be used to detect a deadlock?

Last updated 5 July 2026

  • A Resource Allocation Graph is a directed graph of processes and resources: request edges go process to resource, assignment edges go resource to process.

  • With one instance per resource type, a cycle means deadlock (necessary and sufficient), since it forms a circular wait.

  • With multiple instances, a cycle is necessary but not sufficient, so a full detection algorithm must be run.

  • https://medium.com/@ayoadeakin234/operating-systems-ii-week-4-59446abbba78
  • https://www.geeksforgeeks.org/operating-systems/rag-full-form/
  • https://www.youtube.com/watch?v=lDMDMCF2F8c
  • https://parashar--manas.medium.com/understanding-operating-system-deadlock-part-48-deadlock-detection-and-recovery-96528af29e9c
  • https://www.tutorialspoint.com/operating_system/os_deadlock_detection_and_recovery.htm
  • https://medium.com/@bharathan.m.blr/os-deadlock-deep-dive-necessary-conditions-prevention-detection-7cb3783988e0
  • https://www.scaler.com/topics/resource-allocation-graph-in-os/
  • https://www.scaler.com/topics/operating-system/deadlock-avoidance-in-os/
All Operating Systems interview questions