An interactive Operating Systems project that demonstrates how processes and resources interact using a Resource Allocation Graph (RAG). The application visually simulates resource requests, allocations, deadlock detection, circular wait conditions, and recovery strategies in real time.
๐ Hosted Application: https://os-rag.vercel.app/
In modern operating systems, multiple processes compete for limited resources such as:
- Memory Blocks
- Files
- Printers
- I/O Devices
- Semaphores
- CPU Resources
Improper allocation of these resources can lead to Deadlock, where processes wait indefinitely and system progress stops.
This project was built to make these theoretical concepts easier to understand through an interactive visual simulator.
- Visualize process-resource interaction using graphs
- Simulate resource requests and allocations dynamically
- Detect deadlocks automatically
- Highlight circular wait conditions
- Demonstrate deadlock handling strategies
- Provide an educational learning tool for OS students
The graph contains two types of nodes:
- ๐ต Process Nodes โ Circular nodes
- ๐ฆ Resource Nodes โ Square nodes
- Process โ Resource = Request Edge
- Resource โ Process = Allocation Edge
If a circular dependency exists in the graph, the system automatically detects a Deadlock State.
- Add Processes dynamically
- Add Resources dynamically
- Drag nodes freely across canvas
- Real-time graph rendering
- Create Request Edges
- Create Allocation Edges
- Arrowhead directional flow
- Automatic cycle detection
- Culprit edges highlighted in red
- Involved nodes glow red
- Status panel updates instantly
- โ Safe Scenario
- โ Deadlock Scenario
- Total Processes
- Total Resources
- Total Edges
- Current System State
Displays theoretical deadlock recovery approaches:
- Process Termination
- Resource Preemption
- Rollback
- Circular Wait Removal
- Live Logs
- Reset Simulation
- Responsive Premium UI
- React.js
- Vite
- Tailwind CSS
- JavaScript
- Framer Motion
src/
โฃ components/
โ โฃ LeftPanel.jsx
โ โฃ RightPanel.jsx
โ โ GraphCanvas.jsx
โฃ utils/
โ โ deadlock.js
โฃ App.jsx
โ main.jsx
The application internally models all nodes and edges as a directed graph.
- Build adjacency list
- Traverse graph using DFS (Depth First Search)
- If a back-edge / cycle is found โ Deadlock exists
- Highlight involved nodes and edges
- Update system status panel
- No circular dependency exists
- System remains safe
- Resources can continue allocation
- Processes wait for each other's resources
- Circular wait occurs
- Deadlock detected instantly
git clone https://github.com/CalmaCodes/Resource-Allocation-Graph-Visualizer.git
cd Resource-Allocation-Graph-Visualizer
npm install
npm run dev- Bankerโs Algorithm module
- Resource instance counts
- Export / Import scenarios for reproducibility
- Step-by-step simulation mode
- Process scheduling integration
- Multi-user collaboration mode
This project helps students understand:
- Mutual Exclusion
- Hold and Wait
- No Preemption
- Circular Wait
- Deadlock Prevention
- Deadlock Avoidance
- Deadlock Detection
- Deadlock Recovery
- Somtirtha Acharya โ Project Development, Logic Integration, Deployment
- Kajal Dahiya โ Testing, Documentation, Review
- M.Bhargav Naidu โ Presentation, QA, Support
GitHub Source Code:
https://github.com/CalmaCodes/Resource-Allocation-Graph-Visualizer.git
Created for academic and educational purposes.


