Topological Sorting: Easy to Hard Problems
Easy
- Course Schedule (Basic topological sort problem for detecting cycles and finding course order)
- Course Schedule II (Finds an order to complete courses, leveraging topological sort)
- Find the Order of Characters in Alien Dictionary (Determines the order of characters based on sorting constraints)
- Minimum Height Trees (Finds the root nodes of a tree that minimizes height, related to topological sorting)
- Reconstruct Itinerary (Finds the order of flights, related to topological sort)
Medium
- Task Scheduler (Schedules tasks with cooldowns, related to ordering constraints)
- All Paths From Source to Target (Finds all paths in a DAG, often solved using topological sort)
- Graph Valid Tree (Validates if a graph can be a tree, involves topological sorting)
- Build Order (Determines the build order of projects based on dependencies)
- Longest Path in a Directed Acyclic Graph (DAG) (Finds the longest path in a DAG, solved with topological sort)
Hard
- Topological Sorting with Multiple Graphs (Advanced topological sorting involving multiple graphs)
- Minimum Number of Operations to Make a Valid Sequence (Advanced problem with topological sort and sequence operations)
- Task Scheduling with Dependencies (Complex task scheduling involving topological sorting)
- Topological Sorting in Directed Graphs with Large Constraints (Handles large graphs with topological sorting)
- Critical Connections in a Network (Involves advanced graph algorithms and topological sorting to find critical connections)