How should one go about this kind of problems? I'm supposed to use a graph structure for this.
Say I have a file containing a couple of courses with their prerequisites.
I have to organize the semester with courses while respecting prerequisites and the max number of courses per semester. The first semester should be filled to the max capacity if possible, then the second, the third, etc.
For example:
max : 3, path to INF7
1: INF1, INF2, INF3
2: INF4, INF5,
3: INF6
4: INF7
Of course a course that has another course as its prerequisite can't be completed before or while the prerequisite is in progress.
I thought about doing a graph of string representing the course and find all paths from a node to another node then build a set with that, but I am stuck at this step.
Any advice is appreciated.