Hey, algorithm challenge for anyone who's up to it xP I work in the Provost Office/Academic Affairs at the college I am currently attending, and have been put in charge of developing some way to better manage the scheduling of finals for future semesters. It's been done by hand up until this point, but now they want either a standard to work off of to make doing it by hand quicker, or if possible, an automated solution. I threw together a sort of standard, but the problem is, the courses shift enough between semesters that there really is no way to build a definite standard.
The finals have to be scheduled such that it is impossible for any student to have two at the same time, and as such, two classes can only share a final time-slot if their meeting times over-lap (preventing the student from being in both in the same semester). This is done by taking a list of standardized class times, assigning them final time-slots (thus handling the majority of the courses), then taking all the courses that over-lap with them and sorting them into the groups. Since all the classes in such a group must overlap not only with the standard time but with all the other times as well there are often conflicts.
Suffice to say, I have solved the problem through the resolution of conflicts. However, after the resolutions there are always going to be a number of classes which cannot be sorted into these groups. These "oddball" classes must then be sorted into groups of overlapping classes as well. The catch is this: it has to be done with as few groups as possible. So the problem is as follows:
Given a list of ranges, sort the ranges into groups in which all the ranges overlap, with as few resulting groups as possible.
I have come up with a couple solutions, but neither is quite as efficient as I would like. The first is to simply start with the first range, stick it in a group with as many courses as possible by adding the first course that overlaps with it, then the next that overlaps with both, and so on. The problem with this is that it must check every other range for each range, which isn't a big deal for the test-data I'm running in on, but were it to be run on the production data, there are often hundreds of unique time-ranges. The other thought was to check different times, and see which time had the most courses at once, create that group, then repeat. But this would prove even more inefficient, as I would have to run checks at 10-15 minute intervals for a 24-hour time for each course.
I've looked through several books on set-algorithms from the school library with no luck, so any advice or pointers would be most appreciated.
Thank you for your time,
Timothy