Everyone is familiar with the schedule problem in Computer Science.
I am not asking for an algorithm for this problem.
I just want to create my personal schedule for a semester at school
Here’s what you can assume:
All I want is some hints/clues as to how to create valid schedules and more importantly, optimal schedules.
Come to think of it, what would be an optimal schedule?
In my personal case, these classes are from 2 different faculties but I have been able to create a csv file that contains information like this:
M 16:35:00 17:25:00 PHIL 375 Existentialism. 14:35:00 15:55:00 COMP 350 Numerical Computing. 14:35:00 15:55:00 COMP 208 Computers in Engineering. 14:35:00 15:25:00 PHIL 306 Philosophy of Mind. 14:35:00 15:25:00 PHIL 200 Introduction to Philosophy ..etc
as you can see, everything is sorted by starting time (inverted) but there are conflicts. Same for all the other days of the week.
How can I create valid/optimal schedules? What things should I consider?
More information:
This is what I thought initially for things I should consider:
Missing something?
For this scale – I wouldn’t try too hard to avoid the simple to program brute-force solution.
There are
25!/(20!*5!)=53130different possibilities to chose 5 courses from a list of 25. By simply checking all of them, and getting the best – an optimal solution is guaranteed. The run time for this scale is also not a problem for any modern machine.A backtracking solution is simple enough – “guess” a course to add, invoke recursively until you have a list full, evaluate the solution. When you are back from the recursion – check a different possibility to chose a course.
Pseudo code:
invoke with
findCalendar(myCourses,[],0), when the algorithm is done –bestSolwill hold the best calendar, and its value will bebest