This Python program is designed to allocate Teaching Assistants (TAs) to specific courses while adhering to a set of constraints. It addresses the challenge of optimizing TA allocation based on various criteria. The program generates a CSV file containing details of unallocated TAs and provides a summary of TA assignments for each course.
The program takes into account the following constraints during the TA allocation process:
- TAs must have completed the course they are assigned to or a similar course with a decent grade.
- Each course must have the required number of TAs, with the rate of 1 TA per approximately 90 students per credit.
- Students may be eligible for multiple courses, but each student can only be assigned to one course.
- There should be at least one PhD/MTech-PhD TA for every 100 students.
- A course cannot have more than 60% undergraduate (UG) TAs.
- TAs can only be assigned to courses offered to their academically junior batches.
The TA allocation algorithm follows a forward search approach. Here's an overview of the algorithm's key steps:
- Calculate the required number of TAs for each course based on student enrollment, credits, and user-defined preferences.
- Identify eligible TAs for each course based on the three primary constraints.
- Match each TA to an optimal course by selecting the one with the most unallocated TA slots. If multiple courses have the same number of slots, preferences are considered.
- Sort eligible TAs based on seniority to prioritize postgraduate (PG) TAs over undergraduate (UG) TAs.
- Handle situations where extra TAs are initially removed from courses with fewer slots by reassigning them to courses they prefer.
The program takes 1 input excel file with 2 sheets: Sheet 1: Details of courses, including course codes, names, credits, and the number of students. Sheet 2: Details of TAs, which include their roll numbers, programs, preferences, and grades in the preferred courses.
To use your own data with the program:
- Delete the default data in the provided Excel file.
- Add your preferred data to the Excel file with the same column names as in the default file.
- Save the file.
or
- Delete the default Excel file from the folder.
- Add your file in the same folder (ensure it has the same columns as in the default file).
- Rename the file to "data" (without the double inverted commas).
Extract the zip file. Open the terminal in the folder that you have extracted all the files. Run the commands mentioned below in the terminal to install all necessary libraries.
pip install numpy pip install pandas pip install openpyxl
After installing these libraries run the command mentioned below in the terminal.
python ta_allocation_algorithm.py
After you have run the command mentioned above, You will be asked for an input (ie. number of students per TA). After you have entered the input press 'enter' to run the code.
The program will print courses (those having required number of TAs > 0) along with a list of Roll Numbers of TAs assigned to that course. The program will also save a .csv file having all the details of unassigned TAs in the same folder.