Automated Scheduling Jack Meyers Daniel Morrison Scheduling Problem
Automated Scheduling Jack Meyers & Daniel Morrison
Scheduling Problem
Problem Description Math department currently schedules classes by hand, months of work Decided to create an algorithm to do this Assign classes an instructor and a time Restrictions are placed on how we can assign classes Algorithm adapts to changes in data to create new schedules
Hard Constraints ● An instructor can’t teach more than two classes in a row ● An instructor can teach at most one upper level class ● An instructor cannot teach two classes at the same time ● Cannot teach different classes in the same room at the same time ● A professor can teach up to three courses ● A lecturer can teach up to four courses ● Classes must be taught by a qualified instructor
Soft Constraints Instructors prefer teaching back to back classes Instructors should teach at their preferred times Minimize the number of rooms Classes should be taught by instructors that prefer to teach the class
Instructor Preference Data Math 151 Math 208 Math 309 Instructor 1 0 2 1 Instructor 2 2 1 1 7: 45 am 8: 50 am 9: 55 am Instructor 1 0 2 2 Instructor 2 2 2 1
Difficulties Large number of possible schedules NP problem - brute force will not work Making sure all hard constraints are met Maximizing all soft constraints
Two Algorithms Two main algorithms used in scheduling Genetic Algorithm Integer Linear Programming Split up and each takes an algorithm Compare results
Genetic Algorithm
Algorithm Process Current population Only best adapted survive Breed the stronger survivors New population Repeat until population is strong
Chromosome List of 0’s and 1’s that represent a schedule We define the structure Create a population (many schedules) and iterate the schedules in it
Heuristic Function A measure of how good a chromosome is Used to compare possible schedules Heuristic Score: 5 Heuristic Score: 4 Heuristic Score: 0 Math 151 Math 208 Math 309 Instructor 1 0 2 1 Instructor 2 2 1 1
Mutating Randomly delete and reassign random bits in the chromosome, here 2 of the 6 bits Heuristic Score: 0 Heuristic Score: 5 Math 151 Math 208 Math 309 Instructor 1 0 2 1 Instructor 2 2 1 1
Breeding Merge two chromosomes into a single new one by combining the values Heuristic Score: 4 Heuristic Score: 0 Math 151 Math 208 Math 309 Instructor 1 0 2 1 Instructor 2 2 1 1
Algorithm Process
Instructor-Class Assignment Method 1 Each bit in the chromosome represents a specific instructor-class pair 1 represents that instructor teaches that class, 0 means they don’t With 38 instructors and 116 sections, the chromosome is 4408 bits long 8. 71 x 101326 schedules
Instructor-Class Assignment Method 2 Chromosome picks an instructor that is able to teach class Reduces chromosome to 555 bits 1. 18 x 10167 schedules {1, 5} {1, 2, 3} Math 151 Math 208 Instructor 1 1 2 Instructor 2 0 1 Instructor 3 0 2 Instructor 4 0 0 Instructor 5 2 0
Class-Time Assignment Places all of an instructor’s classes into “blocks” Repeated sections are placed together Chromosome represents a combination of the blocks to determine the instructor’s schedule
Integer Linear Programming
Target Function for Scheduling Classes
Hard Constraints Ensured by changing 0 to -9999 Created a strong bias against choosing impossible values for each x. Soft Constraints Maximized by changing 2 to 100 Gave a larger bias towards choosing the preferred values for each x.
Constraint to limit maximum number of classes:
Constraint to limit maximum number of classes: For Instructor 1, the constraints would look like: Choose x 1 = 0, x 4 = 1 and x 7 = 0. Then the hard constraint wasn’t invalidated and the soft constraint is maximized.
Simplex Method
2 - Dimensional Feasible Region h(x) = { Bob ≤ orange line Jim ≤ green line Amy ≤ red line
Comparing Results
Strengths Weaknesses Genetic Algorithm Simplicity makes it fast to implement, Heuristic function gives it flexibility. Randomness can give the model speed boost in large solution spaces. Integer Programming Difficult to find solutions since it can only randomly change Many invalid solutions (heuristic score 0) makes this problem worse. Easy to ensure hard constraints aren’t violated. Model always finds the same solution, so it is less flexible. Easy to ensure that soft constraints are maximized. Designing equations to model the constraints is hard.
Comparison Chart
Future Work
Questions?
n - Dimensional Feasible Region The Simplex Method maps all extreme points to a vertex. The Simplex Method then “walks” down edges, choosing the edges that move to vertices with the highest values.
- Slides: 32