The Choice of Moves

The performance of any application of simulated annealing is highly dependent on the method used to select a new trial configuration of the system for the Metropolis update. In order for the annealing algorithm to work well, it must be able to effectively sample the parameter space, which can only be done with efficient moves. The simplest method for choosing a move is to swap the rooms or timeslots of two randomly selected classes. However this is extremely inefficient, since most of the time random swapping of classes will increase the overall cost, especially if we are already close to obtaining a valid solution (i.e. at low temperature), and will likely be rejected in the Metropolis procedure. This low acceptance of the moves means this simple method is very inefficient, since a lot of computation is required to compute the change in cost and do the Metropolis step, only to reject the move. What is needed is a strategy for choosing moves that are more likely to be accepted. A simple example is in the choice of room. If we randomly choose a new room from the list of all rooms, it will most likely be rejected, since it may be too small for the class, or an auditorium when, for example, a laboratory is needed. One possibility is to create a subset of all the rooms which fulfill the hard constraints on the room for that particular class, such as the size and type of room. Now we just make a random selection for a room for that class only from this subset of feasible rooms, with an acceptance probability that is sure to be much higher. In addition, each class in our data set comes with a ``type-of-space-needed'' tag which is used along with other information to assign the class to the right room. This effectively separates the updates into independent sets based on room type, so for example, laboratories are scheduled separately from lectures. In our method we carry out the scheduling of lectures first, followed by scheduling of laboratories making sure that during the course of this process no lecture and its associated laboratory are scheduled in the same time period. In effect, we have embedded a simple expert system into the annealing algorithm in order to improve the choice of moves, as well as using a more complex expert system as a preprocessor for the annealing step. To improve further on the move strategy, we can take the subset of possible move choices that we have created for each class, and choose from them probabilistically rather than randomly. There may be certain kinds of moves that are more likely to be effective, so our move strategy is to select these moves with a higher probability. For example, swapping a higher level class (e.g. graduate) with a lower level class (e.g. a first or a second year type) generally has a higher acceptance, since there is little overlap between students taking these classes. Furthermore, we have experimented with two kinds of swaps, those that only involve classes offered by the same department or college and the second, swaps between classes of different departments and colleges. As illustrated in Figure #classswaps#485>, swapping is done as follows: Given a certain college or a school, let say school(i), we randomly pick a department, let say A. Based on the given constraints, we carry class swapping within department A making sure that no cycling occurs. The second step is to swap classes between A and another randomly selected department, let say C, within school(i). The third step of class swapping takes place within department C. This process of swapping continues within the same school provided all room and time constraints are satisfied and also no cycling of the same departments or classes occurs. We refer to this phase of swapping as ``local'' since it only involve classes either of the same department or classes of departments that belong to the same school or college. As previously mentioned, associated with each department a list of buildings where it assign its classes to. The first building in the list is the home building and always the first preference for class assignment. If the tag name ``others'' appears in the list then the department has an option of swapping its classes with those of any other department of not only the same school but with others as well. This ``global'' swapping has to be done in such a way that all constraints involved and room preferences for both classes are satisfied. We observed that the overall rate of acceptance of swapping classes of the same departments or schools is higher than the overall rate of acceptance swapping classes of different departments of different schools. We could say that one of the reasons for this is that classes of the same departments or schools are associated with the same subset of rooms that satisfies those constraints involving distance and department preference. Therefore, the likelihood of satisfying the constraints of room availability, capacity, and type within that group of rooms is much greater than if it is the otherwise case. In addition, departments and schools in our test data always prefer to have their classes (especially the lower and the upper level) spread out into as many time slots as needed, in turn minimizing, if not totally eliminating, any overlap that may occur between them. Consequently, the likelihood of any time conflict occurring after any department two-class swap is quite low. Furthermore, we observed that those acceptance rates drop off with the decrease in temperature. Another move strategy we have followed is that since constraints involving capacity of rooms are hard ones, we scheduled larger classes first to try to avoid not having large enough rooms later for those class sections with large enrollments. Generally, the swap methods we have taken here can be considered as heuristics for pruning the neighborhood or narrowing the search space, which provides much more efficient moves and in turn an overall improvement in the results.

#figure487#
Figure: A pictorial view of the class swaps. Three kind of swaps are shown: first, class swapping within the same department; second, class swapping between two departments; three, class swapping between two departments of different schools. The first two types of swaps are classified as (local) within the same dept/school while the last one (global) involving different schools.