IAE Academy

ISRO CS 2025 Q.66: solution and answer

ISRO 2025 · CSQ.66 · 1 mark · MCQ

Analyze the below resource allocation graph. Which of the following is the corresponding wait-for graph?

ISRO CS 2025 question 66: Resource allocation graph with processes P1 to P5 (circles) and resources R1 to R5 (squares, one instance each).Tap to open full size
Figure from the ISRO CS 2025 paper. It is part of the question.
Figure description

Resource allocation graph with processes P1 to P5 (circles) and resources R1 to R5 (squares, one instance each). Edges: P1 -> R1 (request); R1 -> P2 (assignment); P2 -> R3 (request); R3 -> P5 (assignment); P2 -> R4 (request); R4 -> P3 (assignment); P2 -> R5 (request); P3 -> R5 (request); R5 -> P4 (assignment); P4 -> R2 (request); R2 -> P1 (assignment). Options are wait-for graphs on P1 to P5. (a) P1->P2, P2->P5, P2->P3, P2->P4, P3->P4, P4->P1. (b) P1->P2, P2->P5, P2->P3, P3->P4, P4->P1 (no P2->P4). (c) P1->P2, P2->P5, P2->P3, P2->P4, P4->P1 (no P3->P4). (d) P1->P2, P2->P5, P2->P3, P2->P4, P3->P4 (no P4->P1).

  1. (A)

    Wait-for graph with edges P1->P2, P2->P5, P2->P3, P2->P4, P3->P4, P4->P1

  2. (B)

    Wait-for graph with edges P1->P2, P2->P5, P2->P3, P3->P4, P4->P1 (no edge P2->P4)

  3. (C)

    Wait-for graph with edges P1->P2, P2->P5, P2->P3, P2->P4, P4->P1 (no edge P3->P4)

  4. (D)

    Wait-for graph with edges P1->P2, P2->P5, P2->P3, P2->P4, P3->P4 (no edge P4->P1)

Answer and solution

ANSWER

Option (a) is the wait-for graph: , , , , , .

Official answer: ASource: ISRO's final answer key of 15 May 2026

  1. In a resource allocation graph, an edge means is requesting , and an edge means is currently held by . A wait-for graph removes the resources and draws when requests a resource that holds.

  2. Read the holders from the graph: is held by , by , by , by and by .

  3. Read the requests: requests ; requests , and ; requests ; requests . requests nothing.

  4. requests , held by , so .

  5. requests (held by ), (held by ) and (held by ), so , and .

  6. requests , held by , so . requests , held by , so .

  7. The wait-for graph has exactly six edges: , , , , , . Only option (a) shows all six. Option (b) lacks , option (c) lacks , and option (d) lacks .

KEY IDEA

To convert a resource allocation graph (single-instance resources) to a wait-for graph, replace each path (request, then holder) by one edge , and drop the resource nodes.

WATCH OUT FOR

Forgetting that one process can wait on several resources, so it contributes several edges (here has three outgoing edges). Another slip is to omit an edge that closes a cycle, such as , or to miss because and both request .

From the ISRO CS 2025 paper. Every question of this paper · The full paper (PDF, ISRO) · All 2 ISRO Deadlock questions, with notes