GATE CS 2021 Set 2 — Question 56
Go beyond PYQs with Success TrackerAI-powered personalised practice and doubt support. Unlimited practice on eligible plans; AI usage limits apply.MSQ+2 / -0HardStrongly Connected ComponentsGraphs (Data Structure)Programming & Data StructuresDFS Edge ClassificationGraph AlgorithmsAlgorithmsTopological Sort
Algorithms → Graph Algorithms → DFS Edge Classification
Last updated
Question
Consider the following directed graph:
Which of the following is/are correct about the graph?

Correct answer
(A) The graph does not have a topological order.; (B) A depth-first traversal starting at vertex S classifies three directed edges as back edges.
Solution
1.Topological Order: A directed graph has a topological order if and only if it is a Directed Acyclic Graph (DAG). By inspecting the graph, we can identify cycles. For example, the cycle exists (where denotes the vertex at column and row ). Since the graph contains cycles, it cannot have a topological order. Thus, (A) is correct.
2.Back Edges in DFS: A DFS starting from will encounter cycles. For this specific grid structure, a standard DFS traversal will identify 3 back edges corresponding to the independent cycles formed by the alternating directions of rows and columns. Thus, (B) is correct.
3.Strongly Connected Components: Every graph has strongly connected components (SCCs). Since this graph has cycles, it contains non-trivial SCCs. Therefore, (C) is false.
4.Strong Connectivity: The graph is not strongly connected because there is no directed path between every pair of vertices (e.g., no path from the top-right vertex back to ). Thus, (D) is false.
Continue learning with Success Tracker
A step still unclear? Work through it with support
Use Success Tracker to ask about the reasoning, then try another GATE CS question to check your understanding.
AI-powered practice· Unlimited practice on eligible plans
- PYQs with solutions
- Attempt available previous-year questions, then compare your reasoning with the worked solution. Coverage varies by stream.
- Practice that adapts
- Choose a topic, work on weaker areas and bookmark questions to revisit. Your attempts feed your progress tracking.
- AI doubt support
- Ask follow-up questions about a step or concept while practising, instead of stopping at the final answer.
Unlimited practice is available on eligible plans. Free practice and AI usage have limits; check the current plan allowances before choosing.
This page stays readable without an account. AI responses can be wrong; check them against the solution and source material.
More questions on Graph Algorithms
2026 Set 2 Q12The set T represents various traversals over binary tree. The set S represents the order of…2026 Set 1 Q17Consider the following recurrence relations: For all ,…2026 Set 2 Q19Consider the following three ANSI-C programs, P1, P2, and P3. P1 [code] P2 [code] **P3**…2026 Set 1 Q23Let be an odd number greater than 100. Consider a binary minheap with elements stored in an…2026 Set 2 Q24Consider the following functions, where is a positive integer.…