Determine the topological order of courses using Kahn's Algorithm (BFS) and detect cycles in prerequisites.