A Genetic Algorithm Academic Scheduling Engine is a Python-based scheduler that uses evolutionary optimization to generate high-quality academic timetables. It handles real-world constraints such as room capacities, facilitator preferences, instructor load, time-slot conflicts, and special SLA course rules. Using a genetic algorithm, it evolves candidate schedules over multiple generations to find the optimal arrangement.
-
Genetic Algorithm Optimization
Uses selection, multi-point crossover, and adaptive mutation to iteratively improve schedules. -
Constraint-Aware Fitness Function
Evaluates schedules based on room capacity, facilitator preferences, workload balance, and SLA rules. -
Time-Conflict Management
Handles overlapping time slots, consecutive scheduling penalties, and SLA-specific timing constraints. -
Facilitator Load Balancing
Penalizes overloading facilitators while rewarding optimal assignments. -
Customizable Inputs
Easily define activities, facilitators, rooms, and time slots. -
Exportable Results
Produces a neatly formattedbest_schedule.txtfile with the final optimized schedule.
- Clone the repository:
git clone https://github.com/AbdalrahmanBashir/genetic-algorithm-scheduler.git
cd genetic-algorithm-scheduler- Install dependencies (Python 3.8+ required):
pip install numpy- Edit
main.pyto define your activities, rooms, facilitators, and time slots. - Run the scheduling engine:
python main.py- The best schedule will be saved as
best_schedule.txt. The console will also print fitness improvements per generation.
- Initial Population: Random schedules are generated.
- Fitness Calculation: Each schedule is scored based on constraints and penalties.
- Selection: Top schedules are probabilistically chosen using softmax on fitness scores.
- Crossover & Mutation: Selected schedules are combined and mutated to create new candidates.
- Iteration: Steps 2–4 repeat for a defined number of generations.
- Output: The highest-fitness schedule is saved and presented in a human-readable format.
Best Schedule is:
Fitness Score: 3.75000
Activity Facilitator Room Time Slot Enrollment
--------------------------------------------------------------------------
SLA100A Glen Slater 003 10 50
SLA100B Banks Roman 201 11 50
SLA191A Tyler Beach 301 12 50
...
Scheduling academic courses is a complex, NP-hard problem. This engine demonstrates how genetic algorithms can produce high-quality, near-optimal schedules efficiently, without brute-force search. It’s a practical solution for:
- Universities and colleges
- Training programs
- Academic event scheduling
- Research into evolutionary optimization
This project is licensed under the MIT License.