LC: 1136. Parallel Courses - spiralgo/algorithms GitHub Wiki
The Essence: The dependency relations of the courses can be thought of as a directed graph. First layer of courses to be taken are those without any dependencies. When there is a cycle in the graph, no courses can be taken.
Details: The required solution is procedure is topological sorting. This can be achieved using Kahn's algorithm with BFS, which goes over individual layers. It can also be implemented using DFS, which is further useful to apply here because only maximum search depth is needed, not the actual sorting order.