The perturbation phase of Saviniec et al.’s method consists of a single TQ move that ran- domly chooses between two periods. We believe that a modification in this perturbation phase will help improve its results if it is explored more. Furthermore, applying relaxed rules might help find a better solution.
3.6.1 Two ILS-TQ (2TQ)
The problem with a single random TQ move is that it might get canceled in the local search phase with another TQ move. So, in order for this not to happen, two TQ moves are applied instead of one.
Figure 3.3 shows an example of this method applied to a schedule with teachers’ ids.
The timeslots are randomly selected, the second conflict graph is built after one connected component from the first graph has been swapped. The new schedule after the second TQ move is the new neighbor. The blue component from the first conflict graph has been chosen, and the green component from the second conflict graph was chosen.
Figure 3.3: 2TQ applied to two schedules with teachers’ ids. a) two random timeslots (t9 and t15) are selected and the requirements in the blue connected component are swapped.
b) Two random timeslots (t4 and t10) are selected and the components in the green connected component are swapped. Conflicts are highlighted in blue, red and green in the conflict graphs.
Figure 3.4: RR applied to one schedule with teachers’ ids. The upper schedule S is the best found so far, and the lower schedule S0 is the current one after a local search. Its new score is only to compare against the best solution found.
3.6.2 Relaxed Rule (RR)
The original ILS-TQ has no relaxed rules, meaning that it will not accept solutions that are worse than the best one. This is not a perturbation operator per se, but it will allow more solutions to be explored. This is a rule used by Fonseca and Santos (2014) that im- proved over their variations. In other words, the evaluation function of the new solution f(S”) is replaced by f(S”)−α × ρ(S, S”) where S” is the new solution, S is the best solution, α is 1.0, andρ(S, S”) is the distance between the two solutions (i.e. the number of cells between the two solutions are different). This relaxed rule is placed at Line 11 in Algorithm 2
Figure 3.4 shows this relaxed rule applied to a scheduleS0 that has been found after a local search (i.e. lower schedule). The upper schedule S is the best schedule that has a score of f(S), whereas the current schedule has a score of f(S0), its new score is only used to compare against the best solution found.
3.6.3 Random Swaps per Class (SC)
This perturbation consists in swapping two random periods for each class that is chosen randomly. This perturbation does not get canceled like the original perturbation phase.
This is a modified version of the local search used in the second SA by Zhang et al. (2010).
Figure 3.5 shows an example of this method applied to a schedule with teachers’
ids. Classes are selected in a random order and timeslots are randomly chosen. For c0, timeslots t4 andt16 are swapped;c2, timeslotst3 and t7 are swapped;c1, timeslotst19and t20 are swapped.
Figure 3.5: SC applied to the current schedule with teachers’ ids. In each step, a random new class is chosen, and two timeslots are randomly chosen to be swapped.
3.6.4 Change Random Column (CC)
This move copies a random i−th column of the best solution to the current solution’s i−th column, and replaces the new solution’s requirements with extra periods with those that lack periods. This is one operator used by the technique by Skoullis et al. (2016)
Figure 3.6 shows how this method is applied to the current schedule. The fifth column (i.e. timeslot t4) was randomly chosen from the best schedule (upper one) to be copied to the current schedule. However, in order to copy this column, timeslots t4 and t11 are chosen for class c0, and timeslots t4 and t7 are chosen for class c1 to be swapped so that the current solution’s second column can be the same as the best schedule’s.
3.6.5 Swap Three Requirements (S3R)
This operator swaps requirements r1, and r2, and then it swaps requirements r2, and r3 for each node in the components generated in the two conflict graphs for three random timeslots t1, t2, t3. This is a modification of the operator by Yousef et al. (2013), but applying the TQ operator.
Figure 3.6: CC applied to the current schedule with teachers’ ids with timeslot t4 as the chosen column to copy from the best schedule. Timeslotst11and t7 are chosen for classes c0 andc1 respectively, and swapped with timeslott4. Finally, the column has been copied.
Figure 3.7 shows an example of this method applied to a current schedule. This is similar to the method 2TQ, except for the fact that the last timeslot chosen in the first TQ move is the first timeslot chosen in the second TQ move. In this case, timeslots t9 and t15 have been chosen in this order for the first TQ move, and the blue connected component has been chosen. So, timeslots t15 and t21 have been chosen in this order for the second TQ move, and the blue connected component has also been chosen.
3.6.6 Simulated Annealing (SA) Cooling Scheme
We decided to implement the SA cooling scheme within our implementation of the Iterated Local Search Torque ILS-TQ. Similar to the method RR, this may also accept worse re- sults, but according to the following criterion: r < ef(S)−f(S”)t modified from Zhang et al.
(2010) where r is a random number between 0 and 1 inclusive, f(S) is the score of the best solution, f(S”) is the score of the current solution and t is the temperature. The latter is a parameter that is tuned, but the temperature changes according to a cooling scheme given by t = α×t where α is the cooling rate and this parameter is also tuned.
The criterion is placed in the local search and evaluated when the current solution S” is worse than the best solution found so far S (i.e. after Line 12 in Algorithm 2). However, the cooling scheme can be placed at the end of each iteration or at the end of each loop in the local search (the temperature is reset at the start of each local search). The former is the SAO whereas the latter is the SAI. A hybrid method is also proposed using the SAI
Figure 3.7: S3R applied to one schedule with teachers’ ids. a) TQ move applied to the current schedule. b) Another TQ move applied to the new schedule with timeslot t15 as the common timeslot. Conflicts are highlighted in blue and red in the conflict graphs.
Figure 3.8: SAI overview. Both the acceptance criterion and the cooling scheme are applied inside the local search, the latter is applied at the end of the local search.
cooling scheme and the 2TQ perturbation operator.
Figure 3.8 and Figure 3.9 show the difference between the SAI and the SAO. The difference is that the former applies the cooling scheme inside the local search (i.e. after Line 15 in Algorithm 2), whereas the latter applies the cooling scheme outside and after the local search (i.e. after Line 18 in Algorithm 3).