Analyze the resource-allocation graph below. Which option is the corresponding…

2025

Analyze the resource-allocation graph below.

image.png

Which option is the corresponding wait-for graph?

Attempted by 128 students.

Show answer & explanation

Correct answer: the first option

In a wait-for graph, resource nodes are removed. For every pair Pi -> Rk and Rk -> Pj draw a process edge Pi -> Pj.

From the given resource-allocation graph:

  • P1 requests R1, and R1 is allocated to P3, so add P1 -> P3.

  • P3 requests R3, and R3 is allocated to P2, so add P3 -> P2.

  • P3 requests R4, and R4 is allocated to P5, so add P3 -> P5.

  • P3 requests R6, and R6 is allocated to P4 and P5, so add P3 -> P4 and keep P3 -> P5.

  • P4 requests R5, and R5 is allocated to P1, so add P4 -> P1.

The first option is the one that keeps only process nodes and matches these wait edges with the correct directions.

Explore the full course: Isro