An optimization tool for academic course scheduling, balancing workload distribution (ECTS/LP) while strictly preventing time-slot conflicts.
- Workload Balancing: Minimizes the variance of credit points (LP) across all semesters using a quadratic objective function to ensure a manageable and steady workload.
- Time-Slot Conflict Prevention: Enforces hard constraints ensuring no two modules occupy the same time slot within a single semester.
- Seasonal & Continuity Logic: Automatically respects seasonal availability (Winter/Summer/Both) and ensures multi-semester modules are completed consecutively without interruption.
- Status Quo Integration: Allows fixing specific modules to predetermined semesters to account for courses already completed or currently in progress.
- Language: Python 3.14.3
- Solver: Gurobi (via
gurobipy) — requires a valid Gurobi license (free academic license available) - Libraries: Matplotlib (visualization), Collections (data structures)
The tool distributes a list of modules over a set number of semesters (
Objective:
Key Constraints:
- Enrollment: Each module must be started exactly once.
-
Duration: Active modules in semester
$s$ must account for their required duration$d$ . - Capacity: Prohibits overlapping assignments for weekly slots (Mon–Fri, 8–20h).
- Install Dependencies:
pip install -r requirements.txt
- Activate Gurobi License: Ensure your academic license is active via grbgetkey.
- Run Optimizer
python TimeTablePlanningUniversity.py
Courses and their specific requirements are defined using the module dataclass within the script:
module(
name="Medtech 1",
duration=1, # number of semesters
time=[3, 4, 5, 6], # 2h slots (e.g., 3=Mon 12-14h)
lp=6, # credit points
start="winter" # "winter", "summer", or "both"
)This is an academic side project.
- Personal & Educational Use: Feel free to explore, learn from, and use this tool for private purposes.
- Commercial Use: Prohibited. Contact me directly for written permission.
