Opening your learning path
Progress is saved as you study.
Opening your learning path
Progress is saved as you study.
The Graph BFS - Topological Sort (Kahn's Algorithm) pattern applies when you need the Graph BFS - Topological Sort (Kahn's Algorithm) technique within the Graph Traversal Patterns (DFS & BFS) pattern. Its time complexity is O(V + E) and space complexity O(V). It is used in 8 problems on Thita, including Alien Dictionary, Build a Matrix With Conditions and Find All Possible Recipes from Given Supplies. Common variations are Graph DFS - Cycle Detection (Directed Graph) and Deep Copy / Cloning.
Master topological sorting using Kahn's BFS algorithm. Solve course schedule and build order problems.
Graph BFS - Topological Sort (Kahn's Algorithm) is one of the 12 subpatterns of the Graph Traversal Patterns (DFS & BFS) pattern, which covers dFS/BFS traversal, topological sort, shortest paths, Union-Find, and MST. The whole pattern is about 5 hours of study. This subpattern is a core technique: expect it to come up directly in interviews.
Master graph algorithms including DFS/BFS traversal, topological sort, shortest paths (Dijkstra, Bellman-Ford), Union-Find, and advanced graph concepts. Problems in this subpattern are usually searched for as topological sort, Kahn algorithm, course schedule, build order, DAG sorting, leetcode 207.
Read the theory for Graph BFS - Topological Sort (Kahn's Algorithm), then work the problems attached to it in the browser editor. Your solution runs against the problem's test cases, and the AI coach offers a hint about the technique you are missing rather than a finished solution. Progress is tracked per subpattern, so the Graph Traversal Patterns (DFS & BFS) tracker shows this one as covered once you have solved its problems.
Graph BFS - Topological Sort (Kahn's Algorithm) is one lesson in a 16-pattern DSA course. If you are preparing end to end, work the interview-critical patterns first and use the pattern sheet as the checklist; if you are here for one technique, the Graph Traversal Patterns (DFS & BFS) guide is the shortest path back to the rest of it.