Specialised Recombinative Operators for ... - Semantic Scholar

50 downloads 41 Views 38KB Size Report
Edmund Burke, David Elliman and Rupert Weare. Department of Computer Science,. University of Nottingham, UK. http://tawny.cs.nott.ac.uk/ttg/index.html.
Specialised Recombinative Operators for Timetabling Problems Edmund Burke, David Elliman and Rupert Weare Department of Computer Science, University of Nottingham, UK. http://tawny.cs.nott.ac.uk/ttg/index.html

Abstract. This paper discusses a series of recombination operators for the timetabling problem. These operators act upon a direct representation of the timetable and maintain the property of feasibility. That is that there are no conflicts and no overfilled rooms. Various approaches to solving the timetabling problem using evolutionary computing methods are first compared. The recombination operators are then presented and various alternatives for incorporating heuristic knowledge in the search are described. Finally, results are presented comparing the operators on a real timetabling problem.

1 Introduction Recently, there has been a lot of attention paid to the problem of automating the construction of university course and examination timetables. Many different techniques have and are being applied, including Simulated Annealing [14][20], Constraint Logic Programming [2][17], Linear Programming [21] and Graph Colouring Heuristics [5]. A growing number of researchers are now turning to Evolutionary Algorithms [8][10], or evolutionary hybrids [4][7][18][19], as a powerful method of solving difficult timetabling problems. Various alternatives on the evolutionary theme have been applied successfully to real situations and some are now used regularly to produce course and examination schedules. At its simplest, timetabling is the problem of scheduling a set of events (for example: exams, lectures, tutorials) to specific time slots such that no person or resource is expected to be in more than one location at the same time and that there is enough space available in each location for the number of people expected to be there. These two main fundamental constraints, and many others, combine to make timetabling a classically hard problem to solve. Several major problems confront anyone wishing to produce an examination timetable. The first is the actual size of the problem. The examination timetable for the University of Nottingham, for example, consists of over eight hundred exams scheduled over a period of two weeks, repeated twice a year. Each exam, on average, conflicts with about thirty others while the most conflicting exam, an Inter-Faculty Language Course, conflicts with over two hundred other exams. By the term conflicts, we mean the number of other exams which cannot be scheduled in the same period because they have at least one student in common. The biggest single exam, a first year maths course, has over five hundred people taking it.

Clearly an acceptable solution exists, and can be found, because the problem is regularly solved (or altered sufficiently that it may be solved) by universities, though not without many problems and a huge amount of administrative effort. Current approaches in British universities typically involve a heuristic assignment algorithm with a large manual input, if automation is used at all [6]. Using one of these heuristics in a hybrid Genetic Algorithm can aid the search for a good timetable and ensure that we do not produce worse solutions than are already found. A second problem that appears in all complex timetabling problems is the variety and large number of, sometimes non-compatible, constraints. Heuristic assignment algorithms do not easily allow for the possibility of search and strongly limit the type of constraints that may be catered for. By having a separate evaluation function, the timetabler can encode and alter any (or all) of these to produce the timetable required rather than one restricted by the assignment algorithm. Clearly there are still problems with this approach. A particular problem is that some constraints are viewed as hard (and therefore cannot be violated) whereas others are viewed as soft (and may be violated but only if absolutely necessary). It is very possible that the hard constraints may be swamped by the large number of soft constraints just because of the way that they are represented. This may be overcome by redefining the search space in such a way as to not allow infeasible timetables i.e. those with exam clashes or with more exams scheduled than there is space to house them. Consequently, we must also redefine the crossover and mutation operators so that they do not produce infeasible timetables and the initial population must be specially generated (in this case using a graph colouring algorithm[4]).

2 A Review of EC Approaches Evolutionary algorithms have been used for a number of years in the field of timetabling. A number of different varieties have been proposed, based both on the standard genetic algorithm as well as on different hybrid strategies which use previously developed timetabling techniques. The different approaches described to date may be classified using the following categories: the representation, the operators, the search space/penalty function and the use of local search and lamarkism. 2.1 Representation: Direct vs Implicit There are essentially two different types of representation that have been used in evolutionary timetabling. The direct representation encodes the actual timetable, usually as a series of numbers giving the periods in which each exam is to be placed [1][4][10][18]. The implicit representation, on the other hand, encodes a set of instructions as to how the timetable should be built [13][19]. A timetable builder then uses those instructions to produce a timetable. The fitness of the chromosome encoding the instructions is taken to be equal to the fitness of the timetable that is generated using them. 2.2 The Search Space and Penalty Functions The most common form of penalty function used on the timetabling problem is the

sum of constraints broken, multiplied by a weighting, over all the constraints that are being considered. Two timetabling constraints, in particular, are required in a feasible timetable (as defined above) whereas other constraints are usually considered desirable but a timetable might be used even with a few broken. This has led a number of researchers to restrict the search space explored by the genetic algorithm to only feasible timetables. A problem arises since, if exams are selected one by one to be placed into a fixed-length timetable, it is likely that at some point there will be no period where the current exam will not conflict with those already placed. This may be seen to be similar to the tiling problem (figure 1) where different shape tiles are placed into a tray with the aim of exactly covering the tray. In the latter problem we are usually assured that a particular pattern of tiles will fit exactly, we can hope also that a particular feasible schedule of exams will fit in the timetable. We cannot, in general, know this to be the case. While we are searching, something must be done with the exams that are not yet placed in our required timetable. What we do with the exams influences measure the quality of the timetable is measured. Three different schemes have been developed as follows. Option 1: Allow (and count) conflicts [10] Option 2: No conflicts, count those that may not be scheduled [19] Option 3: No conflicts, count the extra number of periods required [4]

Option 1: Put unused pieces on top of the others and measure the maximum height Option 2: Leave unused pieces in a pile and measure its size

Option 3: Stretch the box and measure the extra area required Figure 1. Timetable Search Space and Penalty Functions The nature of the search space will affect how easy it is to find a good timetable. Restricted search spaces will be more dense in feasible timetables but may, in conjunction with the genetic operators, make the best timetable harder to attain. Each approach also hides an implicit assumption as to what will be accepted if a timetable with the required qualities is not found. In the first case, if no feasible timetable is found, the schedule produced will be one with a minimal number of conflicts for the given length. If being applied to a course scheduling problem where

the objective is to minimise conflicts rather than eliminate them, then this approach is more appropriate. In the second case, unplaced exams are kept to one side. A timetabler must thus add these manually or change the boundaries of the problem. In the third case, a longer, but still feasible, timetable is produced. This is based on the assumption that extra time, perhaps in the form of evening exams, may be found. 2.3 Genetic Operators Clearly, the genetic operators used will depend on both the representation used and the allowed search space. Corne, Ross and Fang [10] describe experiments showing standard 1-point, n-point and uniform crossover operators on their unrestricted search space with a direct representation. This has produced useful results on some problems but they found that “the pure direct representation did indeed fail on problems of increased difficulty”. These problems are counted by the use of an intelligent mutation operator and an quicker evaluation function allowing more timetables to be evaluated in the same amount of time [23]. Abramson and Abela [1] use a period-based operator but which works in much the same way as normal uniform crossover. Paechter and Cumming [19], with an implicit representation, use a permutation based recombination operator. This acts on the order in which exams are selected to be assigned to slots in the timetable. Corne, Ross and Fang conclude that, “it is doubtless the case that the ‘best’ method (in whatever meaningful sense) will involve an adaptive hybrid search strategy, perhaps uniting ideas from each of classical heuristic search, simulated annealing and EAs”[12]. In this paper, recombination operators are presented which act upon a direct representation of the timetable and maintain the property of feasibility. Heuristic knowledge is incorporated in the operators to aim the search towards promising solutions. 2.4 Local Search and Lamarkism Local search and Lamarkism have also been used to aid the search for timetables. Paechter searches for an alternative slot, if the meeting cannot directly be scheduled [19]. This new period is then written back to the chromosome. Burke, Newall and Weare [8] present a memetic algorithm which uses hill climbing in between each generation. This improves each individual timetable, taking it to a local maxima. Similarly, Ling[8] uses a filtering operator which repairs particular parts of the timetable which violate conflict and spread constraints.

3 Recombination Operators for Timetabling Crossover operators are the way that genetic algorithms cause good combinations of genes to be passed between different members of the population. In a standard genetic algorithm this usually consists of a procedure similar to choosing the first n genes from the first parent and the remaining from the second parent. Such a procedure is obviously not usable in the situation where strong restrictions are placed upon the character of population members (in this case the feasibility requirements) as such an

operator will tend to violate these requirements. Figure 2 shows how the heuristic hybrid recombination operator works for period i. The operator starts by looking at the first period. It takes exams scheduled in that period (in both parents) and then uses a heuristic to select other exams so that none clash with those already scheduled (and the limit on the number of spaces is not violated). Once this is completed, the crossover looks at period two and so on until all exams are placed. The normal domain independent uniform crossover operator, when given a choice, takes alleles randomly from one parent or the other. It is not possible to have strictly transmitting operators within our chosen domain. However, the action of the standard operator may be partially mimicked by choosing an appropriate exam selection algorithm. As well as ensuring that each offspring is feasible, hybrid operators may also use non-payoff information to guide the genetic algorithm towards good solutions; this being information other than the single value returned by the evaluation function. Period i-1

Unscheduled exams are passed on to the next period.

Period i Parent 1

First select those exams scheduled in period i in both parents 1 and 2.

Child Timetable

Extra exams are selected from those scheduled in period i in either parent 1 or parent 2 or left over from period i-1. Any unscheduled are passed onto period i+1. Parent 2 Period i+1

Only exams that do not conflict with those already scheduled for that period may be chosen

Figure 2. A Recombination Operator to Maintain Feasibility We may construct a number of different operators based on the same framework but using alternative selection heuristics. An experiment doing exactly this is discussed below. In each case, once an exam is selected, all other exams that clash with it are labelled as unscheduled for that period. The operators continue to select exams until there are none left to chose from. This makes an assumption about how resources are to be used. Exams will always tend to be concentrated near the beginning of the examination session in the final timetable, no matter which heuristic is used to select exams. This is a common requirement in real timetabling problems as it gives extra time for the marking of scripts. Eight different selection heuristics are described below including two that are

combinations of the others. 3.1 Random Choice (random) The next exam to be placed in the Child timetable is chosen at random. This operator may be used as a benchmark to check whether the heuristic knowledge used by the other crossover operators is having any effect. This should produce a crossover operator most similar to the standard uniform crossover on a binary representation. 3.2 Graph Colouring Heuristics The basic timetabling problem is widely known to be equivalent to that of graph colouring and therefore it is likely that graph colouring heuristics may be able to help the search. The following heuristics have been used in slightly different ways to construct timetables. Largest degree refers to an ordering of the exams according to the number of other exams they conflict with (the degree of the vertex in the conflict graph). Exams are then taken one by one and placed into the first available period with no conflicts although exams may be chosen period by period. The second heuristic specifically chooses exams for one period at a time, exams are chosen so they do not conflict with those already scheduled in that period. This method for heuristically constructing timetables was the motivation behind the development of the recombination operator described. Largest Degree (large) Exams are selected according to the number of other exams they conflict with. This is a widely known graph colouring heuristic [23] that is used with the sequential graph colouring algorithm. The motivation behind this heuristic is that the hardest exams to schedule should be scheduled first which empirically produces better timetables than a random ordering. Using this ordering may therefore encourage the production of better timetables. Most Similar (similar) Exams are selected according to how many conflicts they have in common with those already scheduled. This is a graph colouring heuristic presented in [5] . This is a more recent, more advanced version of Largest Degree which takes exams from the conflict graph according to how close they are (in the graph) to those already scheduled. It is concerned more with factors related to the current schedule than is the previous operator and is the most computationally expensive of all the operators described. 3.3 Specifically Designed Heuristics As well as using already known heuristics for the timetabling problem, we may generate new ones based on the genetic search space. Neither of the following heuristics have any basis in graph colouring or timetabling methodologies. The first two are specifically designed to address one of the two criteria that are to be optimised; the length of the timetable or the number of second order conflicts.

Reducing the Length of the Timetable (late) Exams are selected according to where the same exam is scheduled in the other parent. The later it is scheduled in the other parent, the more likely it is to be selected in the current search. Since unplaced exams are passed on to the next period, this increases the chances of shortening the length of the timetable by collapsing the last periods. Reducing Second order Conflicts (spread) Exams are selected so as to minimise the number of conflicts with exams in the previously scheduled period. This need not necessarily result in a longer timetable but generally does. Exams are still continually selected until all those remaining either conflict with at least one scheduled in Child or a maximum size limit is reached. The Crossover algorithm may easily be adjusted to remove any second order conflicts from the timetable by only picking exams that do not clash with those in the previous period. This would only work usefully if there is a size limit on the number of candidates that may be scheduled at once. Otherwise, every other period will be empty. Maintaining the Proximity of Exams (proximity) One criticism that has been levelled against the use of standard crossover operators is that they ignore “the notion that what is good about any timetable is the temporal relationship between events, rather than their absolute times”[12]. Proximity is designed specifically to use this idea. A score is devised for each exam that may be selected. This score is made up of the following factors. Suppose an exam e1 has been chosen in a period i and exam e2 has been chosen for period i-1. For each of the exams left, their score is increased by 2 if they are scheduled in the same period as e1 in the other parent. If they are over one period apart then the exam’s score is reduced by 1. Similarly, if they are adjacent to e2 in the other parent then their score is increased by 1. The exam that has the largest score is then chosen. 3.4 Combined Operators Finally, the following two operators are examples of how the above heuristics may be combined into a single operator that may take account of more than one factor at any one time. Late and Spread evolving (late|spread) The late and spread operators are used together. With each timetable is a flag saying which of the two to use, the first parent deciding how they are to recombine. Initially, they are assigned at random to each timetable but as the search continues, the selection function acts upon the operators as well as the timetables so that the one that is producing the best timetables is used more often. A simple mutation operator swaps them round with probability 0.05. Proximity+late (proximity+late) This operator simply sums the proximity score and the position of the exam in the

other parent. This new score is used to decide which exams to pick.

4 Results Figure 3 gives the results of applying the above crossover operators to a real timetabling problem. This data is available from Michael Carter (ftp: ie.utoronto.ca / mwc/testprob/kfu.*). In this problem there is a maximum number of 1955 students that may be scheduled in the same period. The number of second order conflicts given is the total from all periods; no allowance is made for overnight rests. No claims are made about the optimality of the parameters used, rather the problem is used to demonstrate the relationship between operators. Experiments show, however, that the algorithm is fairly robust with respect to selection rates and population size. The parameters used are exponential rank based selection with selection pressure 0.986 and a population size of fifty. The penalty function used was: 1000*(length of timetable-ideal length)+ number of second order conflicts. This essentially prioritises the constraints into length first and event spread second. 800

700 Second order conflicts

Large Similar Proximity+Late

600

Late

500

Late | Spread

400 Best after hill climbing 300 19

20 21 22 23 24 Length of Timetable in Periods

25

Figure 3. Length vs second order conflicts for KFU timetables

A hill climbing procedure is also used after the G.A. has produced its final output. This tends to equalise the number of exams in each period and consequently reduces the number of second order conflicts. Before this operation, the exams will be concentrated near the start of the timetable. Neither random, spread or proximity heuristics are able to produce timetables shorter than approximately thirty periods long and are therefore not included on the graph. Their use in combination with the late operator does, however, produce even better timetables. The late and spread operators combined, both being created with the specific penalty function used in mind, are the most effective except where the timetable is very short when there is no real difference between operators. It is perhaps surprising that the proximity operator does not perform better alone (other penalty values were also tried) but without a method of shortening the timetable it will not produce useful timetables. The two graph colouring heuristics do produce timetables in the required length (except for similar on 19 periods which produced one twenty periods long) but still not as good those designed for the given penalty function.

5 Conclusions Evolutionary algorithms show great promise in the area of educational timetabling, particularly in their ability to consider, and optimise, the wide variety of different constraints that may be found in universities. It has been shown that by considering hybrid crossover operators incorporating heuristics, some of which have been used for graph colouring, good quality timetables may be produced. The results given have largely been based around the idea of reducing the length of the timetable. This has been the traditional aim of the heuristic algorithm and provides one of the greatest challenges to timetabling procedures. In this, the genetic algorithm has proved to be an effective optimisation tool. Hard-coding the fundamental, unbreakable, constraints into the algorithm, increases the probability that an appropriate solution can be found (if one exists) and no number of extra soft constraints will cause an infeasible timetable to be found. In this though, the assumption is made that if no timetable of the required length may be found, the next best thing is one that is feasible but slightly longer. This is what the heuristic sequential algorithm, which has been widely used on timetabling problems, would do in the same situation. By using (a combination of) specially developed heuristic operators, such as late and spread, the search can be guided towards the best sector of the solution space and hence the best timetables. Many other possibilities exist for the construction of heuristic crossovers. For example, the late criteria may be given priority when there is a chance of reducing the timetable length by clearing the last period and otherwise other operators may be used. Different operators may also be altered to take into account those scheduled in the previous period as well. Evolving operators on a period by period basis may also result in more effective operators. Since no comparison has yet been made between different styles of genetic algorithm for the timetabling problem, it is hard to say which will prove most effective, if indeed one does dominate at all. It is widely believed now that the most successful timetabling systems of the future will incorporate both elements of advanced search

techniques and heuristics. There must necessarily be a trade-off between the amount of heuristic knowledge used in an algorithm and its speed (and therefore number of evaluations made). We may hope that the heuristic knowledge more than compensates for the extra time required to use them. There cannot, however, be a trade-off between finding a solution or not finding one. Hybridisation may be incorporated into the genetic algorithm in several other ways. Graph colouring heuristics may be used to seed the initial population with the best available heuristic solutions thus guaranteeing that the worst possible solution produced was the previous best solution. Mutation operators may also take account of, for example, the number of conflicts in a particular part of a timetable. They might also be altered to take into account the most important temporal relationships of being in the same or adjacent periods. As Davis says “It [the hybrid algorithm] will almost certainly do better than the current algorithm, since the good features of the current algorithm are part of the hybrid algorithm, as are the genetic algorithm techniques of population management and crossover.” [13]

References [1] D Abramson and J Abela, (1991) ‘A parallel genetic algorithm for solving the school timetabling problem”, Technical report, Division of Information Technology, C.S.I.R.O., April 1991. [2] Boizumault P., Gueret C. and Jussien N. (1994) “Efficient Labelling and Constraint Relaxation for Solving Time Tabling Problems” International Logic Programming Symposium - Workshop on Constraint Languages and their use in Problem Modelling. pp116-130 [3] Bruns R. (1993) “Knowledge-Augmented Genetic Algorithm for Production Scheduling”, IJCAI ‘93 Workshop on Knowledge based Production Planning, Scheduling and Control. [4] EK Burke, DG Elliman, and RF Weare, (1995) “A Hybrid Genetic Algorithm for Highly Constrained Timetabling Problems,” 6th International Conference on Genetic Algorithms (Pittsburgh, USA, 15- 19 July 1995) . [5] Burke E.K., Elliman D.G. and Weare R.F. (1994) “A University Timetabling System Based on Graph Colouring and Constraint Manipulation”, Journal of Research on Computing in Education. Vol. 27. issue 1, pp1-18. [6] EK Burke, DG Elliman, and RF Weare, (1995) “ Examination Timetabling in British Universities - A Survey”, to appear in proceedings of the 1st International Conference on the Practice and Theory of Automated Timetabling (ICPTAT’95, Napier University, Edinburgh, 30th Aug - 1st Sept 1995). [7] EK Burke, JP Newall, and RF Weare, (1995) “A Memetic Algorithm for University Exam Timetabling” to appear in proceedings of the 1st International Conference on the Practice and Theory of Automated Timetabling (ICPTAT’95, Napier University, Edinburgh, 30th Aug - 1st Sept 1995). [8] Colorni, A., Dorigo, M., Maniezzo, V. (1990) “Genetic Algorithms and Highly Constrained Problems; The Timetable Case”, Parallel Problem Solving from Nature I, Springer-Verlag, pp.55-59.

[9] Carter M.W. (1986) “A Survey of Practical Applications of Examination Timetabling Algorithms” OR Practice 34, pp 193-202. [10] D Corne, HL Fang, and C Mellish, (1993) “Solving the Modular Exam Scheduling Problem with Genetic Algorithms,” Proceedings of the 6th International Conference in Industrial and Engineering Applications of Artificial Intelligence and Expert Systems , pp. 370-373, Gordon and Breach Science Publishers. [11] Corne, D., Ross,P.,Fang H-L (1994) “Fast Practical Evolutionary timetabling”, Lecture Notes in Computer Science 865 , Springer-Verlag, pp250-263. [12] D Corne, P Ross, and HL Fang, (1994) “Evolutionary Timetabling: Practice, Prospects and work in Prgoress”, in the proceedings of the UK Planning and Scheduling SIG Workshop, Strathclyde, September 1994. [13] Davis L. (1991) “Handbook of Genetic Algorithms” Van Nostrand Reinhold [14] Davis L. and Ritter F. (1987) “Schedule Optimization with Probabilistic Search” Proceedings of the 3rd IEEE Conference on Artificial Intelligence Applications, February 1987, Orlando, Florida, USA, pp231-236. [15] Hancock P.J.B. (1994) “An empirical Comparison of Selection Methods in Evolutionary Algorithms”, Lecture Notes in Computer Science 865, Springer-Verlag, pp80-94 [16] Johnson D.S., Aragon C.R., McGeoch L.A. and Schevon C. (1991) “Optimization by Simulated Annealing: An Experimental Evaluation; Part II, Graph Coloring and Number Partitioning” Operations Research 39, pp378-406. [17] Kang L. and White G.M. (1992) “A Logic Approach to the Resolution of Constraints in Timetabling” European Journal of Operational Research 61 pp306317. [18] Ling, S.E. (1992) “Integrating Genetic Algorithms with a Prolog Assignment Problem as a Hybrid Solution for a Polytechnic Timetable Problem”, Parallel Problem Solving from Nature II, Elsevier Science Publisher. pp321-329. [19] Paechter B., Cumming A., Luchian H. and Petriuc M. (1994) “Two Solutions to the General Timetable Problem Using Evolutionary Methods” In the proceedings of the 1994 IEEE Conference on Evolutionary Computing [20] J Thompson and KA Dowsland, (1993) “Multi-Objective University Examination Scheduling,” EBMS/1993/12, European Business Management School, Swansea University, UK. [21] Tripathy A. (1984) “School Timetabling - A case in Large Binary Integer Linear Programming” Discrete Applied Mathematics 35.3 pp313-323. [22] Radcliffe N.J. and Surry P.D. (1994) “Formal Memetic Algorithms”, Lecture Notes in Computer Science 865, Springer-Verlag, pp1-16. [23] P Ross, D Corne and HL Fang, “Improving evolutionary timetabling with delta evaluation and directed mutation”, in Parallel Problem Solving from Nature III, ed. Y.Davidor, Springer-Verlag, 1994. [24] Welsh D.J.A. and Powell M.B. (1967) “An Upper bound for the Chromatic Number of a Graph and Its Application to Timetabling Problems” Comp. Jrnl. 10, pp85-86.

Suggest Documents