You are on page 1of 6




A Survey of University Courses Timetable Scheduling Problem

Addin Osman, Adlan Balola, Anwar Ali Yahya and Yahya Ali Abdelrahman

Faculty of Computer Science and Information Systems, Najran University, Saudi Arabia
AbstractThis paper presents the mathematical definition of university courses timetable scheduling problem. The paper only shows the courses timetable. The genetic algorithm has been defined and its implementation for solving university courses timetable scheduling problem has been presented. A summary of some works related to the implementation of genetic algorithms in university courses timetable scheduling problems are presented. Index Termscourses, genetic algorithm, operators scheduling, timetable, university.


IMETABLE scheduling (TS) problem is a challenging and complex task that often encountered by various institutions and organizations, such as education, transportation, health care, sport, and manufacturing. It can be defined as, the optimization of allocation of given activities, actions or events to a set of objects in space-time matrix (search space-matrix) to satisfy a set of desirable constraints [Norberciak, 2006, Yeasin and Khader, 2005]. TS problems are tedious jobs that often encountered every semester in all universities. Some of these problems are University Lectures Timetable Scheduling (ULTS), exam timetable scheduling, lab duties scheduling, study plan scheduling, etc. Among these problems, the U LTS is considered as one of the most complex scheduling problems. The main issues in ULTS problem include the assignment of objects (e.g. lecturers, student groups, lecture rooms and labs) to a set of activities (e.g. weekly lectures, time slots, and subjects or courses). Figure 1 demonstrates the relation between activities and objects in a ULTS problem. In the figure, students are required to register in subjects or courses which, are divided into sections. A course is divided into sections depending on the number of students enrolled in the course and the upper-bound of a section in the course. The upper-bound is the maximum number of students to attend the course together in a class or lab. The sections are assigned for lectures, the sections are distributed in classes and every class will be assigned a time slot and a lecture room or lab.


Figure 1: Relations between Activities and Objects in Timetable.

ULTS problem has been proved to be an N complete problem [Even et al., 1976, Karp, 1972]. Therefore, it is harder to be solved by deterministic algorithms such as those used to solve classical problems. Nevertheless, ULTS can be solved by an exhaustive search algorithm. Unfortunately, when the size of input grows, the running time of the exhaustive search algorithm grows exponentially. Some universities, like Najran University, schedule the timetable prior to the students enrollment in the semester. The preparation of the schedule is based on the student results of the previous semesters and the courses to be delivered in the due semester. In this case, the timetable will be prepared mainly de- pending on the students who are successfully following the course plan of the department. The courses are scheduled such that the courses of semester 3 are not contradicting with the courses of semester 4, semester 5 with semester 6, and semester 7 with semester 8. Some universities schedule the timetable after the students enrollment in the due semester and specifying their courses.

2011 Journal of Computing Press, NY, USA, ISSN 2151-9617



When scheduling a timetable for a university, many factors should be taken into consideration. These factors can be classified as intra- and inter- timetable factors. Intra-timetable factors: Indicate the actions within the same department, like timetable actions concerning subjects, sections, lecturers, classes, student, lecturers, labs, assignments, and exams. Inter-timetable factors: Indicate the actions between two or more faculties or departments, like lecturers that are delivering courses in more than one faculty or department, students who are registering courses in more than one faculty or department, classes and labs that are shared between more than one faculty, and courses which are offered for more than one department or faculty. All these factors together can be defined as constraints of the timetable, which most of them should be satisfied and not violated in the timetable. It is very important to define these factors in order to schedule any timetable.

Prerequisite Subject: A subject or a set of conditions which must be met before enrollment in a subject. Definition 6. CRE = {{cre i,1 , cre i,2 } SUB SUB : 1 i q, q = number of corequisite course groups, cre i,1 , cre i,2 represents two corequisite subjects.} Corequisite Subjects are subjects that must be undertaken together in the same semester. Definition 7. C OR = {{cor 1 , cor 2 , . . . , cor p } : cor i

SUB, 1 i p, p = number of core subjects in the due semester.} Core Subjects: Subjects which are mandatory in order to complete the prescribed requirements of a program. Definition 8. LER = {ler 1 , ler 2 , . . . , ler n }, represents n lecturers. ler LER sec sec i,j , 1 i s, 1 j c i . A lecturer is a s member who delivers at least one section during the due semester of the timetable. Definition 9. LRO = {lro 1 , lro 2 , . . . , lro r }, represents r



The definitions shown in this section summarizes some of the most important terms for formulating any ULTS problem. The following conventions are used in the paper: Z+ denotes the set of all positive integer numbers. The variables are denoted by three capital letters, e.g. SUB to represent subject. The assignments of the variables are denoted by three small letters sub i . The functions are denoted as F R : F R where F R is a function with two domains F and R that maps elements of F to elements of R (F R is a function from F to R). If the function returns a single value then it will be denoted by lower case (e. g. f R ) otherwise upper case. Definition 1. SUB = {sub 1 , sub 2 , . . . , sub s }, represents a number of s subjects which are awarded during the due semester of the timetable. Definition 2. SEC = {{sec i,1 , sec i,2 , . . . , sec i,ci } : 1

lecture rooms. A lecture room is a room available for delivering lectures. Definition 10. LAB = {lab 1 , lab 2 ,,lab n }, represent b labs. A lab is a room or building equipped for doing practical work of a subject. Definition 11. LOC = {LRO LAB}, represents a set which contains the lecture rooms and labs. Definition 12. HCO = {hco 1 , hco 2 , . . . , hco h }, represents a number of h hard constraints. Hard constraints represent absolute limitations imposed on the timetable scheduling that should not be violated (elaborated more on Section 3). Definition 13. SCO = {sco 1 , sco 2 , . . . , sco o }, represents a number of o soft constraints. Soft constraints are constraints which hold true unless otherwise contradicted by another constraint (elaborated more on Section 3). Definition 14. DAY = {Saturday, Sunday, Monday, Tuesday, Wednesday, Thursday, Friday}\ WeekEnds. Represents the days within a week (excluded the week- end days) during which the lectures will be delivered. Definition 15. TIM = {00:00, 00:01, 00:002. . .00:59, 01:00. . . 24:00} This set represents times, e.g. 13:00. Definition 16. LTS = {{slt elt} : slt T I M, elt TIM }, represents legal time slots for lectures such that slt is the start of the legal time slot and elt represents the end of the legal time slot. And {slt elt} represents the whole time range between slt and elt. day ELT : DAY ELT , where day ELT (elt) represents the day of a legal time elt E LT . Definition17. ET S = {{set eet} : set T I M, eet TIM}, represents illegal time slots for lectures such that set is the start of the illegal time slot and eet the end of the illegal time slot. And {set eet} represents the whole time range between set and eet. day ETS : DAY ETS, where dayETS (ets) represents the day of an illegal time ets ETS . Definition18. The lecture is represented by a function of 7-tuples LEC = <LEC, SEC, STG, LER, LOC, DAY, STL>, where: sec LEC : LEC SEC, where sec LEC (sec), denotes the section sec and SEC i

A subject will contain more than one section if the number of students attending the subject exceeds the capacity of the lecture room (maximum number of students allowed to be in a subjects class). Definition 3. ST U = {stu 1 , stu 2 , . . . , stu m }: m is the number of students enrolled for the semester. Definition 4. STG = {stg 1 , stg 2 , . . . , stg g }: g is the number of student groups, stg i STU, 1 i g, stu stg i

i s, ci is the number of sections in subject i, and sec i,j , 1 i s, and 1 j ci sub i where sec i,j sub i }.

sec sec i,j , 1 i s, 1 j ci . Definition 5. PRR = {{prr i,1 , prr i,2 } SUB SUB, prr i,1 = prr i,2 : 1 i a, a = number of prerequisite subject groups, prr i,1 is a prerequisite subject to prr i,2 }.

of the lecture and sec SEC i SEC .

2011 Journal of Computing Press, NY, USA, ISSN 2151-9617



stg LEC : LEC STG, where stg LEC (stg i ), de- notes the student groups STG that attend the lecture and stg i STG. loc LEC : LEC LOC, where loc LEC (loc), denotes the location loc of the lecture, it is either lecture room or lab and loc LOC . ler LEC : LEC LER, where ler LEC (lec), denotes the lecturer ler of the lecture and ler LER. day LEC : LEC DAY, where day LEC (lec), de- notes the day of lec LEC . tsl LEC : LEC TSL, where tsl LEC (tsl), denotes the day of tsl T SL. if day1 LEC day2 LEC and tsl1 LEC tsl2 LEC

lec 2 then sec1 LEC sec2 LEC and stg1 LEC stg2 LEC and loc1 LEC loc2 LEC and ler1 LEC ler2 LEC ). The U LT S is defined as follows:
P (tsl| LER, LEC, STG, SEC, LOC, HCO, SCO) (1)

and lec 1

Function 1 shows the set of values of TSL which let the ULTS problem attains the best of all possible solutions (optimum solution).

3. Constraints
The optimum solution of the ULTS problem can be obtained by satisfying all hard constrains (HC) and most of the soft constraints (SC). The maximization of SC can be written as follows: maximize sc = (2) where n is the number of soft constraints. The objective function in (2) is to be optimized subject to the SC constraints shown in sub-sections 3.1 and 3.2. In this paper, the timetable is called visible if it satisfies all the hard and soft constraints, semi-visible if it satisfies all hard constraints and most of soft onstraints, otherwise it is invisible. 3.1 Hard Constraints A timetable is called visible if it is satisfying all hard constraints. The hard constraints of any timetable must not be violated under any circumstances when scheduling the timetable and must be adapted by the technique used to design the timetable. These constraints can be summarized as follows: A time slot shows the start and end time of lectures, including the times that are allowed (legal time slots) and not allowed (illegal time slots) for lectures. All lecturers must be delivered during the legal time slots. A course is divided into one or more sections and every section is assigned one lecture or more, depending on the lectures type and its number of credit hours. The capacity of the lecture room or lab is enough for all students attending the course in the room or lab. Lecturers are not allowed to deliver classes in time slot that are forbidden for them. Every course must either be practical or theory. Every course section must be delivered by one and only one lecturer.

3.2 Soft Constraints

All sections of a particular course must be scheduled. In case of a lecturer who is delivering the same course or more than one course into two distinct locations or faculties, the time between the two locations or faculties must be taken into consideration. This also applied to the students (travel time constraints). The contradictions of lecturers, lectures, students, class rooms and labs must be eliminated. More than one lecture must not be assigned to the same lecturer, student, lecture room, or lab at the same time slot. Two or more lectures must not be assigned at the same time slot to the same lecturer, student, lecture room or lab. The time slots of practical and theoretical lectures of a course must not be at the same time. Every course must belong to a department and a faculty. The number of students attending the course should be less than or equal to the capacity of the room [Socha et al., 2002]. All courses of a lecturer must be scheduled. All courses of a student must be scheduled. A lesson can only be taught at a time the teacher is available. Some rooms are dedicated to specific subjects.

An optimum timetable is constructed by satisfying all soft constraints. Generally, the violation of soft constraints must be minimized as much as possible. Most of the soft constraints encountered in timetables can be summarized as follows: Lecturers preferences: Some lecturers may have some preferred dates and time slots to deliver lectures; this specifically, happens in case of part time lecturers. All sections of a course are distributed on even days or odd days only. Some courses are preferred to be distributed in different days or at the same times lots. All lectures of the same course are delivered in the same lecture room or lab. If the prerequisite of a course is not delivered by the same lecturer then both courses can be delivered in the same time slot. The courses must be assigned to lecturers that are capable to deliver them. A student should not be allowed to register more courses with total credit hours that exceed the maximum number specified by the faculty or university. Lecturer should not be allowed to deliver courses class rooms and labs must be eliminated number specified by the faculty or university. Some courses are pre-scheduled. Sections of the same subject should be assigned to the same day. Two or more sections should be assigned to consecutive time slots on the same day (block

2011 Journal of Computing Press, NY, USA, ISSN 2151-9617




4. Genetic Algorithms
Genetic algorithms (GAs) are stochastic and population-based techniques which imitate the mechanism of natural evolution and genetics such as inheritance and mutation [Fraser, 1957, Bremermann, 1958, Holland, 1975]. Gas belong to a larger class of algorithms used to solve optimization problems called evolutionary algorithms (EAs). Normally, a GA is initiated with a set of random possible solutions called populations (phenotypes) and each individual in the population is called a chromosome (genotype). A chromosome is composed of elements which are called genes (variables) and a value of a gene is called an allele [Yahya et al., 2011]. Figure 2 shows the relationship between chromosomes, genes and alleles in a population.




pressure over plain roulette selection. Top Percent: A selection operator which randomly selects a chromosome from the top N percent of the population as specified by the user. Best: A selection operator which selects the best chromosome (as determined by fitness). If there are two or more chromosomes with the same best fitness, one of them is chosen randomly. Random: A selection operator which randomly selects a chromosome from the population.

4.2 Crossover
Crossover is a process employed by the genetic operator to modify the genes of selected chromosomes (selected for mating) from one generation to the next. It resembles the biological reproduction and crossover, upon which genetic algorithms are based. There are many techniques used for crossover, some of them are:


One-Point Crossover

Figure 2: A Population with n Chromosomes and Every Chromosome Composed of the Same Number of Genes Usually, a chromosome is represented by a binary string which contains a solution to the problem, but depending on the nature of the problem, it may take any other form of representations, e.g. integers, vector of real numbers and alphanumeric characters. Chromosomes evolve through successive iterations, called generations. A new generation of chromosomes (children or offsprings) is created from old generations (called parents) using variation operators (genetic operators), which can be classified as selection, crossover and mutation [Yahya et al., 2011].

A single crossover point in the same location is selected on the organism strings of both parent chromosomes. All genes of the segment before that point in both organism strings are swapped between the two parent chromosomes as presented in Figure 3.


Figure 3: One Point Crossover Two-point crossover

4.1 Selection
Selection is a genetic operator that creates new generations of chromosomes by choosing chromosomes from the current population so that some of their genes can be exchanged or mated. In the process, fitter chromosomes may have higher chance of being selected. After several generations, the algorithm converges to the best chromosome, which hopefully represents the optimal or near optimal solution to the problem. Genetic literature shows the following types of selection: 1. Roulette Wheel (Fitness Proportionate): The chance of a chromosome being selected for mating is directly proportional to its fitness or rank specified by the fitness function. If fi is the fitness of individual i in the population with N individuals, then its probability of being selected is:

In this case, two points of crossover will be selected on the two parent chromosomes and all genes of the segment between the two points are swapped between the parents, resulting into two children.


Uniform Crossover

The uniform crossover uses a fixed mixing ratio between two parents. It allows the parent chromosomes to donate genes separately rather than a group of genes (segments). If the mixing ratio is 50%, then both offspring's will have approximately half of its genes from first parent and the other half from the second parent.

4.3 Mutation
The mutation operator performs random changes in one or more genes in the selected chromosome, yielding a new candidate solution for the next generation. The new generation created by mutation might be an infeasible solution. Evolutionary solver attempts to repair such a solution to make it feasible; however, this is not always, successful.

pi =

fi N= 1 f j j


5. Timetables Based on GAs

2. Tournament: Uses roulette selection N times to produce a tournament subset of chromosomes. The best chromosome in this subset is then chosen as the selected chromosome. This method of selection applies addition selective Generally, most of the universities represent their timetables by matrices as the one shown in Table 1. This type of representation is easy to visualize and understand. However, it

2011 Journal of Computing Press, NY, USA, ISSN 2151-9617



is difficult to be used to represent the chromosomes as it complicates the crossover and mutation [Enzhe and Ki-Seok, 2002]. Table 1: An Example of a Real-World Class Timetable
Days Monday Tuesday Wednesday Course A Lecture 1 Star End Time Location 1 Time Slots

sum of weighted scores and penalties of the hard constrains and soft constraints. One of these methods used in [Chaudhuri and De, 2010, Coley,2001, Goldberg, 2008, Klir and Folger, 1988, Konar, 2005, Zadeh, 1965] is formulated as:

F (x ) = wis Pi soft (x ) + w h Pjhaed (x ) j

i =1 j =1


Start Time End Time


Course A Lecture 2 Star End Time Location 4

Where x is the timetable to be evaluated, n is the number of soft constraints, constraint,

Pi soft

is the violation measurement of the ith soft


Course A Lecture 1 Star End Time Location 1


[0, 1] is the weight of the ith soft constraint, m is

the number of hard constraints, measurement of jth hard constraint, the j hard constraint.

Pjhaed wh j

is the violation


[0, 1] is the weight of

5.1 Chromosomes, Genes and Alleles in Timetables

In solving the timetable problem, GAs start by creating a population of random timetables in which every timetable represent the chromosomes. There are different ways to represent and encode the chromosomes in the timetable problem. The type of chromosomes representation is very important because it has important impact on specifying the efficiency, effectiveness and quality of the timetable. As with the chromosomes, the genes and alleles can be represented in different ways. Jain et al. [Jain et al., 2010] used a two dimensional array A i;j to represent the chromosomes, where: 1. 1 i n and 1 j k, n = number of time slots in a week and k = number of lectures. 2. Each element in the array represents three tuples (genes) which are student group, section and location. 3. The values taken by student groups, sections and locations represent alleles. As mentioned in [Jain et al., 2010], A i;j can be mapped to the weekly lecture timetable where the rows represent the classes instead of lectures. Derisa et al. [Derisa et al., 1999] used timetables as chromosomes and the subjects as genes, and time slots and rooms as alleles (Figure 4). They have shown that this representation enables both consistency checking and the search for a near-optimal solution by the constraint based reasoning and GA techniques to be carried out effectively.


Genetic Operators in Timetables

Ghaemi and Vakili [Ghaemi and Vakili, 2007], implemented two selection methods: The Roulette wheel in which, the rank weighting technique was implemented. 2. Tournament selection in which, each parent was selected depending on three candidate chromosomes. They have also applied three types of crossover, single point crossover, uniform crossover, and modified crossover. In addition they have applied the single point mutation where, the mutation points are randomly selected. They have shown that single point operator in upper mutation rates and modified uniform crossover operator in lower mutation rates performed well while the modified uniform crossover operator overperformed the others. Better results were performed when varying mutation rates were used. The Tournament selection performed better results than the rank weighting selection. Jain et al [Jain et al., 2010] used one site crossover to solve timetable scheduling problem for two year courses. Sigl et al. [Sigl et al., 2003] modified the operator by adding some programming logic and using different selection algorithm. In the first step, the modified crossover operator copies the similar genes according to their positions from the parents to the child individual. Dissimilar genes are specifically marked and authorized for further processing. In the second step, the operator checks the list of equations for each marked gene in child individual and counts the number of potential conflicts generated for both parents' choices. The gene from a parent that generates fewer conflicts is chosen, so no additional conflicts are generated in addition to the conflicts caused by the parents. 1.

6. Conclusion
University course timetable scheduling problem has been widely investigated in the literature. Many researchers have successfully implemented the genetic algorithm to solve the problem. Nevertheless, many it has been clearly proofed the efficiency of the genetic algorithm in solving the problem.

Figure 4: Chromosome Representation for Timetable Planning [Derisa et al., 1999]

4.4 Fitness Functions in Timetables There are different types of fitness functions in the timetable problem which are formulated as a measurement function used to specify the overall fitness. The overall fitness calculates the


2011 Journal of Computing Press, NY, USA, ISSN 2151-9617



The authors would like to acknowledge the financial support for this paper by the Deanship of Scientific Research in Najran University, Saudi Arabia under research number NU 17/10.

[1] Welmina P,(2004) Comparison of the effectiveness of probability model with vector space model for compound similarity searching. University Technology Malaysia (U.T.M): MS Thesis. M. Norberciak. Universal method for timetable construction based on evolutionary. Approach World Academy of Science, Engineering and Technology, 2006. Md. G. Yeasin and A. T. Khader. Local search algorithms for examination timetabling. National Conference on Programming Sciences, Kuala Lumpur, 2005. S. Even, A. Itai, and A. Shamir. On the complexity of timetable and multicommodity flow problems. SIAM Journal of Computing, 5:691 - 703, 1976. R. M. Karp. Reducibility among combinatorial problems, in complexity of computer computations. Plenum Press, New York, 1972. K. Socha, J. Knowles, and M. Samples. A max-min ant system for the university ourse timetabling problem. Proceedings of the 3rd International Workshop on Ant Algorithm, ANTS, pages 1-13, 2002. A. S. Fraser. Simulation of genetic systems by automatic digital computers. ii: Effects of linkage on rates under selection. Austral. J. Biol. Sci., 10:492499, 1957. H. J. Bremermann. The evolution of intelligence. The nervous system as a model of its environment. Technical Report No. 1, Department ofMathematics, University of Washington, Seattle, WA., 1958. J. H. Holland. Adaptation in Natural and Artificial Systems. University of Michigan Press, Ann Arbor, MI.,1975. A. A. Yahya, A. Osman, A. R. Ramli, and A. Balola. Feature selection for high dimensional data: An evolutionary filter approach. Science Publications, Journal of Computer Science, 7(5):800-820, 2011. Yu Enzhe and Sung Ki-Seok. A genetic algorithm for a university weekly courses timetable problem. International Transactions in Operational research, 9:703 -717, 2002. A. Jain, S. Jain and P. K. Chande. Formulation of genetic algorithm to generate good quality course timetable. International Journal of Innovation, Management and Technology, 1(3):20100248, 2010. S. Derisa, S. Omatub, H. Ohtab, and P. Saada. Incorporating constraint propagation in genetic algorithm for university timetable planning. Engineering Applications of Articial Intelligence, 12:241253, 1999. A. Chaudhuri and K. De. Fuzzy genetic heuristic for university course timetable problem. Int. J. Advance.Soft Comput. Appl, 2(1):2074-8523, 2010. D. A. Coley. An introduction to genetic algorithms for scientists and engineers. World Scientific Publishing Company, Singapore, pages 23-25, 2001. D. E. Goldberg. Genetic Algorithms in Search, Optimization and Machine Learning. Pearson Education,Ninth Indian Reprint, New Delhi, 2008. G. Klir and T. Folger. Fuzzy Sets, Uncertainty and Information. Prentice Hall, New Jersey, 1988. A.Konar .Computational Intelligence Principles, Techniques and Applications. Springer Verlag, Netharlands,2005. L. A. Zadeh. Fuzzy sets. Information and Control, 8: 338-353, 1965. S. Ghaemi and M. T. Vakili. Using a genetic algorithm optimizer tool to solve university timetable scheduling problem. Signal Processing and Its Applications, 9th International Symposium on, pages 1-4, 2007. B. Sigl, M. Golub, and V. Mornar. Solving timetable scheduling problem by using genetic algorithms. Information Technology Interfaces. Proceedings of the 25th International Conference on, pages 519 - 524, 2003.
2011 Journal of Computing Press, NY, USA, ISSN 2151-9617








[9] [10]







[17] [18] [19] [20]