Selecting Quality Initial Random Seed For Metaheuristic Approaches: A Case Of Timetabling Problem

Size: px
Start display at page:

Download "Selecting Quality Initial Random Seed For Metaheuristic Approaches: A Case Of Timetabling Problem"

Transcription

1 Abu Bakar Md Sultan, Ramlan Mahmod, Md Nasir Sulaiman, and Mohd Rizam Abu Bakar Selecting Quality Initial Random Seed For Metaheuristic Approaches: A Case Of tabling Problem 1 Abu Bakar Md Sultan, 2 Ramlan Mahmod, 3 Md Nasir Sulaiman, and 4 Mohd Rizam Abu Bakar 1,2,3 Faculty of Computer Science and Information Technology University Putra Malaysia, 434 UPM Serdang Selangor, Malaysia 1 abakar@fsktm.upm.edu.my, 2 ramlan@fsktm.upm.edu.my, 3 nasir@fsktm.upm.edu.my 4 Department of Mathematic Faculty of Science, University Putra Malaysia 4 rizam@fsas.upm.edu.my Abstract The tabling Problem is a combinatorial optimization problem. The University Course tabling Problems (UCTP) deals with the scheduling of the teaching program. Metaheuristic techniques have been very successful in a wide range of timetabling problem including UCTP. The performance of metaheuristic over UCTP is measured by quality timetable that is no violation of hard constraints and the lowest number of soft constraint violated. The stochastic natures of the metaheuristic approaches make it difficult to predict the quality of end result produced. Therefore the initial quality solutions are one of the important factors contributed to success of metaheuristic approaches in solving optimization problem particularly UCTP. This paper analyzes the effect of different random seed over metaheuristic performance. Techniques for selecting quality random seeding as an input for metaheuristic algorithm to solve university course timetabling are presented. The main objective is to obtain quality initial solution without much effort to construct difficult heuristic. The result obtained gives us opportunity to choose quality initial solution with less effort. Keyword: tabling, Metaheuristic, Random Seeding 1. Introduction. The University Course tabling Problems (UCTP) deals with the scheduling of weekly timetable for a university. Lectures have to take place in a given number of time slots and rooms, so that a number of constraints are satisfied. Different versions of the problems arise at different institution. Comprehensive review on the timetabling problem and a number of research works can be found in [1 and 6]. Recently metaheuristic techniques have been very successful in a wide range of timetabling problem. However, they always have to be carefully tuned to the particular problem their solve [4]. This tuning is often based on the assumption that problem instances of similar size and similar structure poses similar difficulty to solve them by given metaheuristic. Metaheuristic methods begin with one or more initial solutions and iteratively employ search strategies to avoid 38

2 Selecting Quality Initial Random Seed for Metaheuristic Approaches: A Case of tabling Problem local optima. Metaheuristic are stochastic methods used when the size of the search and spaces becomes unmanageable for exact methods and no effective algorithm capable of finding optimal solution is available [5]. Therefore one of the main concerns by timetabling research community is how to produce initial quality solution for timetabling before employing metaheuristic method to further enhances the result. For instance [2] has proposed graph colouring heuristics to produce initial seeding that is better compared to randomly generated solutions. This paper discusses techniques to choose quality random seeding for timetabling problem. The motivation of this research came from the idea presented by Rossi-Doria et. al [5]. Their finding on measuring performance of different metaheuristic approaches over timetabling instances gives us idea how to present the easiest way to produce quality seeding without much effort to construct difficult heuristic. The paper is organized as follows. Section 2 briefly discusses metaheuristic approaches to timetabling problem instances. Section describes problem instances used for the experimental. Section 4 presents the experimental design and the process of selecting quality random seed and the result is discussed in section 5. We conclude the result in section tabling Problem The problem of constructing course timetables for higher learning institutions consists of allocating the set of courses offered by university to a time period and classrooms in such a way that no teacher, student or room is used more than once. Specifying timetabling constraints can be difficult for anyone, and often this task is to complete by administration staff with little knowledge of mathematics and computing. The problems typically incorporate many non trivial constraints of various kinds and attract much interest for solving it using several methods such as graph colorings, heuristics, integer programming, neural networks, constraints satisfaction, genetic algorithm, tabu search and constrained base reasoning. A general timetabling problem consists of assigning a set of lectures to rooms and timeslots and venue according a number of rules. The optimization rules are usually divided in two groups: hard constraints and soft constraints. Hard constraints should under no circumstances be violated while the number of violation of soft constraint is as low as possible. Violation of hard constraints makes the timetable infeasible while violations of soft constraint affect the quality of timetable; thus it should be minimized. The work that is presented in this paper addresses University Course tabling Problem with emphasis on the metaheuristic approaches. 3. Metaheuristic Approaches For over the past two decades, a new kind of approximate algorithm has emerged which basically tries to combine basic heuristic methods in higher level framework aimed at efficiently and effectively to explore search space [7]. The term metaheuristic was first introduced by Glover [8]. Osman et. Al [9] define a metaheuristic as an iterative generation process which guides a subordinates heuristic by combining intelligently different concepts for exploring and exploiting the search space, learning strategies are used to structure information in order to find efficiently near optimal. Five European Institution jointly undertook a European Commision Project whose aim is to empirically compare and analyze the performance of various metaheuristics on different combinatorial optimization including course timetabling problem. This group was known as Metaheuristic Network International Journal of The Computer, the Internet and Management Vol. 16. No.1 (January-April, 8) pp

3 Abu Bakar Md Sultan, Ramlan Mahmod, Md Nasir Sulaiman, and Mohd Rizam Abu Bakar ( They define a metaheuristic as a set of concepts that can be used to define heuristic methods that can be applied to a wide set of different problems. In other words, a metaheuristic can be seen as a general algorithmic framework, which can be applied to different optimization problems with relatively few modifications to make them adaptable to a specific problem. Comprehensive review about the metaheuristic can be found in [3]. There are several possible classifications of heuristic and metaheuristic but one is commonly used and that certainly allows us to embrace most metaheuristic including hybrid, a singlesolution approach and population-based approaches also known as single point and multiple point respectively. Examples of the single-solution are local search, simulated annealing, tabu search and others. Population based method include genetic algorithm, ant colony systems, memetic algorithm and some of hybrid evolutionary algorithms. Five European Institution jointly undertook a European Commision Project whose aim is to empirically compare and analyze the performance of various metaheuristics on different combinatorial optimization including course timetabling problem. This group was known as Metaheuristic Network ( They define a metaheuristic as a set of concepts that can be used to define heuristic methods that can be applied to a wide set of different problems. In other words, a metaheuristic can be seen as a general algorithmic framework, which can be applied to different optimization problems with relatively few modifications to make them adapted to a specific problem. 4. Instances Description The problem instances for this study were taken from metaheuristic research group ( It was a reduction of a typical university course timetabling problem. It has been introduced to reflect aspects of Napier University s real timetabling problem. The problem instance was generated by using a generator with different characteristic for different values of given parameters [5]. Detail description of the instances parameters was listed in table 1. Table 1. Parameters for easy instances Parameters Size Num_events Num_rooms 5 Num_Features 5 Approx_features_per_room 3 Percent_feature_use 7 Num_of_Student 8 Max_events_per_student Max_students_per_event All instances produced have a perfect solution. For the purpose of this research, we choose five easy instances easy1.tim/ easy2.tim/easy3.tim/asy4.tim/easy5.tim) for the experimental process. The problem instances consist of a set of events or classes E to be scheduled in 45 timeslots (5 days of 9 hours each), a set of rooms R in which events can take place, a set of student S who attend the events and a set of features F satisfied by rooms and required by events. Each student attends a number of events and each room has a size. A feasible timetable is one in which all events have been assigned a timeslots and room so that the following hard constraints are satisfied. 4

4 Selecting Quality Initial Random Seed for Metaheuristic Approaches: A Case of tabling Problem no students attends more than one event at the same time. the room is big enough for all the attending students and satisfies all the features required by the events; Only one event is in each room at any timeslot. In addition, a candidate timetable receives penalty cost for violating any of the following soft constraints. a student has a class in the last slot of the a day a student has more than two classes in a row; a student has a single class on a day. A timetable in which all lectures have been assigned a timeslot and a room so that no hard constraint is violated is said to be feasible. The aim of the problem is to find a feasible solution with minimal soft constraint violations. 5. An Overview of Proposed Hybrid Metaheuristic Algorithm. This section described our Metaheuristic Algorithm used in the experimental process. Our proposed Hybrid algorithm known as Two_point Hybrid Evolutionary Algorithm (TpHEA) was design specifically for solving UCTP problem. Hybridization of TpHEA consists of components from different metaheuristics. The origin idea of TpHEA came from the concepts of Memetic Algorithm (MA) combined with the acceptance criteria borrowed from Simulated Annealing. The evolutionary steps begins with two initial random solutions, then undergo improvement process under local search, mutation and crossover. Mutation occurs every iteration, whereas crossover occurs only under certain probability conditions. The reason is to avoid premature convergence and the solution always at higher rate of diversity. The local search [5] for UCTP was used for stochastic process improvement in two phases. The first phase is to improve infeasible timetable so that it becomes feasible by reducing the number of timeslots used. The second phase is to increase the quality of a feasible timetable by reducing the number of soft constraints violations. Figure 1 below present an overview of the TpHEA. While(triesleft) Generate 2 Solution. Solution1->RandomInitial()->LocalSearch() Solution2->RandomInitial()->LocalSearch() BestSolution->copy(Solution1) SetCurrentCost(BestSolution) While(timeleft) If Solution1->Cs > Solution2->Cs BestSolution->Solution2; Else Solution1->copy(solution2) BestSolution->mutation(); Solution1->mutation(); if(rnd-num<.1){ BestSolution- >crossover(bestsolution,solution1); } Solution1->localSearch(); BestSolution->localSearch() If(solution1->Cs)>(BestSolution->Cs)&&Dif- Rate>.3) Solution1->copy(BestSolution) Acceptance Criteria } } Figure 1. An Overview of TpHEA The algorithm always ensure the difference of the cost function between the solution are not exceeds more than two third. If the second solution exceeds the best solution then the second solution become the best solution. The process repeated until reaching the limit provided. 6. Methodology In this section, we briefly discuss our approach of selecting quality random seeding for initial solution. For the purpose of experiment, The Two-Point Hybrid International Journal of The Computer, the Internet and Management Vol. 16. No.1 (January-April, 8) pp

5 Abu Bakar Md Sultan, Ramlan Mahmod, Md Nasir Sulaiman, and Mohd Rizam Abu Bakar Evolutionary Algorithm (Tp_HEA) was introduced. Tp_HEA is used to represent metaheuristic base approaches. The Tp_HEA was tested on each five instances. For each instance, the algorithm was executed in 9 seconds each for five hundred trials. Each trial was given different random seed generated by the system. If the algorithm reached the optimum solution within the time limit, the initial seed was captured and stored in separate data file. This process was repeated for specified number of trials. Before the algorithm was executed over certain particular instances, sequence of random number was generated as an initial solution for the problem instances. Each random number was generated by the system via unique random seed. Seed is a set of number given to random generator. All random numbers are generated depending on this seed. If the seed is set to the same value then the sequence of numbers produced by random function of any programming languages will be the same. Therefore, the current time (computer timer) is frequently used as an unpredictable value to generate truly random numbers. For the purpose of this papers sequence of random number generated from seed number are representing initial random solution for timetabling problem. 7. Result The experiment explores the different effect of Tp_HEA for each different random seeding over each problem instances. Some of seeding provides optimum result with no violation of soft constraint. This gives us evidence initial seeding play important role in producing quality result for metaheuristic approaches. Some of the seeding never reaches the optimum within timeframe given. Table 2 shows the result for easy1.tim instance. Table 2. Result for easy1.tim Constraints Remarks optimum optimum The result also indicates that different seed produces different result on same problem instances whereas similar seed produces different result over different problem instances. The seed numbers reaching optimum solution over particular instances are captured for future processing. The similar seed will produce similar sequences of random number. Thus here we have a lot of choices of initial quality seeding. Figure 2 to figure 6 below is a snapshot of Tp_HEA performance on five different seed over each problem instances. The figure shows that the effect of similar seed over different problem instances is significantly varied. 42

6 Selecting Quality Initial Random Seed for Metaheuristic Approaches: A Case of tabling Problem Cost Cost Figure 2: easy1.tim Figure 3: easy2.tim C o s t 15 C o s t Figure 4: easy3.tim Figure 5: easy4.tim International Journal of The Computer, the Internet and Management Vol. 16. No.1 (January-April, 8) pp

7 Abu Bakar Md Sultan, Ramlan Mahmod, Md Nasir Sulaiman, and Mohd Rizam Abu Bakar good seeding can be chosen according to criteria stated below. Choose seeding that gives gradually constant improvement within timeframe given. Choose seeding that seems to give faster convergent within timeframe. C o s t We do believe there exists relationship between metaheuristic operator and random seeding that determines the way metaheuristic should behave. Our future efforts, we are looking to these matters in order for us to get better insight of the metaheuristic approaches. Acknowledgements 8. Conclusion Figure 6: easy5.tim This paper analyzes the effect of different random seed to the performance of metaheuristic algorithm. The result indicates that some of the seed produce quality initial solution and some do not. The process of selecting quality random seeding for the timetabling problem is presented as guidance to metaheuristic developer for preparations initial data set with the goal to enhance the quality of the end results. The result also gives us evidence that each random seeding provides unique exploration and exploitation over search spaces for metaheuristic algorithm. We propose two procedures to choose quality random seeding in order to get better result. The algorithm should be executed within some shortest predefined time on number of trials. The This research is sponsored by grants IRPA EA1 from Ministry of Science, Technology and Innovation Malaysia (MOSTI). References [1] Carter, M.W., Laporte, G. (1997). Recent Development in Practical Course tabling. In Edmund Burke and Carter W., Editors, Practice and Theory of Automated tabling, pages 3-19 LNCS 148, Springer. [2] Burke E.K., Elliman D.G.,and Weare R.F (1995). A Hybrid Genetic Algorithm for Highly Constrained tabling Problems, Proceedings of the 6th International Conference on Genetic Algorithms (ICGA'95, Pittsburgh, USA, 15th-19th July 1995), pp 65-6, Morgan Kaufmann, San Francisco, CA, USA. [3] Jones, T., (1995) Evolutionary Algoriths, Fitness Landscape and 44

8 Selecting Quality Initial Random Seed for Metaheuristic Approaches: A Case of tabling Problem Search. Ph.D dissertation, University of The new Mexico. [4] Kostuch, P., Socha, K. (4). Hardness Prediction For University Course tabling Problem. Proceeding of The Evolutionary Computation in Combinatorial Optimization (EvoCOP 4), Coimbra Portugal. [5] Rossi-Doria, O., Sampels, M., Birattari, M., Chiarandini, M., Dorigo, M., Gambardella, L.M., Knowles, J., Manfrin, Max., Mastrolilli, M., Paechter, B., Paquete, L., & Stutzle, T. (3) A comparison of the Performance of Different Metaheuristics on The tabling Problem. In E.Burke and P. De Causmaecker (Eds): PATAT 2, LNCS 274, pp , Springer. [6] Schaerf, A.(1999) A Survey of Automated tabling. Artificial Intelligent Review. 13, [7] Blum, C., Roli, A. (3) Metaheuristic in Combinatorial Optimization: Overview and Conceptual Comparison, ACM Computing Survey, 35, pg [8] Glover, F. and Laguna, M (1997) Tabu Search, Kluwer Academic Publisher. [9] Osman, I., Laporte, G. (1996) Metaheuristic: A Bibliography, Annals of Operation Research, 63, pg International Journal of The Computer, the Internet and Management Vol. 16. No.1 (January-April, 8) pp