Mini Timetabling Problem with Step-by-Step GA Operations
Complete coverage of selection, crossover, and mutationA university needs to schedule 2 courses (C1, C2) into 2 available time slots (T1, T2) and 2 rooms (R1, R2). Each course requires exactly 1 time slot and 1 room.
Maximize feasibility by minimizing constraint violations
Fitness = Number of satisfied constraints (max = 2)
Each chromosome is represented as: $[C1\_slot, C1\_room, C2\_slot, C2\_room]$
By completing this exercise, you will be able to:
Calculate fitness for each chromosome (4 points)
| Chromosome | Schedule | Constraint 1 | Constraint 2 | Total Fitness |
|---|---|---|---|---|
| 1 | [T1,R1,T2,R2] | ✓ | ✓ | 2 |
| 2 | [T1,R2,T1,R1] | ✓ | ✓ | 2 |
| 3 | [T2,R1,T2,R2] | ✓ | ✗ | 1 |
Chromosomes 1 and 2 are both fully feasible (fitness = 2), while chromosome 3 violates the instructor availability constraint for C1. This fitness landscape will drive selection toward the feasible solutions.
Fitness-proportionate parent selection (4 points)
Both selected parents have high fitness (2), demonstrating how roulette wheel selection favors better solutions while still allowing some randomness. The low-fitness chromosome 3 was not selected, but had a 20% chance.
Generate offspring through genetic recombination (6 points)
| Offspring | Chromosome | C1 Schedule | C2 Schedule | Constraint 1 | Constraint 2 | Fitness |
|---|---|---|---|---|---|---|
| 1 | [T1,R1,T1,R1] | T1,R1 | T1,R1 | ✗ Conflict! | ✓ | 1 |
| 2 | [T1,R2,T2,R2] | T1,R2 | T2,R2 | ✓ | ✓ | 2 |
Offspring 1 has both courses scheduled in the same room (R1) at the same time (T1), creating a constraint violation. Offspring 2 maintains full feasibility like both parents.
Key insight: Crossover can sometimes produce worse offspring than parents, but genetic diversity enables the population to explore new regions of the search space.
Introduce genetic diversity (4 points)
This mutation demonstrates how small changes can dramatically improve fitness. By changing just one gene (C2's time slot from T1 to T2), we eliminated the room conflict and achieved perfect feasibility. This shows mutation's power to fine-tune solutions and escape local optima.
Understanding GA advantages for timetabling (2 points)
Hill climbing explores only one solution at a time and can get stuck in local optima. Genetic algorithms maintain a population of diverse solutions, allowing parallel exploration of multiple regions in the solution space.
Unlike hill climbing which makes incremental changes, GA's crossover operator can combine beneficial characteristics from different solutions, potentially creating better offspring than either parent.
Mutation introduces random changes that help escape local optima and maintain genetic diversity, preventing premature convergence to suboptimal solutions.
For timetabling problems, GA's ability to maintain and evolve multiple candidate solutions simultaneously makes it particularly effective at finding high-quality schedules while avoiding the local optima that trap single-solution methods like hill climbing.
Essential GA concepts and practical implications