Suppose the problem is modified so that some courses can be taken multiple times (repeatedly) and prerequisites must be satisfied each time before retaking. Which of the following statements about adapting the BFS topological sort approach is correct?
AWe should switch to a dynamic programming approach because BFS topological sort cannot handle repeated courses.
BThe original BFS topological sort can be used without changes since it handles cycles by returning -1.
CWe can use BFS topological sort by resetting indegrees after each semester and reprocessing courses as needed.
DThe problem becomes invalid because repeated courses create cycles; BFS topological sort cannot be applied directly.
Step-by-Step Solution
Step 1: Understand repeated courses and prerequisites
Allowing repeated courses with prerequisites means cycles can form because a course depends on itself indirectly.