190 likes | 305 Views
Simulated Annealing for Automated Course Scheduling. Dr. Adam P. Anthony. Overview. Problem Overview Developing a solution Problems Encountered Results. First Semester Pre-Registration. Incoming Freshmen: Given a first semester schedule, to simplify intimidating scheduling process
E N D
Simulated Annealing for Automated Course Scheduling Dr. Adam P. Anthony
Overview • Problem Overview • Developing a solution • Problems Encountered • Results
First Semester Pre-Registration • Incoming Freshmen: • Given a first semester schedule, to simplify intimidating scheduling process • Must still sit down with adviser, evaluate schedule • May change classes, but only if seats available • Students give: • Test Scores • Preferred Subjects • Majors declared (if any) • Math and English Placement
Current Solution • Students submit test scores, limited preference data • Summer chairs (or registration, or academic advising) assign each first-year student their first-semester schedule according to the data • Asynchronous (student-by-student basis) • Inefficient (must continually search for open seats in courses) • Can create Lose-Lose scheduling conflicts
Proposed Solution • Students submit same data • Simulated Annealing to model the process of individuals adding/dropping courses 1000’s of times • Aims to optimize the greater global good, rather than the local student’s needs • Summer chairs can use a web-application to retrieve the system’s suggested schedule • Student’s schedule is created
Goals of Pre-Registration • Every student has a satisfactory schedule: • 12—18 credits • Good variety of courses • All courses expected for major in first semester • At least one class they’ll really like • Placed in correct English, Math • Times of courses are nicely blocked out
Why is this Hard? • Students can’t just take all the courses they want: • Advising may not make sense (no 25 credit schedules) • No seats left • Time conflicts • Scheduling is about managing tradeoffs and avoiding conflicts
Example Tradeoff/Conflict Schedule 1: Math 161 MTWF 8:00 – 8:50 CSC 210 MWF 10:00 – 10:50 BIO 110 MTWF 1:00 – 1:50 Schedule 2: Math 161 MTWF 8:00 – 8:50 CSC 210 MWF 10:00 – 10:50 BIO 110 MTWF 1:00 – 1:50 CRJ 100 T TH 1:15—2:30 • Solutions • Drop 210 • Find an alternative to CRJ 100
Key Insight: Cooperation can Increase the Global Good • Student 1: Math 161 MTWF 8:00 – 8:50 CSC 210 MWF 10:00 – 10:50 BIO 110 MTWF 1:00 – 1:50 HIS 100 MWF 11:00 – 11:50 • WANTS CRJ 100, but it’s full!! • Student 2: Math 136 MWF 8:00 – 8:50 ENG 131 T TH 9:00 – 10:15 SOC 100 MTWF 1:00 – 1:50 CRJ 100 MWF 11:00—11:50 • WANTS HIS 100, but it’s full!!
Defining a State • Class Activity: Can we define a state for this problem? • What do we need to know about the world to change a student’s schedule? • NO TALKING KYLE!
Defining An Objective Function • Simulated Annealing wants to maximize something • Ideas for what we can quantify about a student’s schedule? • Only trick to remember: you can only optimize what you can computably measure
Defining a Transition Function • Given a current state, we need to generate successors: • Take all students’ schedules, list of open courses • Select a few students, simulate 1 add/drop transaction each • Will not be able to try all options • This is OK for simulated annealing because we don’t care if an option is the best (sometimes we want it to be worse!) • In Hill Climbing, generating random successors and taking the first one that’s an improvement is called First Choice Hill Climbing
Other Implementation Details • Copying Data: • Keep three pretty large world states in algorithm: • Current • Next • Best (slight tweak to make sure we don’t forget about a past best solution) • Must take care not to cross references • Computing the Score: • Can be very costly! • But if clever, you only have to updatethe score, rather than computing the whole thing.
Problem: Many Invalid States! • Students CAN’T: • Have more than 18 or less than 12 credits • Have 2 classes at the same time • Have 2 sections of the exact same class • Solution: constrained randomness • Randomly change a schedule, but only if that change is ‘legal’
Problem: Semi-Fixed Schedules • Some courses are required by either their declared major, or math/english requirements • The COURSE is required, but the TIME/DAY of the course is not • Solution: Course Templates • Template defines which courses are required, accounting for possible options • Fixing templates: penalize a schedule’s score if it drops a required course without adding an alternative (different time, or different option)
Simulated Annealing Process Generate Initial Schedule Set Current Schedule Set Next Schedule Set No Done? Final Best Solution Yes Improved Score? Set Current = Next Yes No Randomly Modify Current Schedule
Problem: Satisfying All Major Templates is hard! • Solution: 2-phase annealing • Round 1: optimize filling templates • Total each student’s satisfaction of required course list • Round 2: Fix templates, use preferences, other measures to improve schedules further
Optimize Everything Else Optimize Templates Only Generate Initial Schedule Set Use Final Solution for Round 1 as Initial State for Round 2 Current Schedule Set Current Schedule Set Next Schedule Set Next Schedule Set No No Done? Done? Yes Yes Final Best Solution Improved Score? Improved Score? Set Current = Next Set Current = Next Yes Yes No No Randomly Modify Current Schedule Randomly Modify Current Schedule
Preliminary Results • Conclusion: Simulated Annealing CAN improve on the human effort • Not because it is better: it allows for global optimization where humans are only making local optimizations for individual students • In theory, if one human made all the schedules, they could do just as well • Computers have advantage that they can keep 630 student schedules organized coherently and not miss anything • Similar but less compelling results for other scoring measures