Shift-Scheduler is an employee shift scheduling program specifically designed for the Instructional Technology Center (ITC) of Haverford College. Given time slots that need to be covered, Shift-Scheduler generates a schedule based on workers' preferences. Shift-Scheduler was my first side project that I worked on after taking an introductory Computer Science course. The scheduler was used to schedule student workers' shifts from Fall 2015 to Spring 2017. Since I have graduated from Haverford College, the project is no longer maintained, but if any of ITC employees is interested in maintaining the project, I would be happy to provide any help needed.
Shift-Scheduler uses a randomized greedy algorithm with heuristic in combination with iterative method. It attempts to assign a shift to the worker who prefers the shift the most while balancing the number of hours among workers and ensuring all time slots to be covered.
A preference of a time slot for a worker is specified from 0 to a certain number, where 0 means unavailability, and higher number means stronger preference.
time, Amy, Bob, Charles, Dave
MON-08:30-09:00, 0, 1, 2, 0
MON-09:00-09:30, 1, 1, 1, 0
MON-09:30-10:00, 1, 2, 0, 0
MON-10:00-10:30, 2, 2, 0, 3
MON-10:30-11:00, 2, 2, 2, 3
...
See sample_data_small.csv
or sample_data_large.csv
for detailed examples.
$python schedule.py input.csv output.csv
$python schedule.py input.csv output.csv --iterations 2000
Constraints must be updated in accordance with a input file. Constraint variables can be found in models.py
.
####Example
MAX_HOURS = 8.25 # targeted hours per worker
MIN_SHIFT_HOURS = 1 # minimum hours of a shift
MAX_SHIFT_HOURS = 4 # maximum hours of a shift
MIT