Graph
Answer
Topological order exists iff no directed cycles, Kahn’s algorithm detects cycles by empty queue before completion
Explanation
A directed graph is acyclic exactly when a topological ordering exists. Kahn’s algorithm fails to process all nodes when a cycle prevents removing remaining in-degree–zero vertices.
Last reviewed: October 2026
Reviewed by FirstInTest Editorial Team
Related questions
QuestionBack to list