Here is my problem: I am designing an application that will allow students to select the classes they want to take for the semester and create potential schedule layouts for them. Each class typically has several possible sections that occur at different times.
So I am looking for a good data structure to use in order to develop an algorithm that will do this.
Is there a common way to do this? Any data structures and/or algorithms I can apply to this situation? I am just looking for a place to get started.
EDIT: The classes tend to be Monday, Wednesday, Friday or Tuesday, Thursday. In a lot of cases there are also labs or recitations that occur at various times during the week
Thanks,
Rob
I would use a tree
At each node (which represents a class) branch for each section and an additional branch for not taking the course
You can prune for scheduling conflicts at any time
This shouldn’t get too big as long as you aren’t storing these forever, and as long as you don’t include too many courses per student per semester
The tree would be rooted at any arbitrary class. Each branch from root would be a section of that class (and the extra branch for not taking it)
Then at the end of each of these branches you have more nodes. These nodes would all represent the second class you’re fitting in the schedule.
Each of these nodes would have another branch for each section of the second class. And so on.
ex: