ISpyScheduling

Inspiration

TA scheduling is always a pain within Computer Science courses at Tufts University. Office hours shift constantly due to budgeting changes, uneven attendance, and last-minute conflicts. Existing systems are clunky, heavily manual, and don't properly account for TA preferences or staffing priorities.

We wanted to build something smarter — a system where TAs can express availability and ranked preferences, and an algorithm does the heavy lifting. That's how ISpyScheduling was born: a preference-driven, optimization-based scheduling system designed specifically for CS course staff.


What It Does

ISpyScheduling is a preference-based shift allocation system for teaching assistants. It automatically generates optimized office hour and lab schedules by balancing:

  • Ranked time preferences (yes / ok / no)
  • Companion preferences (who you want to work with)
  • New vs. experienced TA pairing
  • Lab role requirements (lab lead vs. lab assist)
  • Shift capacity and priority
  • Fair hour distribution

It also supports dynamic schedule reduction when courses need to cut hours due to budget or low attendance — without disproportionately hurting individual TAs.


Features

Preference Form

  • Ranked availability input
  • Companion/partner preferences
  • Role selection (lab lead / lab assist)

Smart Schedule Generation

  • Enforces fair minimum hours per TA
  • Prioritizes critical time slots
  • Ensures correct lab staffing
  • Automatically pairs new and returning TAs

Optimization Engine

The optimizer works in two phases:

  1. Greedy initialization for baseline staffing
  2. Simulated annealing (10,000+ iterations) to improve fairness and preference satisfaction

The acceptance probability at temperature \(T\) follows:

$$ P(\text{accept}) = e^{\Delta S / T} $$

where \(\Delta S\) is the change in schedule quality score. Temperature decays over iterations to converge on a near-optimal solution.

Schedule Reduction Mode

  • Target budget input
  • Priority-based shift removal
  • Fairness-aware removal scoring
  • Maintains minimum-hour guarantees

Clean Schedule View

  • Dynamic updates when changes occur
  • Designed to replace manual spreadsheets

How We Built It

Backend (Node.js + MongoDB)

  • Stores TA metadata, shift metadata, and preference matrices
  • Represents shifts with structured metadata (day, time, capacity, lab flags, staffing arrays)
  • Validates and parses structured preference strings
  • Maintains schedule state in a format optimized for algorithmic evaluation

Scheduling Algorithm

The algorithm computes a minimum required hours threshold, then scores each assignment using a weighted function:

$$ \text{Score}(s, t) = w_1 \cdot P(s,t) + w_2 \cdot E(s,t) + w_3 \cdot L(s,t) + w_4 \cdot F(s,t) $$

where:

  • \(P(s,t)\) = time preference score for TA \(t\) at shift \(s\)
  • \(E(s,t)\) = experience pairing score
  • \(L(s,t)\) = lab role compatibility
  • \(F(s,t)\) = fairness/hour-balance score

Greedy assignment provides initial feasibility, then simulated annealing maximizes global schedule quality.

Frontend Interface

  • Availability selection inspired by When2Meet-style grids
  • Clear schedule visualization
  • Reduced-hours configuration
  • Coverage request support

Challenges We Ran Into

  • Designing a scoring function that meaningfully balances fairness and preference satisfaction
  • Preventing local optima in schedule optimization
  • Structuring shift and TA metadata to support both greedy and annealing phases
  • Handling edge cases (duration mismatches, staffing constraints, lab requirements)
  • Making schedule reduction fair without breaking minimum-hour guarantees

Accomplishments That We're Proud Of

  • Built a full-stack scheduling optimizer capable of generating and improving schedules algorithmically
  • Implemented simulated annealing in a real-world staffing context
  • Designed a flexible system that adapts to both expansion and budget cuts
  • Created a tool that meaningfully reduces manual administrative overhead

What's Next for ISpyScheduling

  • Coverage request automation and swap optimization
  • Multi-course scalability
  • Predictive staffing based on historical attendance
  • Improved UI for real-time schedule adjustments
  • Advanced weighting customization for course administrators

Built With

Share this project:

Updates