Using improved Memetic Algorithm and local search to ... - CiteSeerX

3 downloads 1000 Views 181KB Size Report
Using improved Memetic Algorithm and local search to solve University. Course Timetabling Problem (UCTP). Majid Joudaki. Mehdi Imani. Niloofar Mazhari.
Using improved Memetic Algorithm and local search to solve University Course Timetabling Problem (UCTP) Majid Joudaki

Mehdi Imani

Niloofar Mazhari

Islamic Azad University, Doroud branch Doroud, Iran [email protected]

Islamic Azad University, Science and Research. Qazvin branch Qazvin, Iran [email protected]

Allameh Dehkhoda College

Abstract- Course Timetabling is a complex problem, happening at the beginning of every semester at universities. In this problem, one of the most important issues is variety of constraints, which results in different ways of timetabling in different universities. Comparing to exact methods which take lots of time to solve UCTP, metaheuristic methods produce a feasible solution within reasonable computation time. In this paper, a hybrid method is presented, which is based on combination of improved Memetic and Simulated Annealing Algorithms. Using Simulated Annealing Algorithm as the local search routine increases exploiting ability of Memetic Algorithm. Also, modifying Crossover operator of Memetic Algorithm and creating initial population by a heuristic-based method improves this algorithm. In order to improve produced chromosomes and decreasing the number of violation of the constraints, a new operator is designed and added to Memetic Algorithm called improvement operator. With comparing the results of this method and some modern methods using standard data, efficiency of this method is clear. Keywords- Memetic Algorithm, Local Search, Simulated Annealing, University Course Timetabling Problem.

I.

INTRODUCTION

Timetabling is an issue seen in many aspects of life: working, teaching, transportation, etc. University Course Timetabling Problem (UCTP) is a complicated task, due to educational constraints at universities. According to researches in this field, such constraints are divided into two categories: Hard constraints: These kinds of constraints must be satisfied in the timetable. Soft constraints: these kinds of constraints increase quality of the task if they are satisfied, but satisfying these constraints is not compulsory. Hard constraints have high priorities over soft constraints, and a timetable is considered feasible only if all hard constraints are satisfied in it. For example, a student cannot attend more than one course at the same time. On the other hand, soft constraints are set according to policies of the university and according to need of people using it. For example, a student cannot have three classes in a row in one day. Another point,

Qazvin, Iran [email protected]

which is true about any form of UCTP, is that UCTP belongs to NP-hard problems, and we cannot look forward to find an algorithm with time complexity of polynomial order for solving it in general [2]. Solving real timetabling problems using exact algorithms is impossible practically, because for such algorithms, run time increases exponentially when size of the problem increases. Therefore, we can use approximate algorithms to solve them, such as heuristic and Metaheuristic Algorithms. Some examples of tasks using such algorithms are provided in [3, 4, 5, 6, 7, 8, 9, 10]. One of the advantages of the task we have done in this paper is to use heuristic techniques and metaheuristic search methods in considering UCTP. A big difference between this task and previous ones is its flexibility for using real data and the possibility of using it in real university environment. High accuracy, quickness, applying educational policies of university in timetabling, and optimal usage of teacher’s and student’s time are some advantages of this task. Memetic Algorithm (MA) [11, 12] is called to a specific class of Metaheuristic Algorithms combining population-based global search (as in Genetic Algorithm) with local search made by each of the individuals [13]. Using exploration ability of evolutionary algorithms and meanwhile combining this advantage with exploiting ability of local search procedures are factors for MA to be successful [13]. While Genetic Algorithm takes inspiration from biological evolution in the nature, MAs mimic cultural evolution in the society [13]. Local search techniques are one choice for solving combinatorial optimization problems [14]. One of the methods of local search is Simulated Annealing (SA). In this method, every neighbor solution which is better than current solution will be accepted. If neighbor solution is worse, it will be accepted by probability of . Neighbors of a solution are usually created by applying a simple move on the current solution, and quality of a solution is determined by its fitness (cost function) [15]. In this formula, ∆ and the parameter represents temperature. Firstly, has a

high value, and it decreases according to progression formula: . In different problems, the cooling rate and initial temperature are usually different. The consequence of subjects in this paper is as following: in the next section, one sample of UCTP is introduced for evaluating the algorithm and comparing with other methods. Related works are considered in section III. Proposed algorithm is presented in part IV, and essential pseudo codes are provided for further information. In section V, results of applying the proposed algorithm on some standard data are shown and a comparison to other methods is provided. Conclusion and presenting a proposal for future works are considered in VI. II.

UNIVERSITY COURSE TIMETABLING PROBLEM

A UCTP is generally described as below [17]: a set of events or classes (E), which must be scheduled into 45 timeslots (5 days of 9 timeslots each), a set of rooms (R) where events can take place and a set of students (S), who attend the events, and a set of features (F), which are satisfied by rooms and required by events. Each student attends some of these events and each room has a fixed size. A feasible timetable is one in which every event is assigned a timeslot and a room, and hard constraints are satisfied. These constraints are: a. b.

c.

No student attends more than one event at the same time. The room is big enough (bigger than or equal to the number of attending students) and satisfies all the features required by the event. Only one event is assigned to each room at any timeslot

Soft constraints are: a. b. c.

A student should not have a class in the last timeslot of a day. A student should not have more than two classes in a row. A student should not have a single class on a day.

The problem aims to minimize the number of soft constraints violations in a feasible solution. All infeasible solutions are worthless. III.

RELATED WORKS

In this part some previous works will be under consideration. In these tasks algorithms such as Tabu Search, Genetic Algorithm, Great Deluge, SA, Ant

Colony and Memetic are used. Tabu Search Algorithm is one efficient method for solving optimization problems and especially for solving UCTP. Algorithms which make use of Tabu Search are used in [3, 4, 18, 19]. For instance, method [18] continues with locating local search methods between steps of Tabu Search. In [19], effect of two types of neighborhood on Tabu Search in solving UCTP is considered. Similar works are available in [20, 21]. For UCTP, Genetic Algorithm is used in various forms. As an example, the work which is done in [22] is a combination of Genetic Algorithm with a local search method and applying this combination on UCTP. Other methods of timetabling using evolutionary algorithms are reported in [5, 6]. In [23, 24] Great Deluge Algorithm with nonlinear decrease rate is used. In this case, this algorithm has good results, comparing with other methods, but one disadvantage is that we have to set to many parameters in this algorithm, and each parameter has specific value according to the model which is under consideration. Although this algorithm has good answers, due to the problem above cannot be a general algorithm and is highly efficient for some specific models. For a new instance which is out of given instance in this algorithm, we need to reset the parameters. So we do not compare these algorithms with the proposed method. Optimization algorithms, which make use of simulated annealing, are proposed in [7, 25, 26, 27]. Other examples of multi-purpose techniques which are used in exam timetabling are provided in [8, 28] and with details in [29]. In [30, 31] two algorithms are presented in the basis of Ant Colony Algorithm, for solving UCTP. In [9, 10, 13, 17, 32, 33] MA is applied to UCTP. IV.

THE PROPOSED METHOD (MA_SA_UCTP)

As mentioned in section 1, MA is a powerful algorithm for solving optimization problems. MA_SA_UCTP acts as follows. Each chromosome is set using heuristic initialization procedure. Then the local search procedure (which is based on SA) is recalled to improve the chromosome. In the next step, we apply improvement procedure on the chromosome to improve it as much as possible. In a while loop, two chromosomes of population are selected due to their fitness. Crossover and Mutation operators are applied with probability of and respectively and a child is produced. Then SA and improvement procedures are recalled and improve the child. Finally, this child is

compared to the worst member of population and if the child is better than that member, it will be replaced with the member. This procedure will continue until meeting stopping rules. Figure 1 illustrates the algorithm. a problem instance in pupolation chromosome heuristic initial chromosome apply Local Search SA on apply improvement routine on

location are selected and the event is allocated to that location. h1 h2 h3 h4 h5

sort pupolation based on itness termination condition not reached select two parents from population by proportional selection child solution after crossover with a probability child solution after mutation with a probability child solution after applying Local Search SA child solution after applying improvement is better than worst member of the population

h6 h7

Selecting an event with lower appropriate location in timetable Selecting an event with higher conflict with other events Selecting an event in a random manner Selecting an appropriate location for lower unallocated events Selecting a location with lower number of events in a time slice Selecting a location in a random manner Selecting an event with lower number of students Fig 3: heuristic procedures to produce chromosomes

C. Local Search Procedure This procedure is based on SA. The code is presented in figure 4. a solution instance 0

sort pupolation based on itness The best solution achived for Fig. 1: MA pseudo code presented for UCTP

A. Presenting solution using Chromosome Figure 2 illustrates the structure of a chromosome. In this presentation, every gene consists of a triple . Chromosomes are equal in length and this length is the number of events. This presentation is simple and it is easy to apply MA operators on it. event_1 timeslot_1 room_1

...... event_i ..... event_n ...... timeslot_j ..... timeslot_t ...... room_k ..... room_r Fig. 2: the structure of a chromosome

B. Heuristic Initialization Procedure UCTP is similar to the graph coloring problem [2], so we can use heuristic procedures of graph coloring to produce chromosomes [36]. By considering each event as a vertex, Events cannot take place in the same timeslots, so we add edges (limitation) between each pair of vertices. In this manner, we can convert lots of simple timetabling problems to graph coloring problems and vice versa. We can consider every timeslot as a color. Figure 3 presents heuristic procedures in initialization. This step begins with an empty timetable and a list of events (L) which consists of unallocated events (firstly |L|=n). Using heuristic procedures in figure 3, each time one event and one appropriate

1 to apply

to the select a neighbour of randomly

∆ ∆

0

increament



0,1 by 1

Apply cooling rate

to the

Solution after applying SA Fig. 4: SA procedure used as local search in MA

In this procedure, three different neighborhood structures are used: 1) Event movement from one timeslot to another. 2) Exchanging two events timeslots with each other. 3) Exchanging three events timeslots with each other in a circular manner. We should mention that events are selected randomly in all above structures. D.

Crossover Operator

This operator selects genes as follows: firstly, one event is selected and the number of violation of the soft constraints is studied in both parents and the gene for this event is selected from a parent with lower soft constraints violations. This gene is transmitted to the child with its related genes (genes which consist of events having the same student with this event). This procedure continues until all genes are transmitted. Whenever we have parents with same situation, one parent is selected randomly for selection of the gene. Figure 5 shows this procedure.

solution in a reasonable time (this time differs from one method to another and is between 3 to 10 hours). g3

g4

g5

g6

g7

parent2

g2

g3

g4

g5

g6

g7

g1

.......... ..........

g1 g2 g3 g4 g5 g6 g7 .......... Fig. 5: Crossover Operator, selecting gene1 from parent1 and transmitting this gene to the child with its related genes. This is true for gene2 from parent2.

child 

E. Improvement of Chromosome This operator decreases the number of soft constraints violations by moving the students from one course group to another one. A course group consists of a course which is presented in different times. If we can decrease the number of soft constraints violations by moving one student from one course to another, this movement is done.

s1 s2 s3 s4 s5 m1 m2 m3 m4 m5 l

MA_SA_UCTP

g2

Instances

parent1  g1

0 0 0 0 0 144 142 207 126 169 942

[5]

[6]

[10]

[13]

[22]

[36]

[37]

0 0 0 0 0 317 313 357 247 292 inf

0 0 0 0 0 242 161 265 181 151 inf

0 0 0 0 0 221 147 246 165 130 529

0 0 0 0 0 227 180 235 142 200 inf

2 4 2 0 4 254 258 251 321 276 1027

5 3 2 3 1 316 243 255 235 215 inf

0 0 0 0 0 236 158 261 176 147 296

Table 2: Comparing MA_SA_UCTP with some existing methods. inf is unacceptable.

V.

EXPERIMENTAL RESULTS

MA_SA_UTCP is coded with Java and evaluated on a PC with a memory of 512 MB and Intel 2.0 GHz processor. MA_SA_UTCP parameters are presented in table 1. Value Parameter 100 Number of generation 40 Amount of population Crossover probability 0/ 8 Mutation probability 0/07 200 Initial temperature Final temperature 0/005 Temperature decrease rate 0/999 Table 1: Parameters used in MA_SA_UCTP

MA_SA_UTCP is applied on [34] data. Although this data does not show all aspects and limitations of a real problem [35], but it is a good standard for comparing our proposed method to other applied methods for this data. In table 2, MA_SA_UTCP is compared to some other new methods. First column presents instances of the problem. In this column letters s, m and l represent small, medium and large. Second column shows MA_SA_UTCP results for different instances. In each column, numbers show the number of soft constraints violations. Reference numbers of compared methods are provided above each column. In each row, the lower (or the best) values are in bold. ‘Inf’ expressions are used for methods which are not able to find a feasible

For small, medium and large instances run time of the proposed algorithm is 60, 300 and 600 minutes, respectively. Results show that MA_SA_UTCP is able to find a feasible solution for every sample. Figure 6 represents improvement percentages of proposed method and methods in [10, 37]. These two methods are better than others and are chosen for comparison. As in bar chart, our proposed method acts better for all samples (it has positive percentage) except for m5. For instance m5 the percentage is negative and in this case other two methods act better. If the solutions of MA_SA_UTCP and compared methods are and ′ , for one instance, then improvement percentage is calculated as follows: ′ ′

100

Fig. 6: comparing MA_SA_UTCP with methods in [10, 37]. Horizontal line represents test samples and vertical one represents improvement percentage.

Highest improvement amount is seen in instance m1. In this case, we have an improvement of 34.8 times higher comparing to [10] and an improvement of 38.9 higher comparing to [37]. VI.

CONCLUSION AND FUTURE WORKS

In this paper, we studied MA and a combination of MA and local search procedure which is based on SA to solve UCTP. Using heuristic initialization procedure was helpful for satisfying hard constraints and making initial solutions acceptable. MA_SA_UCTP was applied on real data at the computer and electrical department of Isfahan University. According to the results, this method is comparable to experts’ paper works and it needs less time to produce timetable. We can make use of this algorithm, in the case that we formulate UCTP in this department and solve some exception cases. In future works we can develop new operators for MA (such as improvement operator in this paper). Another alternative is to change standard operators of MA. Applying heuristic methods to satisfy soft constraints can be considered in solving this problem. VII. [1]

REFERENCES

E. Burke, J. Kingston, K. Jackson, and R. Weare. “Automated University Timetabling: The State of the Art” The Computer Journal, Vol. 40, No. 9, pp. 565-571, 1997. [2] R Lewis. “A survey of metaheuristic-based techniques for university timetabling problems”, OR Spectrum, Vol. 30, No. 1, pp. 167-190, 2008. [3] D. Costa. “A tabu search algorithm for computing an operational timetable” Eur J Oper Res, Vol. 79, pp. 98–110, 1994. [4] L. Gislen, C. Peterson, and B. Soderberg. “Teachers and classes with neural networks” Int J Neural Syst, Vol. 1, pp. 167–176, 1989. [5] D. Corne, P. Ross, and H. Fang. “Evolving timetables” In: Lance C. Chambers (ed) The practical handbook of genetic algorithms, Vol. 1, CRC, Florida, pp. 219–276, 1995. [6] M.Carrasco, and M. Pato. “A multiobjective genetic algorithm for the class/teacher timetabling problem,” In: Burke E, Erben W (eds) Practice and theory of automated timetabling (PATAT) III, Vol .2079, Springer, Berlin, pp. 3–17, 2001. [7] D. Abramson, H. Krishnamoorthy, and H. Dang. “Simulated annealing cooling schedules for the school timetabling problem” Asia Pacific J Operational Res, Vol. 16, pp. 1–22, 1996. [8] E. Burke, Y. Bykov, and M. Petrovic. “A multicriteria approach to examination timetabling,” In: Burke E, Erben E (eds) practice and theory of automated timetabling (PATAT) III, Vol. 2070, Springer, Berlin, pp. 118–131, 2001. [9] A. Alkan and E. Ozcan.” Memetic algorithms for timetabling evolutionary computation,” Proc of the 2003 IEEE Congress on Evol Comput., Vol. 3, pp. 1796–1802, 2003. [10] S. Abdullah, E. K. Burke, and B. Mccollum. “A hybrid evolutionary approach to the university course timetabling problem,” In Proceedings of the IEEE Congress on Evolutionary Computation, Singapore, September 2007.

[11] P. Moscato. “On evolution, search, optimization, genetic algorithms and martial art: towards memetic algorithms,” caltech concurrent computation program, Technical Report, 1989. [12] P. Moscato. “Memetic algorithms: A short introduction,” In: New Ideas in Optimisation, Mcgraw-Hill’S Advanced Topics In Computer Science Series, pp. 219–234. [13] O. Rossi-Doria, B. Paechter. “A memetic algorithm for university course timetabling” in: Combinatorial Optimisation 2004 Book of Abstracts, Lancaster, UK, Lancaster University, 2004. [14] J. Holland, Adaptation in Natural and Artificial Systems, Ann Arbor, MI: University of Michigan Press, 1975. [15] E. Burke, Y. Bykov, J. Newall, and S. Petrovi. “A TimePredefined approach to Course imetabling” Journal of Operations Research, Vol. 13, No. 2 ,pp. 139-151, 2003. [16] M . Nandhini, and D. S. Kanmani. “A Survey of Simulated Annealing Methodology for University Course Timetabling” International Journal of Recent Trends in Engineering, Vol. 1, No. 2, pp. 255-257 May 2009. [17] M. Chiarandini, K. Socha, M. Birattari, and O. Rossi-Doria, “An effective hybrid approach for the university course timetabling problem,” FG Intellektik, FB Informatik, TU Darmstadt, Germany, Tech. Rep AIDA-2003-05, 2003. [18] A. Schaerf. “Tabu search techniques for large high-school timetabling problems,” In: Proceedings of the thirteenth national conference on artificial intelligence. AAAI Press/MIT Press, Portland (OR), pp. 363–368, 1996. [19] C. H. Aladag, G. Hocaoglu, and M. A. Basaran, “The effect of neighborhood structures on tabu search algorithm in solving course timetabling problem” Expert Systems with Applications, doi: 10.1016/j.eswa.2009.04.051, 2009. [20] C. H. Aladag, and G. Hocaoglu. “A tabu search algorithm to solve course timetabling problem” Hacettepe Journal of Mathematics and Statistics, Vol. 36, NO.1, pp. 53–64, 2007. [21] R. Alvarez, E. Crespo, and J. M. Tamarit. “Design and implementation of a course scheduling system using tabu search” European Journal of Operational Research, Vol. 137, pp. 512–523, 2002. [22] S. Abdullah, and H. Turabieh. “Generating University Course Timetabling Using Genetic Algorithms and Local Search,” International Conference on Convergence and Hybrid Information Technolog, 2008. [23] D. Landa-Silva, and J. H. Obit, “Great Deluge with Nonlinear Decay Rate for Solving Course Timetabling Problems,” Proceedings of the 2008 IEEE Conference on Intelligent Systems (IS 2008), IEEE Press, pp. 8.11-8.18, 2008. [24] Dario Landa-Silva, Joe Henry Obit. “Evolutionary Non-Linear Great Deluge for University Course Timetabling,” Proceedings of the 2009 International Conference on Hybrid Artificial Intelligence Systems (HAIS 2009), Lecture Notes in Artificial Intelligence, Vol. 5572, Springer, pp. 269-276, 2009. [25] D. Abramson, “Constructing school timetables using simulated annealing: sequential and parallel algorithms” Manag Sci, Vol. 37, No. 1, pp. 98–113, 1991. [26] F. Melicio, and J. Caldeira. “Timetabling implementation aspects by simulated annealing,” In: Jifa Gu (ed), IEEE systems science and systems engineering, Beijing, Aceite, pp. 553–557, 1998. [27] S.Elmohamed, G. Fox, and P. Coddington. “A comparison of annealing techniques for academic course scheduling,” In: Burke E, CarterM(eds) Practice and theory of automated timetabling (PATAT) II, Vol. 1408, Springer, Berlin, pp. 146– 166, 1998. [28] S.Petrovic, and Y. Bykov. “A multiobjective optimisation approach for exam timetabling based on trajectories,” In: Burke E, De Causmaecker P (eds) The paractice and theory of automated timetabling (PATAT) IV, Vol. 2740, Springer, Berlin, pp. 181–194, 2003.

[29] L. Paquete, and C. Fonseca. “A study of examination timetabling with multiobjective evolutionary algorithms,” In:4th metaheuristics international conference (MIC 2001), Porto, pp. 149–154, 2001. [30] K.Socha, and M. Samples. “Ant algorithms for the university course timetabling problem with egard to the state-of-the-art,” In: Evolutionary computation in combinatorial optimization (EvoCOP 2003), Vol. 2611, Springer, Berlin, pp. 334–345, 2003. [31] K. Socha, J. Knowles, and M. Samples. “A max-min ant system for the university course timetabling problem,” Proceedings of the 3rd International Workshop on Ant Algorithms (ANTS 2002), Springer Lecture Notes in Computer Science, Vol. 2463, pp. 1-13, 2002. [32] B. Paechter, A. Cumming, M. G. Norman, and H. Luchian. “Extensions to a memetic timetabling system,” Proceedings of the 1st International Conference on Practice and Theory of Automated Timetabling, LNCS 1153, pp. 251–265, 1996. [33] O. Rossi-Doria, M. Sampels, M. Birattari, M. Chiarandini, M. Dorigo, L. Gambardella, J. Knowles, M. Manfrin, M. Mastrolilli, B. Paechter, L. Paquete, and T. Stutzle.”A comparison of the performance of different metaheuristics on the timetabling problem,” Lecture Notes in Computer Science 2740, pp. 329–351, 2002. [34] http://iridia.ulb.ac.be/supp/IridiaSupp2002-001/index.html [35] B. McCollum. “University Timetabling: Bridging the Gap between Research and Practice,” Proc of the 6th Int Conf on the Practice and Theory of Automated Timetabling, pp. 15–35, 2006. [36] M. A. Al-Betar, A. T. Khader, and T. A. Gani. “A Harmony Search Algorithm for University Course Timetabling,” In:E. Burke,M. Gendreau. (eds.). The Proceedings of the 7th International Conference on the Practice and Theory of Automated Timetabling, Montréal, Canada, 2008. [37] S. Abdulla, and A. R. Hamdan. “A hybrid approach for University Course Time Tabling” IJCSNS, Vol.8, No.8, 2008. [38] D. J. A. Welsh, and M. B. Powell. “An upper bound for the chromatic number of a graph and it’s application to timetabling problems”. Computer Journal, Vol. 10, No. 1, pp. 85-86, 1967.

Suggest Documents