Skip to content

crbridget/TA-Assignment-Optimizer

Repository files navigation

TA Assignment Optimizer

An evolutionary computing solution for optimally assigning teaching assistants to course sections while respecting constraints and preferences.

Overview

This system assigns 40 TAs across 17 lab sections, minimizing five penalties:

  • Overallocation: TAs assigned beyond their maximum workload
  • Conflicts: TAs scheduled for overlapping time slots
  • Undersupport: Sections with fewer TAs than required
  • Unavailable: TAs assigned to sections they marked as unavailable
  • Unpreferred: TAs assigned to sections they'd rather not teach

How It Works

Uses an evolutionary algorithm with four agents that modify solutions:

  • Random: Creates completely new random assignments
  • Swap: Exchanges two TAs between sections
  • Add TA: Adds a TA to an undersupported section
  • Remove TA: Removes a TA from a section

The algorithm runs for a set number of iterations (or time limit), periodically removing dominated solutions using Pareto optimality. Solutions that are worse in all objectives than another solution are eliminated.

Input Files

tas.csv

  • TA information: name, max assignments allowed
  • Preferences for each section (0-16):
    • P = Preferred
    • W = Willing
    • U = Unavailable

sections.csv

  • Section details: instructor, day/time, location, enrollment, topic
  • min_ta: Minimum TAs required
  • max_ta: Maximum TAs allowed

Running the Optimizer

python assignta.py

The algorithm evolves for 100,000 iterations or 5 minutes (whichever comes first), checking for dominated solutions every 100 iterations.

Testing

Run the test suite to verify objective functions:

pytest test_assignta.py

Tests use three pre-defined solutions (test1.csv, test2.csv, test3.csv) to verify each objective function calculates penalties correctly.

Output

CramptonCheng_summary.csv: CSV of all Pareto-optimal solutions with scores for each objective

Profiler Report: Console output showing function call counts and runtime statistics

Solution Format

Solutions are represented as a list of 17 sets (one per section). Each set contains the TA IDs assigned to that section.

Example:

[{0, 5, 12}, {3, 8}, {1, 4, 9, 15}, ...]

This means Section 0 has TAs 0, 5, and 12; Section 1 has TAs 3 and 8, etc.

Dependencies

  • pandas
  • numpy
  • pytest (for testing)
  • Custom evo.py framework (included)
  • Custom profiler.py (included)

Technical Details

The evolutionary framework maintains a population of solutions scored on all five objectives. Pareto dominance determines which solutions to keep: Solution A dominates Solution B if A is better or equal in all objectives and strictly better in at least one. Only non-dominated solutions survive.


Built for DS3500: Advanced Programming with Data

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages