You are on page 1of 45

Genetic Algorithms used in

Timetable Management

Henri LARGET

April 2012

The work contained within this document has been submitted
by the student in partial fulfilment of the requirement of their course and award


By

1
Abstract
This paper is about the prototype of a computer application that uses Genetic Algorithms (GAs) in
timetable management problems. It is an approach about GAs, more generally the field of Artificial
intelligence that explores the field of Automated scheduling. The project is for a bachelors degree.

2
Acknowledgments
I would like to acknowledge the contribution of Dr Faiyaz Doctor, from Coventry University, who
suggested this topic and supervised me during its realisation.
I would also like to acknowledge the Informatics department of Universit de Savoie at the IUT
Annecy in France and especially Ms Christine RIEU permitting me to complete my bachelors degree
in a foreign country.

3
!"#$%&'$ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) *
!'+,-./01230,$# )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 4
*) 5,$%-16'$7-, ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 8
4) 9730$&"/0 3&,&2030,$ &,1 20,0$7' !/2-%7$:3# )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ;
4)*) 9730$&"/0 3&,&2030,$ )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ;
"#$#$# %&'( )* ' ()+,('-.,/ ##################################################################################################################################################################### 0
"#$#"# %&'( )* ' 123345 ()+,('-.,/ ###################################################################################################################################################### 0
"#$#6# %&'( )* (&, '7(8'. ()+,('-., +'9'2,+,9( :;3-.,+/ #################################################################################################### <
4)4) <0,0$7' !/2-%7$:3# ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) =
"#"#$# =)*(3;> ################################################################################################################################################################################################ <
"#"#"# ?,@)9)()39* ######################################################################################################################################################################################## <
"#"#6# ?'(' ,9734)92 '94 4,734)92 ################################################################################################################################################### $A
"#"#B# C9)()'. D3:8.'()39 ######################################################################################################################################################################### $$
"#"#E# FG'.8'()39 3@ (&, :3:8.'()39 H I)(9,** @897()39 ############################################################################################################ $$
"#"#0# J;3**3G,; ,G3.8()39 #################################################################################################################################################################### $"
"#"#K# L8('()39 ########################################################################################################################################################################################## $B
"#"#<# M,N :3:8.'()39 '94 .33: ######################################################################################################################################################### $B
>) ?%-$-$@A7,2 )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) *B
>)*) C&$& #$-%01 &,1 0,'-17,2 ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) *B
>)4) D7$,0## E6,'$7-, &,1 /--A 0,17,2 ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) *F
6#"#$# J39*(;')9(* ##################################################################################################################################################################################### $O
6#"#"# FG'.8'()39 3@ @)(9,** ################################################################################################################################################################### "A
6#"#6# F94 3@ .33: ###################################################################################################################################################################################### "A
>)>) G-,'0A$7-, ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 4H
I) ?%-J0'$ K&,&2030,$ )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 4*
I)*) 9:0 A%-J0'$ ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 4*
4
!"#"#" %&'()*+,-. /'( 0123(&/ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 4#
!"#"4" 5(&'-2+2.6 &'2,&( """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 4#
!" #$%&'()*$%) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ,,
!"-" ./0 12$3$3410 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ,,
!"," 50%03*& 6'7$2*3/8) """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ,,
7"4"#" 8(-(/,& 9+.21,/':; 20021/*-,/,(; """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 44
7"4"4" <,:,/; 2= 8(-(/,& >+.21,/':; """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 44
!"9" :02)$%;' #$%&'()*$% """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ,9
<" =*302;3(20 20>*0? ;%@ A*A'*$72;1/4 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ,B
<"-" =*302;3(20 20>*0? """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ,B
<"," C*A'*$72;1/4 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ,B
D" 6110%@*&0) """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ,!
6110%@*E -; F 12$G0&3 12$1$);' """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ,!
6110%@*E -A F 12$G0&3 12$1$);' 8;2H*%7 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ,<
6110%@*E , F :$?02:$*%3 120)0%3;3*$% """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ,D
6110%@*E 9 F &';)) @*;72;8 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ,I
6110%@*E B F :2$3$3410 20)('3) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ,J


5
1. Introduction
This paper is about Genetic Algorithms used in timetable management at university. The objectives
of this project are, first, to introduce Genetic Algorithm and, secondly, to use it to solve a timetable
management problem.

The objectives are to define what are Genetic Algorithms and how it works, to define what is
timetable management and its actual problems and to make a prototype of an automated timetable
management system without using the classical approach but the Genetic Algorithm.

The current timetable system in Coventry University is estimated adequate. This thesis does not
propose an alternative.

6
2. Timetable management and genetic Algorithms
2.1. Timetable management
2.1.1. What is a timetable?
A timetable is a system used to schedule time.
A School timetable is a table setup to coordinate students, teachers and rooms for a given period.
The act of planning tasks or activities to improve the productivity is called Timetable management.
Group: a group is a set of students who are timetabled together. For example, classmates.
Module: a module is a lesson.
Course: a course is a set of modules for a given group.
Size of a room: the size of the room is its capacity, its number of seats for students.
Timetables are very important for the university administration. It gives to students and teachers the
right time and the right place to be, the availability of the rooms, the time done by the teachers for the
pay, the availability of the teachers and the students.
2.1.2. What is a good timetable?
A timetable encounters two types of constraints, hard constraints and soft constraints. The
constraints considered as hard are the constraints that must be satisfied. These constraints cannot
be violated. Timetable management has a lot of hard constraints. These are some example used in
the research:
The same module cannot take place twice in a week. A module for a course is unique and
cannot be twice.
A module cannot take place in a smaller room than required. There will be not enough places
for students and the lesson cannot be given.
A student cannot be at two places for the same time.
A place cannot be used for two courses for the same time.
7
A timetable cannot exceed a specific range of days by week, more than 5, from Monday to
Friday. Its a school time constraint, for administrative tasks for example.
A module cannot take place in a non-specific place if the required type of place is specified.
A timetable cannot exceed a specific range of hours by day, and more than 24 hours day.
Theses constraints are human constraints. They are fixed and all timetable witch doesnt respect it is
not a correct solution.
A soft constraint is a constraint witch may be violated. It should be satisfied for the best but the
timetable is correct even if theses constraints are not satisfied. These are some example used in this
research:
A module should not take place before a certain hour and after an hour. For example, if the
range is defined from 10AM to 5PM, a course after 5 is possible but its not a best solution.
A group should get a certain number of free days during the week. If this number is defined to
1, a timetable without free day is a solution, a timetable with only 2 of 5 days with courses is
also a solution, but its not optimised.
A group should not get more than a specific number of hours max by day. If it is set to 6, for
example, a day with 7 hours for a group is correct, but its not the best solution for the group,
because the group can be exhausted for the last course.
A group should not get more than a specific number of consecutive hours without break. Same
as before, students of a group will be exhausted if they get 5 hours without break, without
changing the mind.
A module should not use a place too big or a specific type of place if not needed. Because
some courses need a bigger room, if the room taken is too big, then, it will be a waste of
space, a waste of electricity and waste of heating during winter.
The distance between places of consecutive modules should not be excessive. This distance
can represent the time that students will take to go from a place to the next place.
8
These constraints can be breached. Hard and soft constraints are useful to define what is an
optimized timetable or an incompatible timetable.
2.1.3. What is the actual timetable management problem?
Timetable management system is a complex system used to create a schedule for human tasks.
Bigger is the problem; bigger is the set of solutions. A human can get a result for a small set of
timetable, but if the number of modules to treat gets bigger, no human even actual computers can
create all possibilities.

2.2. Genetic Algorithms
Its a procedure inspired in biologic evolution (Charles Darwin), programmed in computers, and
oriented to produce solutions for problems that have been difficult to solve with classical
approaches.(wgonz 2010)
2.2.1. History
John Henry Holland wrote a book called Adaptation in Natural and Artificial Systems in 1975. This
Scientist and Professor of Psychology, Electrical Engineering and Computer sciences improved
Artificial Intelligence field of study giving it a new Algorithm: the Genetic Algorithm, based on the
Darwin theory of evolution to solve problems. He permits to give solutions to problems that classic
algorithms could not solve; using this algorithm he gave a new innovating way to solve Optimisation
problems. Actually, John Holland is considered as one of the father of Artificial Intelligence and the
father of genetic algorithm.
2.2.2. Definitions
Some important definitions:
Gene: a Gene is a part of solution. It contains some data.
Chromosome: a Chromosome (or individual) is a solution to the given problem, composed by
genes.
9
Population: set of solutions.
Soft constraints: constraints that may be breached
Hard constraints: constraints that must be satisfied
Generation: a round of the algorithm, with a new population, after evolution.
Steps of the GA


Choose initial Population
Repeat
Evaluate population

Select best-evaluated individuals for reproduction

Apply crossover/mutation reproduction

Set new population
Until ending condition (when a individual get the desired evaluation or a specified number
of generations has been done).


10
!"#$#%&' )*)+&%$#*"
,-%&+%$#*" *. /01*2*3*2'3
4'&'5$#*" *. 6'3$ /01*2*3*2'3
/1*337-'189+$%$#*"
:'; <*)+&%$#*"
,"=#"> 5*"=#$#*"
,"=
4$%1$

2.2.3. Data encoding and decoding
Data encoding is the first step before starting GA. It consists into getting a way to transform a solution
into a chromosome encoding it to get a simple value, like a string. It is used to simplify the treatment
and the improve speed of the algorithm. An easy way to do is to convert the data into a binary string.
A Gene is a part of Chromosome and can be converted to a binary string either. Convert the data to
this type permits an easier treatment for the algorithm. The chromosome string is composed with
side-by-side genes strings.
Encoding
This is a chromosome, or a solution to a problem.
1011100110111010100010100011110100100101101010011010001111
The chromosome can be spited into genes
10111001101110101000 10100011110100100101 10101001101010001111
A gene can be spited to get all the data
10111 0011 011 10101000
23 3 3 168
11
Other ways to encode the data are possible; the string representing the chromosome containing the
genes must be maintained. The size of a data into the gene depends of the maximal size of the data
you want to save inside the chromosome. In this example, you can see 0011 for 3, and 011 for 3
also. Theses two values represent two different data. The first one can store data from 0 to 15, the
second one, from 0 to 7. The order of the genes doesnt alter the solution in many cases. A gene can
be composed of a fixed part and a variable part. The variable part will improve the solution.

2.2.4. Initial Population
Initiate the population is the first step in GA. It consists into creating an amount of random individuals
using hard constraints. The choice of the population depends on the needs of the user. A small
amount of population will get smaller and destroy the full population after some generations because
of evolution can give invalid chromosomes. On opposite a large amount of population will give better
results but will require more resources and will be slower. The population can be represented as a
set.
!"#$%&'(") +,-' ". ,"%$'("),/


2.2.5. Evaluation of the population Fitness function
Fitness: The fitness of a solution is the estimation of how good the solution is, using soft constraints.
At this range, the solution is valid.
12
The evaluation of the population is the heart of the GA. this step estimates which solution is better
than other using a fitness function. The fitness function can give this information by different ways:
The fitness can be given using a range between 0 and 1, where 1 is estimated as the best solution of
the population, using other the other individuals to range them. In this case, there will be always a
solution that the fitness is 1, and a solution that the fitness is 0.
The fitness can be given using a range between 0 and 1, as seen before, but 1 can be a non-
reachable point. The best solution approaches 1. Its a limit of the perfect solution. This fitness
function depends on a huge number of soft constraints. In this case, there is not a perfect solution,
only best than others.
The fitness can be given using a mark table. Each constraints satisfied give a certain amount of
points, each constraints violated take back an amount of points. This way offers a non-unique
solution, it doesnt depend on other individuals to gets its fitness and the solution doesnt get a final
goal.
The fitness function permits to order the population and select the best individuals.
!"#$%&'(") +,-' ". ,"%$'("),/
0-,' 123"4","4-,


2.2.6. Crossover evolution
The crossover evolution is a method used for the creation of a new population, based on older
population. The simple crossover evolution use two chromosomes and permit to create X new
13
chromosomes. It consists into splitting the two chromosomes in parts and creating new
chromosomes using different couple of the parts.
Simple crossover evolution
Chromosome A:
10111001101110101000101000111/10100100101101010011010001111
Chromosome B:
01101110100110110101000101000/11100110110100100100101010011
Crossover generation:
10111001101110101000101000111/01101110100110110101000101000
10111001101110101000101000111/11100110110100100100101010011
01101110100110110101000101000/10100100101101010011010001111
11100110110100100100101010011/10100100101101010011010001111
This crossover solution offers 4 new chromosomes.
Other methods for multiple crossover evolution with more than 2 chromosomes but the treatments
get complex to get all combinations available.
3 chromosomes crossover evolution
Chromosome 1: ABC (simplified chromosome spitted in 3 parts)
Chromosome 2: DEF
Chromosome 3: GHI
Crossover generation: 27 chromosomes: ADG, ADH, ADI, AEG, AEH, AEI, AFG, AFH, AFI, BDG,
BDH, BDI, BEG, BEH, BEI, BFG, BFH, BFI, CDG, CDH, CDI, CEG, CEH, CEI, CFG, CGH, CFI.
But sometimes, the application is trapped because it doesnt get new best solutions. Crossover
evolution can give to the new population invalid chromosomes or no better ones. At this point, the
algorithm uses mutation to produce new best chromosomes.
14
!"#$%&'(") +,-' ". ,"%$'("),/
0-,' 123"4","4-,
53",,"6-3 ,"%$'("),

2.2.7. Mutation
Mutation is used to get the algorithm moving. It consists of changing the values of a gene randomly,
permitting an evolution resulting in a new unexpected solution. These solutions offer a new point of
view for the fitness function. The mutation changes only the chromosome, without affecting others
solutions.
Mutation
Original Chromosome:
100111101011 101100101001 101001101010 101111001010
After mutation
100111101011 101010101001 101001101101 101111001010
!"#$%&'(") +,-' ". ,"%$'("),/
0-,' 123"4","4-,
53",,"6-3 ,"%$'("),

2.2.8. New population and loop
The crossover and the mutation permit to create a new population of original solutions.
15
Evolution
Original two chromosomes:
1011100110111010100010100011111100110110100100100101010011
0110111010011011010100010100010100100101101010011010001111
Application of the crossover method, new population:
1011100110111010100010100011111100110110100100100101010011
0110111010011011010100010100010100100101101010011010001111
1011100110111010100010100011110100100101101010011010001111
0110111010011011010100010100011100110110100100100101010011
1011100110111010100010100011101101110100110110101000101000
1110011011010010010010101001110100100101101010011010001111
At this step, counting initial population, 6 solutions are available. But using Crossover again on these
solutions gives always the same result. The algorithm is looping for infinite. At this step a mutation
on 33% of the population, 2 chromosomes, for example the parents:
1011100110111010100010011011000100110110100100100101010011
0110111001100011010100010100010100100101101011100110001111
This mutation gives two new chromosomes, which can be valid. This gives 8 chromosomes.
With the mutations on the new once, the crossover evolution obtains 4 brand new parts.
The idea of creating a new population of solution based on the older one is to evolve and get a better
population.
The end of the loop can be setup using different conditions:
The number of the generations can be used as an ending condition. It is useful to see how
powerful the crossover and mutation functions are because of setting a small number of
generations, it can be seen if the changes are slow or fast and give an estimation of the
efficiency of the evolution functions.
16
A fitness condition can be reached and make the end of the loop. Using this way, you can get
a certain range of solution, but the algorithm uses random generation and random mutation. It
can take a long time to change its values and reach the desired goal.
A limited number of chromosomes can be also used at limit. As the fitness condition, it can
take a long time until you get the result.

17
3. Prototyping
This chapter treats about prototyping a Genetic Algorithm for Timetable Management.
3.1. Data stored and encoding
The first step in prototyping a Genetic Algorithm is to define the data stored and how to encode it.
For the timetable management problem, a Chromosome is a set of timetables for different courses,
and a Gene represents a given module. The next array represents the data stored in a gene.


Data Description
Course identifier It permits to know which course this module is part of. For example
the course 1 can represent the third year students modules in
computer science. Because the course represents a set of modules
for a group of students, the number of courses will give a number of
course timetables. This course information is fixed for the module
and may not be changed in the algorithm. This is a fixed data.
Module Identifier A module identifier is used to define the module, and what it is.
Because the gene represents a module, the identifier cannot be
changed.
Duration It represents the length of the module and cannot be changed.
Capacity required It represents the number of students for the module. Its a fixed
data.
Module Type



Gives information about if the module is a lab or a lecture. Its a
fixed part of the gene. The course identifier, the module identifier
and the module Type are together the identifier of the gene.
18
Room type required Some modules need a specific room, for example, a computer lab
or a network lab. This value is in the fixed part of the gene.
Day of the module It represents which day the module takes place and may vary to
evolve with the genetic algorithm. Its the variable part.
Hour of the module It represents which hour the module starts and is a variable part
Room number The room number represents where the module takes place. It is a
variable part.
The first try was to encode all the data into a gene, but it started to be too long.

First Gene, with all data encoded:
001010000001110001101100010110010100010011001000
The Gene exploded in data:
001 01000 0001110001 1 0110001011 001 010 001 0011001000
1 8 113 1 395 1 2 1 200
day Hour room course module type duration room type capacity
Gene output:
Its a Lecture [1] of 395. This class is on Monday [1] from 8 to 10 [2 Hours] in a Lecture Room [1] in
113.
The gene is 48 bits long. The variable part (day, hour, room) represents 18bits and the fixed part is
30.
A timetable can contains up to 18 modules by week, the length of the chromosomes is of 864 bits.
The fixed part takes too much place in the chromosome.

The second solution was to combine all the module information into a single index and remove all the
waste of memory.

19
Second Gene, with an index instead of all the fixed data:
00101000000111000100000100
The Gene exploded in data:
001 01000 0001110001 00000100
1 8 113 4
day hour room index
This gene represents exactly the same module like the previous example. The size of the gene is
now to 26 bits.
The new gene containing 26 bits, a timetable with 18 modules by week gives chromosomes with a
length of 468 bits.

3.2. Fitness function and loop ending
3.2.1. Constraints
The constraints have to be defined before working on the algorithm. The purpose of this step is to
define how a good timetable is built.
Constraint Type of constraint
Range of day from 1 to 5 (Monday to Friday) Hard constraint
Range of hours per day from 8AM to 7PM Hard constraint
Unity of module in a timetable Hard constraint
No two modules for the same course at same time Hard constraint
A room is for one module at a time Hard constraint
A module cannot take place in a too small room Hard constraint
One day free by week Soft constraint
A range of hours per day from 10AM to 5PM for no courses too late Soft constraint
No more than 6 hours a day Soft constraint
20
No more than 3 hours without a break Soft constraint
Some constraints can be set as hard constraints and soft constraints but this is a user choice.
3.2.2. Evaluation of fitness
For this algorithm, a point table gives the fitness of each individual in the population.
Constraint Points
Hard constraints Invalid.
One day free by week As many days free, it takes a proportional number of
points to be removed.
A range of hours per day from 10AM to 5PM
for no modules too late.
For each good day, it gives an amount of point,
and for each hour out of this range, it takes points by
number of exceeding hours.
No more than 6 hours a day As previously, it gives an amount of points for each
day that respects the constraints.
No more than 3 hours without a break It removes point for each more than 3 consecutive
hours.

3.2.3. End of loop
The end of the loop and the end of the algorithm is managed by two ways. The first way is to set up a
number of generations. This way offers a good view of how efficient is the genetic algorithm. The
second way to set the end of loop is by using a point value to reach. The algorithm is slow and this
way takes a long time but offer better solutions.
3.3. Conception
Please refer to the class diagram in appendix 3.
21
4. Project Management
4.1. The project
As initially started, the project was about a web-application used by lecturers and students to manage
their own timetable, but the project evolved into the field of artificial intelligence, the genetic
algorithms. The project started without any initial knowledge.

4.1.1. Scheduling the project
The first part of the project was dedicated to research about what is a genetic algorithm and how it
works. It was long due to thee less initial knowledge. This part was dedicated to readings.
The second step of the project was the creation of the prototype. This step turned around encoding
the data and creates the fitness function.
Timetable management using genetic
algorithms
140 days Starting date
Research 70 days 01/12/2011
Readings about timetable management 20 days 01/12/2011
Readings about genetic Algorithms 50 days 21/12/2011
Prototyping 50 days 09/02/2012
Encoding data 30 days 09/02/2012
Fitness function 10 days 11/03/2012
Mutation & tests 10 days 21/03/2012
Report writing 20 days 01/04/2012

4.1.2. Technology choice
The first technology chose was Java, with the Java Genetic Algorithm Package, the JGAP library. But
a problem has been encountered: The JGAP library was too complex for prototyping. After meeting
with the project supervisor, it has been decided that the project will be done in PHP. PHP is not
specially a language done for algorithm, the application get slower. But the choice has been maid to
simplify the algorithm development. So PHP5 full-object oriented has been decided.

22
5. Conclusions
5.1. The prototype
Please refer to the prototype Results in Appendix 4.
The prototyping result offers a good view of the how the timetable is optimised. In appendix 4, we can
see on each algorithm executions the first best estimated result and the best timetable chose
between the ten first solutions by the user after a certain number of generations. This shows that
there is an evolution between the original solution and the ending solution. The problem with the
prototype is that the mutation is not using soft constraint to change some chromosomes and gives
only brand new solutions for the solutions mutated.
5.2. Genetic Algorithms
5.2.1. Genetic algorithms opportunities
The genetic algorithms offer ways to solve complex problems of optimisation. They are used in very
famous problems like the travelling salesman problem or the ant colony problem. They offer a huge
set of solutions and give, using Darwins theory, a simplified way to treat the problem.
5.2.2. Limits of Genetic Algorithms
The genetic algorithms are limited from multiple sides. The first side of limitation is the time
execution. The Algorithm takes long time to be executed and requires a certain machine
configuration. This can be a problem for time execution.
The second limit of the algorithm is the importance of the random part. Due to a huge set of
solutions, the algorithm cannot guaranty to get the best result or the achievement of a certain level of
fitness. In this case, the algorithm can run indefinably.
23
5.3. Personal Conclusion
This project offered me a new field of studies. It was really interesting and deserved all my interest
during the research and the prototyping. I would recommend this project to other students but it
requires good notions about algorithms and a particular interest in maths.
24
6. Literature review and bibliography
6.1. Literature review
WGONZ - 2010. Genetic Algorithm Definition [ONLINE] Available from
<http://www.answermath.com/genetic-algorithms/ga-1-definition.htm> [20 April 2012]

6.2. Bibliography
BAMBRICK (L.) 1997. Lecture Timetabling Using Genetic Algorithms. The University of Queensland

BEASLEY (D.), BULL (D.), MARTIN (R.) 1993. An Overview of Genetic Algorithms. Inter-University
Committee on Computing

DORIGO (M.), GAMBARDELLA (L.M.) 1996. Ant colonies for the traveling salesman problem.
Universit Libre de Bruxelles

HAKAN (Y.) 2000. Simulated Annealing & Applications to Scheduling Problems. Bilkent University

HOLLAND (J.) 1975. Adaptation in Natural and Artificial Systems. University of Michigan

KOZA (J.) 1992. Genetic Programming: On the Programming of Computers by Means of Natural
Selection. Massachusetts Institute of Technology

MITCHELL (M.) 1996. An Introduction to Genetic Algorithms. Massachusetts Institute of Technology

PRICE (K.), STORN (R.) 1995. Differential Evolution A simple and efficient adaptive scheme for
global optimization over continuous spaces. International Computer Science Institute

SCHWARTZ (P.) 2005. Les algorithmes gntiques. Developpez.com

WHITLEY (D.) 1994. A Genetic Algorithm Tutorial. Colorado State University

WHITLEY (D.) 2001. An Overview of Evolutionary Algorithms. Colorado State University
25
7. Appendices
Appendix 1a - project proposal
Coventry University
Faculty of Engineering and Computing
Undergraduate Detail Project Specification Template

COM Detail Project Proposal Form Template 09112011 amended.docx Page 1 of 7
FEC Computing Undergraduate Detail Project Specification Form

Please type and fill in the following form and all fields. Once completed then submit a
electronic copy to Coventry University (see details at the end of this form) and to your
supervisor and 2
nd
marker. Also YOU MUST ensure the ethics procedure has been
completed , if not you will not be allowed to continue your project. The fields provided in this
template can be extended to accommodate your text.

Details

Surname
(Family Name )
Larget Forename(s)
(Given Name)
Henri

Student ID no.
3913651
Course
ECU098 BSc Informatics

Contact E-Mail
largeth@uni.coventry.ac.uk
Mobile/Contact
No.
07 774 960 086


First Supervisor Faiyaz Doctor
2
nd
Marker Brian Moore

Project Details

General Subject Area
Keywords /Topic areas listed
(A broad topic area that defines the area of project and keywords that could be used in a search
facility)
Timetable, management, web, application, easy-to-use


Project Title :
A proposed title of the project - meaningful, succinct and clear as to the project undertaken.
Timetable manager for students


Abstract/Summary :
Please provide some background about the project, topic, company, situation and overall
summary as to the nature of problem and what is required (approx 500 words)

Coventry is a university for students from everywhere. And lot of students dont
speak great English when they arrive. They get lost really fast if they miss something.
The first week, lecturers gave them a lot of information, and about the fact that they
have to create their own timetable depending courses. But information about
courses, timetables and subscriptions are in 3 separated tools. Some teacher prefer to
give information by mail, other through Moodle tool, and someone by the special
website. I was in this case, its why I choose this project.
Coventry University
Faculty of Engineering and Computing
Undergraduate Detail Project Specification Template

COM Detail Project Proposal Form Template 09112011 amended.docx Page 2 of 7

The idea of this project is to create a timetable management tool suitable to the needs
of students and lecturers. The first part of this project is to ask people what they
exactly expect from the system, and analyse user needs. It can be done by conducting
a survey, for lecturers and students prepared using Moodle tools or google
documents tools for example. This is, the more efficient way to do it, because the
survey will cover more people than by going door to door asking people.
The second step of the project is proper preparation before designing the application.
Its an important part of the application to do schematics and preparation. It is
needed to know exactly what the application needs, the database design and after
that, the implementation
The developing part is the longest part, not the hardest one, but the longest. The
application will be designed with PHP5 language in with a design pattern to keep a
code able to be reused and expanded, using a MySQL database, and JavaScript for
user interaction. The written code will be documented to help next users to continue
the project.
The application should be able to do the following tasks successfully: A Lecturer will
be able to create a course and get to see who subscribed to his course. Students will
be able to learn more about their courses. They will be able to subscribe, if there is
enough place, and check hours to avoid conflicts. The system will generate a
coloured view of a timetable. Lecturers will be able to see how many people
subscribed to the course and contact all of them by mail. It offers an easy way to
manage the Solar, the information and the timetable tools in one.
Last part is the testing and documents writing part of the project. The testing part is
one of the most important. In fact, A group of students and teachers will be assigned
to test the application. The idea of this part is to try to simulated a situation and see
how they the test-group will react, to get if the application answers to the initial
survey.
The final report will create the link between the initial survey and the test of the
application by the test-group composed by students and teachers.



Aim and Objectives
Aim what are we trying to achieve overall and the hypothesis being tested. List overall 7-
10 objectives of the project. These should be measurable where possible and will be used in
part assessment in determining the level of achievement of the project. These should reflect
the Learning outcomes of the Module.

(Can be a breakdown of what you are trying to achieve and can be representative of activities/
phases that are to be conducted in arriving at the project deliverables)


Aim
Simplify Academic life with a timetable tool created in collaboration with students
and teachers.


Hypothesis
Can we create a tool designed to fit to everyone with only consulting a sample
Coventry University
Faculty of Engineering and Computing
Undergraduate Detail Project Specification Template

COM Detail Project Proposal Form Template 09112011 amended.docx Page 3 of 7
group? How to simplify the creation of timetables for everyone with only a sample
group?


Objectives (7-10)
- Recording data, analyse and reuse it.
- Maintain System development life cycle.
- Create application
- Manage project
- Permit the application to be extended
- Test-group organisation
- Test-group analysis

Project Outcomes/ Deliverables :
Provide a list of key outcomes of the conducted project (can be deliverables/outputs for each of
the above objectives/ stages and these can be studies, reports, requirements, designs, plans,
coding, recommendations etc )

- Report: survey results and analysis
- Report: Project Management analysis
- Code: the application
- Documentation: user guide and technical guide
- Report : Test group organisation and results
- Report: final report

Motivation - Why are you interested in the project ?
Provide a reason for your interest, what greater general interest it serves (In Industry or as
part of Research) and who it could benefit (the target audience(s) that this project would be
beneficial to)


Motivation

This project is the first one I start from beginning to ending alone. When I arrived in
Coventry in September, my English were not excellent and asking people help for
timetables were complicated. I want to develop a system to help people from
everywhere to manage their timetable. I propose the project to initiate university to
change the system and get a more accessible timetable. Targets for this application
are students and teachers from Coventry university.




Client Details and extend of involvement






Coventry University
Faculty of Engineering and Computing
Undergraduate Detail Project Specification Template

COM Detail Project Proposal Form Template 09112011 amended.docx Page 4 of 7


What research methods do you intend to use to achieve your objectives / produce
your deliverables?
(Discuss the nature of investigation considering the multitude of academic and Industry
methods, with thoughts on qualitative and quantitative methods, and primary and secondary
methods)
Detail (research or procedural) methods that you will use


Research Methods

First part of the research is provided by the survey. It consists in creating a survey
using Google documents or Moodle and collect answers. The analysis of those
answers will provide help to create the application.

The second part of the research is conduced by test-group working. In fact,
application will be tested with a specific situation. The test group will simulate
actions on the application and the results will be get by survey.


Quantitative:
- The survey
- The test group survey




What primary and/or secondary data sources do you intend to use?
(for each of the above identified methods discuss the pool of sources of authentic and credible
information giving examples, e.g. consider target audiences such as profiles of general public,
company representatives, people with specialist knowledge and in specific positions, type and
title of books, journals etc)


Technologies used:
- PHP5 for server-side view
- MySQL for the database
- JavaScript, HTML and CSS for the client-side view
- Apache Server for web developing

Software used:
- Netbeans for development
- Adobe Illustrator for graphics

Data sources :
- Web
- Students and lecturers survey


Coventry University
Faculty of Engineering and Computing
Undergraduate Detail Project Specification Template

COM Detail Project Proposal Form Template 09112011 amended.docx Page 5 of 7
Project Schedule

Attach/ Embed a project schedule to this document (this can be a Gantt chart or any
form of representation MS project, excel, PowerPoint etc) which incorporates the
phases of your project and activities to undertake, duration, start and end dates, any
milestones/ deliverables and major dependencies.




Coventry University
Faculty of Engineering and Computing
Undergraduate Detail Project Specification Template

COM Detail Project Proposal Form Template 09112011 amended.docx Page 6 of 7
Return of form to Coventry University

Thank you for completing the form please ensure your
supervisor and assessor has a copy ALSO submit a paper
copy to the assessments office by the deadline as well as
submitting an electronic copy by Moodle by the deadline.
(Deadline is 28
th
November 2011)

Tariq Aslam, Undergrad project coordinator







Coventry University
Faculty of Engineering and Computing
Undergraduate Detail Project Specification Template

COM Detail Project Proposal Form Template 09112011 amended.docx Page 7 of 7
Marking sheet for detailed Project proposal, this constitutes 10% of your project
marks



Degree of challenge vs LOs Level of completeness
>70% - clearly considered project that fully
satisfies the Learning outcomes for which
there is a succinct and focused aim with an
associated project question/hypothesis
that is well above norm for final-year
undergraduate project level (approaching
Masters level for >80%);
-Project involves improving or developing
a complex programme /tool/ application
or the enhancement of a
theory/methodology or their application
in new settings.
Demonstration of innovation / creativity
- All fields completed demonstrating a clear
blueprint for the research process and includes
the necessary information with respect to the
research dilemma
- research methods are well-considered with
clear reasoning for choice of those methods
over others;
-Appropriate level of detail in project schedule
including realistic timescales that will allow
student to successfully manage their own
project and strongly linked to objectives,
deliverables and research methods;
Threshold
(40%)
-Fairly standard project with some
consideration to a greater context.
-idea which lacks substance, context and
scope for depth of analysis, but which is
marginally acceptable against a threshold
for final-year undergraduate projects;

- Completion of sections though very minimal
with some cohesiveness and contextualisation
-Sections demonstrating some understanding
of the research process involved which loosely
links with idea outlined (aim, key
question/hypothesis, objectives);
- Research methods are discussed but are
obvious with little consideration as to whether
they are the most appropriate and lack
refinement and further detail.
- Not all major tasks identified in project
schedule with inappropriate timings (overly
optimistic or generic);

MAX MARKS
Degree of challenge and viability of project with
respect to learning outcomes (see Below)
5
Level of completeness of proposal and all fields
completed with project schedule
5
26
Appendix 1b - project proposal marking


Marking sheet for detailed Project proposal for UG Dept of computing final year



Degree of challenge vs LOs Level of completeness
>70% - clearly considered project that fully
satisfies the Learning outcomes for which
there is a succinct and focused aim with an
associated project question/hypothesis
that is well above norm for final-year
undergraduate project level (approaching
Masters level for >80%);
-Project involves improving or developing
a complex programme /tool/ application
or the enhancement of a
theory/methodology or their application
in new settings.
Demonstration of innovation / creativity
- All fields completed demonstrating a clear
blueprint for the research process and includes
the necessary information with respect to the
research dilemma
- research methods are well-considered with
clear reasoning for choice of those methods
over others;
-Appropriate level of detail in project schedule
including realistic timescales that will allow
student to successfully manage their own
project and strongly linked to objectives,
deliverables and research methods;
Threshold
(40%)
-Fairly standard project with some
consideration to a greater context.
-idea which lacks substance, context and
scope for depth of analysis, but which is
marginally acceptable against a threshold
for final-year undergraduate projects;

- Completion of sections though very minimal
with some cohesiveness and contextualisation
-Sections demonstrating some understanding
of the research process involved which loosely
links with idea outlined (aim, key
question/hypothesis, objectives);
- Research methods are discussed but are
obvious with little consideration as to whether
they are the most appropriate and lack
refinement and further detail.
- Not all major tasks identified in project
schedule with inappropriate timings (overly
optimistic or generic);


Learning Outcomes
1. Devise, perform and take responsibility for a self-managed project within an appropriate ethical
framework.
2. Research and compile information relevant to the specialist subject area in which the project is
based, maintaining a suitable log for recording information obtained and progress/developments in
the project.
3. Undertake analysis, design, practical work and testing as required to achieve the agreed
objectives of the project.
4. Critically evaluate the achievements of a project, draw appropriate conclusions and suggest areas
for further work.
5. Communicate the work done, achievements attained and conclusions reached through both oral
and written means

MAX MARKS
Degree of challenge and viability of project with
respect to learning outcomes (see Below)
5
Level of completeness of proposal and all fields
completed with project schedule
5

Coursework Assessment Feedback form for UG project Proposal specification
Surname
(Family Name )
LARGET Forename(s)
(Given Name)
HENRI

Student ID no.
3913651
Course
BSc Informatics

Module Code
300COM 303COM

Project Proposal specification
(10% of module mark)
Please provide Feedback Marks
Degree Of
challenge (50%)


Reasonable for UG project however addition of a research and
investigative element would improve the project.



3/5

Level/ Degree
of completeness
of proposal
(50%)


All sections completed but needs better clarity and definitions of
research methods functional objectives of the system with more
specific objects.



3/5

Key Areas of
strength of
project
/proposal

Practical useful project to serve students and lectures at university. The project
also has potential to address research questions on timetabling and scheduling
issues.





Key areas of
improvement of
project
/proposal

Project could be extended to include timetable optimisation based on
investigation and possible application of constraint satisfaction algorithms.
Hypothesis/ project question seems a little vague and not fully considered,
needs to be a more clear defining possibly a test question that the system
would answer.
Project objects are not specific enough need to be more strongly linked to aims.
Motivation also needs to be more specific specifying what general and research
purposes this project would serve.
What software design mythology is used.




Mark by supervisor :
6/10
Marker : Faiyaz
Doctor
Final Mark :
Moderated Mark (if
applicable)
Moderator : Date :

/10
Module Leader Signature



27
Appendix 2 - PowerPoint presentation

!"#$%#&!
&
3RD YEAR
PROJECT
HENRI LARGET
PRESENTATION ON 5 APRIL 2012
COVENTRY UNIVERSITY UNITED KINGDOM
THE PROJECT
What is a good timetable?
How to select a solution between a huge population of
Solutions?


Genetic Algorithms used in Timetable
Management
AIMS AND
OBJECTIVES
Aims :
Understand the difficulty of timetable management
Starting on a solution : Genetic Algorithms
Get a better understanding of genetic algorithms
Create a list of Genetic sontraints
Design a prototype of Genetic Algorithm for timetable

PROJECT MANAGEMENT :
STEPS OF THE PROJECT
Get a better understanding of timetable management and
genetic Algorithms
Define a encoding system
Define hard constraints and soft constraints of the
timetable
Develop a prototype of the algorithm
Tests phases with the constraints
PRIMARY RESEARCH APPROACH
TIMETABLE MANAGEMENT
Some Problems with timetable management :
Hard to calculate because of the constraints
Hard to manually calculate when the problem becomes
bigger

Verify integrity
of population
Evaluate
Population
Select part of the
population
CrossOver
Cross the selected
population
Mutation
Change content of
the chromosomes
What is a genetic algorithm ?

How does it work?
PRIMARY RESEARCH APPROACH
GENETIC ALGORITHMS
!"#$%#&!
!
DEMONSTRATION
RESULTS (AFTER ONLY 20
ROUNDS)
CONCLUSION
Timetable problems
A lot of human constraints
Genetic Algorithms for timetable
Powerful for the problem
But really slow

BIBLIOGRAPHY
Leon Bambrick, Lecture Timetabling Using Genetic Algorithms - University of Queensland
David Beasley, David R. Bull, Ralph R. Martin, An Overview of Genetic Algorithms -
1993
John R. Koza, Genetic Programming as a Means for programming computers by natural
Selection Stanford University
Pierre Schwartz les Algorithmes gntiques 2005
Mitchell Melanie An Introduction to Genetic Algorithms 1996 - ISBN 0!262!13316!4
(HB), 0!262!63185!7 (PB)

28
Appendix 3 - class diagram

G
e
n
e
t
i
c
A
l
g
o
r
i
t
h
m
p
o
p
u
l
a
t
i
o
n

:

a
r
r
a
y
p
r
e
v
i
o
u
s
S
c
o
r
e

:

i
n
t
e
g
e
r
e
l
i
t
e
_
s
i
z
e

:

i
n
t
e
g
e
r
a
l
g
o
r
i
t
h
m
(
r
o
u
n
d
)
i
n
i
t
i
a
t
e
P
o
p
u
l
a
t
i
o
n
(
n
u
m
b
e
r
O
f
U
n
i
t
s
)
o
r
d
e
r
B
y
C
o
n
s
t
r
a
i
n
t
s
(
)
s
e
l
e
c
t
T
h
e
B
e
s
t
s
(
)
c
r
o
s
s
o
v
e
r
(
)
m
u
t
a
t
e
(
)
C
h
r
o
m
o
s
o
m
e
g
e
n
e
s

:

a
r
r
a
y
r
o
o
m
C
o
n
s
t
r
a
i
n
t

:

R
o
o
m
C
o
n
s
t
r
a
i
n
t
c
o
u
r
s
e
C
o
n
s
t
r
a
i
n
t

:

C
o
u
r
s
e
C
o
n
s
t
r
a
i
n
t
a
d
d
G
e
n
e
(
g
e
n
e
)
r
a
n
d
o
m
i
z
e
(
)
r
a
n
d
o
m
i
z
e
W
i
t
h
M
u
t
a
t
i
o
n
(
)
r
e
s
e
t
C
o
n
s
t
r
a
i
n
t
s
(
)
g
e
t
P
o
i
n
t
s
(
)
i
s
C
o
r
r
e
c
t
(
)
G
e
n
e
d
a
y

:

i
n
t
e
g
e
r
h
o
u
r

:

i
n
t
e
g
e
r
r
o
o
m

:

i
n
t
e
g
e
r
m
o
d
u
l
e

:

i
n
t
e
g
e
r
e
n
c
o
d
e
(
v
a
l
u
e
,
s
i
z
e
)
d
e
c
o
d
e
(
b
i
n
a
r
y
)
C
o
n
s
t
r
a
i
n
t
D
A
Y
_
M
I
N

:

I
n
t
e
g
e
r
D
A
Y
_
M
A
X

:

I
n
t
e
g
e
r
H
O
U
R
_
M
I
N

:

i
n
t
e
g
e
r
H
O
U
R
_
M
A
X

:

I
n
t
e
g
e
r
C
O
U
R
S
E
_
M
I
N

:

I
n
t
e
g
e
r
C
O
U
R
S
E
_
M
A
X

:

I
n
t
e
g
e
r
H
O
U
R
_
L
I
M
I
T
_
M
I
N

:

I
n
t
e
g
e
r
H
O
U
R
_
L
I
M
I
T
_
M
A
X

:

I
n
t
e
g
e
r
N
U
M
B
E
R
_
F
R
E
E
_
D
A
Y
S

:

I
n
t
e
g
e
r
N
U
M
B
E
R
_
H
O
U
R
S
_
M
A
X
_
B
Y
_
D
A
Y

:

I
n
t
e
g
e
r
N
U
M
B
E
R
_
S
U
C
C
E
S
S
I
V
E
_
H
O
U
R
S

:

I
n
t
e
g
e
r
T
i
m
e
t
a
b
l
e
m
a
t
r
i
x

:

a
r
r
a
y
i
n
i
t
i
a
l
i
z
e
(
)
i
s
B
u
s
y
(
i
d
,
d
a
y
,
h
o
u
r
,
d
u
r
a
t
i
o
n
)
s
e
t
B
u
s
y
(
i
d
,
d
a
y
,
h
o
u
r
,
d
u
r
a
t
i
o
n
)
C
o
u
r
s
e
s
g
e
t
E
a
r
l
i
s
e
t
H
o
u
r
s
(
c
o
u
r
s
e
,
d
a
y
)
g
e
t
L
a
t
e
s
t
H
o
u
r
s
(
c
o
u
r
s
e
,
d
a
y
)
g
e
t
N
u
m
b
e
r
O
f
F
r
e
e
D
a
y
s
U
s
i
n
g
C
o
u
r
s
e
s
(
c
o
u
r
s
e
)
g
e
t
N
u
m
b
e
r
O
f
H
o
u
r
s
A
D
a
y
(
c
o
u
r
s
e
,
d
a
y
)
g
e
t
N
u
m
b
e
r
O
f
H
o
u
r
s
C
o
n
s
e
c
u
t
i
v
e
s
(
c
o
u
r
s
e
,
d
a
y
)
c
h
e
c
k
A
n
d
A
d
d
(
c
o
u
r
s
e
,
d
a
y
,
h
o
u
r
,
d
u
r
a
t
i
o
n
)
R
o
o
m
s
r
o
o
m
s

:

a
r
r
a
y
g
e
t
R
o
o
m
(
s
i
z
e
,
d
a
y
,
h
o
u
r
,
d
u
r
a
t
i
o
n
,
m
o
d
u
l
e
T
y
p
e
)
M
o
d
u
l
e
s
m
o
d
u
l
e
s

:

A
r
r
a
y
i
n
i
t
i
a
l
i
z
e
(
)
M
o
d
u
l
e
c
o
u
r
s
e
I
D

:

i
n
t
m
o
d
u
l
e
I
D

:

S
t
r
i
n
g
t
i
m
e
D
u
r
a
t
i
o
n

:

i
n
t
r
o
o
m
C
a
p
a
c
i
t
y

:

i
n
t
m
o
d
u
l
e
T
y
p
e

:

i
n
t
r
o
o
m
T
y
p
e

:

i
n
t
29
Appendix 4 - Prototype results
Report 1
Initial population: 300 Chromosomes
Number of rounds: 20

Generation 0:
Score: 491

Generation 20:
Score: 511






Report 2
Initial population: 300 Chromosomes
Number of rounds: 20

Generation 0:
Score:504


Generation 20:
Score: 518

You might also like