Decimal Encoding GA Used To Solve Timetabling Problem
Decimal Encoding GA Used To Solve Timetabling Problem
Problem
Jun-Hui LIU Na LI
Studies Affairs Office Department of Information Engineering
Zhengzhou College of Animal Husbandry Engineering Zhengzhou College of Animal Husbandry Engineering
Henan Zhengzhou, China Henan Zhengzhou, China
E-mail: [email protected] E-mail: [email protected]
Abstract—Timetabling Problem (TP) relates to quality of algorithms can only solve the problem in a certain direction
education and the utilization of teaching resources with the rather than in many directions simultaneously.
further reform in teaching and growing expansion of Due to GA only needs the target function and the
recruitment scale in colleges and universities. Firstly, TP was corresponding fitness function in the evolutionary process,
detailedly analyzed, includes: timetabling objective, main its whole search strategy and optimization methods are
influencing factors, constraint conditions and solving target. independent on gradient information or other auxiliary
And then, an optimized mathematical model of TP was knowledge. Furthermore, GA does not depend on the
established, and the framework structure to solve TP was specific problem areas and has strong robustness[4]. So, this
founded. Subsequently, according to characteristics of TP, GA paper uses GA to solve TP.
was introduced, varieties of improved schemes were designed,
which include: decimal encoding scheme, initial population II. TIMETABLING PROBLEM
design scheme, fitness function design scheme, adaptive
crossover probability and adaptive mutation probability A. Timetabling Objective
design scheme. Simulation results show that the proposed GA
can satisfy multiple constraint conditions and resolve TP more TP is a problem of resources allocation, which means
effectively. that some quantitative resources should be allocated to each
demand-individual under some constraint conditions. Its
Keywords- TP; GA; Decimal Encoding main objective, according to the teaching plan, is to arrange
classrooms, teachers, classes, and courses in a particular
I. INTRODUCTION time of a week without time conflict[5].
Due to the further reform in teaching and growing B. Main Influence Factors
expansion of recruitment scale, the scale of students and the
number of courses are rising rapidly, so that TP in colleges There are many conflicts in TP, and the main influence
and universities has become more important and factors are as follows [6]:
complicated, which makes TP to be solved urgently [1].As a Time factor: We usually calculate course class time
result, colleges and universities under the background of weekly and course class time is less than 7 days in a weak.
information explosion should try its best to find out an Each day is divided as three time periods: morning,
effective solution to TP. However, TP is a combination afternoon, and night. And there are class sessions in each
optimization problem with multiple constraint conditions time period. And the smallest unit of class session is class
and goals, which has been proved a NP-problem [2]. At hour, a course class time is two class hours.
present, people have presented many methods to solve TP, Course factor: Each course has a course code, a course
such as the branch and bound algorithm, the packet name, and faculty names. Meanwhile, each course has a
optimized decision-making algorithm, the FP-growth teaching plan, for example, when to start the course, when
algorithm [3], and so on. Although these algorithms can to end it, and how many class hours for every week.
provide enlightenment to future researchers, they do have Classroom factor: each classroom has a classroom
the following weaknesses:(1)Because the heuristic code, classroom number, and classroom name. Each
information during searching process depends on practical classroom can't take any more than a course in a course
situation, the solution to TP can only solve some individual class time, and classroom capacity should be greater than or
problem rather than become the universe effective timetable equal to the number of students.
solution.(2)The expert system technique may be good at Class factor: each class has a class code, a class name,
effectively managing rules information of timetabling, and can only have a course in a course class time.
however, it cannot acquire the associative rules of all Teacher factor: each teacher has a teacher code, a
elements in the process of timetabling, and no good result, teacher name, and can only lecture a course in a course
either. (3)There are less schedule quality criteria, and the class time.
___________________________________
978-1-4244-8625-0/11/$26.00 ©2011 IEEE
C. Constraint Conditions B. Hard Constraint Conditions
The constraint conditions of TP can be divided into A class cannot have more than one course in a course
two categories [7]: hard constraint and soft constraint. The class time, which
hard constraint, which is the most basic conditions in all G L R
means ¦¦¦ cc g g ll rr tt d 1 , c 1, 2, , C ; t 1, 2, , T .If class cc has
kinds of timetabling models, refers to the impossible g 1 l 1 r 1
situation appeared in space-time concept for students, course ll lectured by teacher g g in classroom rr at the course
teachers and classrooms. The soft constraint, which is
related to the practical situation, refers to how to improve class time tt ,then cc g g ll rr tt =1. Else, cc g g ll rr tt =0.
the timetabling model to a certain degree. In another word, A teacher cannot lecture more than one course in a
C L R
the hard constraint is a measurement criterion whether the course class time, which means ¦¦¦ cc g g ll rr tt d 1 ˈ
timetabling scheme is feasible, while the soft constraint is c 1 l 1 r 1
an evaluation criterion whether the timetabling scheme is g 1, 2, , G; t 1, 2, , T . If teacher g g lecture s course ll to
better. class cc in classroom rr at the course class time tt , then
D. Solving Target cc g g ll rr tt =1. Else, cc g g ll rr tt =0.
TP is a combinatorial optimization problem with many A classroom cannot have more than one course in a
constraints and objectives. Besides, combinatorial C G L
optimization problem needs relative constraint conditions to course class time, which means ¦¦¦ cc g g ll rr tt d 1 ˈ
c 1 g 1 l 1
figure out the optimum solution [8]. However, for some r 1, 2, , R; t 1, 2, , T . If Classroom rr will be taken for class
timetabling problems which belong to Humanities category,
it is impossible to find sufficient constraint conditions. Also, cc to have course ll by teacher g g at the course class time tt ,
good timetabling schemes and bad timetabling schemes then cc g g ll rr tt =1 .Else, cc g g ll rr tt =0 .
have been integrated under such limited constraint The capacity xr of allocated classroom rr should be
conditions. Thus, we will obtain a set of feasible solutions.
For this reason, this paper will give up searching for greater than or equal to the number of students kc in
“absolute optimum” solution, and regards the solution class cc ( xr t kc ).
which meet with the hard constraint and the requirement of
“reasonable, practical, and special” as a feasible and C. Soft Constraint Conditions
relatively dominant solution. The soft constraint conditions of this model can be
described as follows:
III. OPTIMIZED MATHEMATICAL MODEL OF TP (1)Since the teaching efficiency is closed to the course
class time, hence the more important courses should be
A. Description on the Model arranged at better course class time.
Assumption: C stands for the number of classes, G (2) Satisfying teacher’s demand of course class time
stands for the number of teachers, L stands for the number and classroom.
of courses, R stands for the number of classrooms, T stands (3)In order to achieve excellent teaching effect, the
for the number of course class time. The model can be courses which has more than 4 class hours in a week should
described specifically as follows: be taken at least every two days.
Set C= ^c1 , c2 , , cc , , cC ` is the set of classes, the number (4)The resource utilization problem. A good
set of students in each class is ^k1 , k2 , , kc , , kC ` . timetabling result can save a lot of resources.
Set G= ^ g1 , g 2 , , g g , , gG ` is the set of teachers, the D. The Basic Framework to Solve TP
number set of courses which each teacher lectures According to the established timetabling goal and
is ^ y1 , y2 , , yg , , yG ` . mathematical model, we separate the solution process of TP
into two parts: part 1 is to transform the unordered initial
Set L= ^l1 , l2 , , ll , , lL ` is the set of courses, each course
data (teaching tasks) into the ordered final data table by
matches a teacher, and the number set of classes for each means of a initial population generating algorithm
course is ^ z1 , z2 , , z z , , zZ ` . according to the teaching program; part 2 is to globally
Set R= ^r1 , r2 , , rr , , rR ` is the set of classrooms, the optimize the random and feasible timetabling scheme by
number set of students which each classroom can contain means of GA.
is ^ x1 , x2 , , xr ,..., xR ` .
IV. PRESENTED DESIGN SCHEME OF GA
Set T= ^t1 , t2 , , tt , , tT ` is the set of course class time.
The Cartesian product for a pair of time-classroom is˖ A. Decimal Encoding Scheme
M=T u R= t1 ,r1 , t2 ,r2 ,, tt ,rr , tT ,rR . At that time, TP is The classical binary coding in GA can not reflect the
transferred to a problem how to figure out a proper pair of actual character of TP and the proposed mathematical
time-classroom for a certain course. model. So, the author presented a decimal encoding scheme:
Table.1 Decimal Encoding Scheme teaching effect coefficient for each course which is
Teacher ID Course ID Class ID Classroom ID Time ID arranged every i day. Here, i is endowed with value of 1, 2,
Each chromosome adopts decimal encoding and 3, and 4. The optimization object is:
consists of teacher ID, course ID, class ID, classroom ID max f 3 ¦ E i u H j (3)
and time ID, for a total of 20. For example, if 0050 is a There, Ei has the same meaning of equation (1).
teacher IDˈ7003 is a course IDˈ2004 is a class ID, 6423 (4)The utilization ratio of resources is one of the most
is a classroom ID and 2241 is a time ID, then the important standards to measure whether the course
corresponding chromosome is 20047003005064232241. It arrangement is a good one or not. A good timetabling
indicates the 0050 teacher lectures the 7003 course for the scheme can save a lot of resources. In a course class time, if
2004 class in the 6423 classroom at the second teaching the ratio value of students number ( kc )/classroom
units of tuesday and the first teaching units of thursday.
According to the above encoding, crossover operation, capacity( rr ) for class cc is bigger, then the utilization ratio of
which is implemented to the last 8 bits of two resources is higher. The maximum value is 1, which means
chromosomes, won't affect the course which each teacher there are no more or less seats in the classroom for all the
lecture, also won't cause the problem that a teacher' kc
timetable contains other teachers' course schedule or the
students. The optimization object is: max f 4 ¦r (4)
r
problem that chromosome structure becomes unreasonable To sum up, the fitness function for TP is achieved by
after each generation evolution. weighting each optimization goal value. Hence, we propose
4
B. Fitness Function Design Scheme the fitness function: F ¦T u f
i 1
i i (5)
TP should not only meet the hard Constraint There, Ti (i 1, 2,3, 4) stands for the importance degree of
conditions which mean no conflict in resource distribution,
but also meet the soft Constraint conditions which means each optimization goal, which can be automatically
optimal resource distribution. GA obtains next population assigned by manager. In this paper, we assign it with the
by means of individual fitness, so the fitness function value of 3ˈ1ˈ2ˈand 4.
directly influences the convergence rate and determines C. Initial Population Generating Scheme
whether we can find the optimal solution. This paper is
aimed at solving TP with many soft constraints, that is to The initial population is generated by random
say, with many optimal goals, thus we adopt the individual searching generally, but the fitness of initial population is
fitness function which integrates the multi-goals lower[9]. Thus, this paper introduces a heuristic algorithm to
optimization with fitness function: generate initial population, which will greatly improve the
(1)The more important course should be arranged at fitness of initial population. At the same time, with the help
the course class time with better teaching effect. Here, we of free space random search and scheduling algorithm, the
use D i (i 1, 2,3, 4,5) to describe course class time, conflict can be eliminated. Fig.1 is the algorithm flow.
where D i 1(i 1,3,5) means the first, third and fifth course D. Adaptive Crossover Probability and Adaptive Mutation
class time have better teaching effect; D i 0(i 2, 4) means Probability Design Scheme
the second and forth course class time have worse teaching The crossover probabilities pc and mutation
effect. What’s more, we use E j (j=1, 2, 3, 4) to indicate the probability pm can greatly influence the convergence
weight which refers to importance degree of each course. velocity and the solution quality in GA. The main design
Here, we classify courses into 4 categories: elective courses, idea in this paper is as follow: The optimist individual of
basic courses, professional courses, and degree courses. current generation does not participate in crossover
Meanwhile, the 4 categories are endowed with the weight operation and variation operation, while the better
of 1, 2, 3, and 4. Therefore, optimization object can be individual of current generation actively participates in
described as: max f1 ¦ D i u E j (1) crossover operation and variation operation. This method
can speed up the searching efficiency and avoid obtaining
(2)Teachers’ satisfaction on course class time and
local optimal solution. The formulation can be described as
classroom. Setting title coefficients for teachers, which can
follows:
be described as Fi (i=1, 2, 3, 4). Here, 1, 2, 3, and 4
S f max f c
separately stands for teaching assistant, lecturer, assistant °a1 sin( 2 u f f ), if f c t f avg
pc ® max avg (6)
professor, and professor. The satisfaction degree of each °a , if f f
teacher who gives lessons at given course class time can be ¯ 2 c avg
(3)The courses with many class hours ( nVKRXOGEH There, a1 , a2 , a3 , a4 are random numbers between 0 to
arranged at least every other day in order to guarantee 1, f max refers to the antibody fitness of optimist antibody in
teaching effect. Meanwhile, H i i 1, 2,3, 4 represents the
current population; f avg stands for the average fitness of B. Experiment Parameters
current population, f c stands for the larger fitness of the Crossover probability and mutation probability are
antibody which participates in crossover operation, f m is the generated adaptively, other parameters and their meanings
are as follows:
fitness of variation antibody. (1) POPSize stands for the scale of population. If
POPSize is too small, then the goal value will wave up and
start
down violently. If POPSize is too big, then though goal
value can be obtained, the convergence time is too long,
Initialize each set,
more memory will be consumed. There are 125 classes in
i=1,j=1,k=1 the experiment, thus we endow POPSize with 150.
(2)MAXGen stands for the maximum iterating times.
If the MAXGen is too small, then all goals will not
converge and part of them will have the trend of decrease; if
i<= number of ? it is too large, the global optimal solution can not be
teacher No achieved in spite of convergence. Here, we endow
Yes MAXGen with 1000.
Teacher i:g i C. Experimental Results
In the experiment, we compare the method in literature
[10] (The method is called IGA) with the proposed method
number of No
j<= ˛ in this paper (The method is called DEGA).Experiments
time slice
were done 10 times. When every 100 evolution generations
Yes were finished, the optimal fitness of population and
consumed time were recorded. We made the average fitness
Time slice j: t j and average consumed time as the final result. As shown in
fig.2and fig.3.
45
No DEGA
gi can give lessons at t j ˛ 40 IGA
35
Y Average Fitness
Yes
No 30
number of
K<= ˛
classroom 25
Yes 20
15
Classroom k: rk
10
5
No
gi can give lessons in r k ˛
100 200 300 400 500 600 700 800 900 1000
Yes X Evolution Generations
Fig.2Experimental results of average fitness
1000
(g i ,t j ,rk ) DEGA
IGA
900
Y Average Consumed Time/s
800
Stop
700
Fig.1 The Generation Algorithm of Initial Population
600
V. SIMULATION EXPERIMENT 500
From Fig.2 and Fig.3, we can see that the method in This article is supported by a grant from the Henan
this paper is better than the method in literature [10] on the Science and Technology Department major Projects in
average fitness and the average consumed time. Hence, we Henan Province of China (No: 112102210395).
can say that the total effect of the proposed method on
solving TP is better than the other one. REFERENCES
Table 3Comparison of Timetabling Results (1) [1] A.O.Adewumi, B.A.Sawyerr and A.M. Montaz, “A heuristic solution
Method Class days for major Class interval Average class to the university timetabling problem”, Engineering Computations,
courses each week for a course sessions everyday Vol.26, no.8,pp.972-984, 2009.
IGA 2~2.5days 1~1.4days 4~8 sessions [2] Shi, Juan, “Research on application of IGA (immune genetic
DEGA 2.4~2.6days 1.2~1.5days 4~6sessions algorithm) to the solution of course-timetabling problem ”,the 4th
Form table 3, we can see that the not only the class International Conference on Computer Science and Education, China:
days for major courses each week, but also the class interval Nanning, pp.1109-1115 , 2009
for a course and average class sessions for each student [3] C.H.Aladag, G. Hocaoglu and M.A.Basaran,“The effect of
every day are improved greatly. neighborhood structures on tabu search algorithm in solving course
timetabling problem”,Expert Systems with Applications, Vol.36,
Table 4 Comparison of Timetabling Results (2)
no.10,pp. 12349-12356, 2009
Method Total Total Total Total
utilization number of satisfaction conflict rate [4] B.Detienne, L.Péridy and É.Pinson, “Cut generation for an employee
rate of lost courses degree of of timetabling problem”, European Journal of Operational Research,
classrooms teachers Timetabling vol.193,no.3,pp.1178-1184,2009.
IGA 86% 17 84% 15% [5] N. Pillay, W. Banzhaf, “A study of heuristic combinations for hyper-
DEGA 95% 3 95% 2% heuristic systems for the uncapacitated examination timetabling
From table 4, we can see the method in this paper gain problem ”,European Journal of Operational
great improvement on the total utilization rate of Research,vol.197,no.2,pp.482-491,2009.
classrooms, total number of lost courses, total satisfaction [6] Yusin Lee, Chuen-Yih Chen, “A heuristic for the train pathing and
timetabling problem”,Transportation Research Part B:
degree of teachers, and total conflict rate of Timetabling. Methodological, vol.43,no.9,pp.837-851,2009
VI. CONCLUSION [7] Defu Zhang, Yongkai Liu and R.M.Hallah, “A simulated annealing
with a new neighborhood structure based algorithm for high school
In this paper, we established an optimized mathematic timetabling problems ”,European Journal of Operational Research,
model for TP and offered a solution framework on the basis vol.203,no.3,pp.550-558,2010
of deeply analyzing TP. What’s more, we introduced [8] A.Anmar,A.Masr, “Multi-neighbourhood Particle collision algorithm
Genetic Algorithm and designed relevant improved scheme for solving course timetabling problems ”,the 2nd Conference on
Data Mining and Optimization, Selangor: Malaysia, pp.21-27,2009
according to characteristics of TP. Finally, the results of
[9] O. Guyon, P. Lemaire and É. Pinson,“ Cut generation for an
simulation experiment can show that the Method in this integrated employee timetabling and production scheduling
paper can solve TP effectively. However, total number of problem”,European Journal of Operational Research,
lost courses and total conflict rate of Timetabling need to be vol.201,no.2,pp.557-567,2009
further improved, this is also the research work which [10] N.Pillay, W. Banzhaf,“An informed genetic algorithm for the
author will conduct. examination timetabling problem”, Applied Soft Computing,
vol.10,no.2,pp.457-467,2010
ACKNOWLEDGMENTS