Let's say we have a directed graph that represents school courses. Some courses are a prerequisite of others (e.g. [2,1] means that course 1 needs to be taken before course 2). We can take as many courses in parallel as we want, as long as the prerequisite is completed
I think this would naturally fit into a directed graph. To get the order of courses that can be taken, we would use topological sorting. If instead, we want to find the "bottleneck" course, what kind of algorithm makes sense?
A bottleneck looks like this:
- Lets say we have the following prerequisites: [2,1],[3,2],[6,3],[5,4],[6,5]
- That means we can take {1,4} in parallel, then {2,5}, then we have 3 as a "bottleneck" for course 6 because it's the last course that is left before we can take 6
Visualization attached below in case it helps
I'm not sure where to start with this problem