Timetable Scheduling using Genetic Algorithms
A very famous scenario where genetic algorithms can be used is the process of making timetables or timetable scheduling.
Consider you are trying to come up with a weekly timetable for classes in a college for a particular batch. We have to arrange classes and come up with a timetable so that there are no clashes between classes. Here, our task is to search for the optimum timetable schedule.
Creating Chromosomes
You can represent a class as,
<Module, Student Group, Day, Location, Lecture Time>Encoding details to a chromosome
You can encode the classes as a binary pattern to a chromosome.
You can give binary values for each value in each entity. You can change the encoding pattern as you wish. Given below is an example way you can encode the class.
Get the list of modules and assign binary values.
Data Mining - 0000, Machine Learning - 0001, Biology - 0010,...Get the list of student groups and give binary values.
STG0 - 00000, STG1 - 00001, STG2 - 00010, STG3 - 00011,...Similarly, you can come up with coding schemes as given above for every entity in the class.
Given below is a sample encoding of a class.
<Data Mining, STG3, Monday, Hall D, 8.00AM>Data Mining - 0000
STG3 - 00011
Monday - 000
Hall D - 1010
8.00AM - 1000Chromosome - 00000001100010101000Individual bits are called genes. This chromosome has 20 genes.
Creating Initial Population
Different student groups take different classes within a week. Hence, you have to come up with different class combinations and create the initial population. You can decide upon the size of the population (number of classes).
<Data Mining, STG3, Monday, Hall A, 8.00AM>
<Machine Learning, STG2, Tuesday, Hall B, 8.00AM>
<Computational Biology, STG8, Tuesday, Hall A, 10.00AM>
...You have to encode these classes in to chromosomes as mentioned before.
Coming up with an Evaluation Function
You can formulate the evaluation function as the inverse of the number of class conflicts for student groups. Lesser the number of conflicts, more fit the class is.
Now you can perform crossover and mutation operations to maximize the fitness value for each class.
You can terminate the process when the population has reached the maximum fitness value, i.e. the classes have minimum number of conflicts.
Jeffrey Flynt, hope you got a clear idea about a real world problem where genetic algorithms can be used.





