GATE CSE 2021 Set 2 Q56: Properties of a directed 4×4 grid graph from vertex S
- Algorithms
- 2 marks
- MSQ
- No negative marking
Question
Consider the following directed graph:
Which of the following is/are correct about the graph?

Try it: multiple select: one or more correct options
Select all correct options. No negative marking, no partial marks.
Show answer and explanation
Answer: A, B (official GATE 2021 final answer key)
Concept used: A directed graph has a topological order iff it is acyclic; DFS finds one back edge per cycle it closes.
First step: Look for a directed cycle in the grid (for example around one of the top squares), then run DFS from S and mark the edges that point to an ancestor.
Full step-by-step solution
Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.
Share this question
Source: official GATE 2021 Set 2 CS question paper and final answer key, organised by IIT Bombay. Question paper · Answer key
More Algorithms PYQs
- 2026 Session 1 · Q17Solve nested recurrences T1 = 4T1(n/2) + T2, T2 = 5T2(n/4) + log n
- 2026 Session 1 · Q41Shortest paths with at most k edges: two statements
- 2026 Session 1 · Q47Condition forcing a vertex into every minimum vertex cover
- 2026 Session 1 · Q49Cycle and cut properties of MSTs with distinct weights
- 2026 Session 1 · Q50Impossible DFS discovery/finish orderings for a DAG edge
- 2026 Session 1 · Q55Properties of 2-colorable (bipartite) graphs