• No results found

An Evaluation of the Great Deluge Algorithm in Course Timetabling: As Applied to the KTH-Inspired University Course Timetabling Problem

N/A
N/A
Protected

Academic year: 2022

Share "An Evaluation of the Great Deluge Algorithm in Course Timetabling: As Applied to the KTH-Inspired University Course Timetabling Problem"

Copied!
38
0
0

Loading.... (view fulltext now)

Full text

(1)

IN

DEGREE PROJECT TECHNOLOGY, FIRST CYCLE, 15 CREDITS

STOCKHOLM SWEDEN 2019,

An Evaluation of the Great Deluge Algorithm in Course Timetabling

As Applied to the KTH-Inspired University Course Timetabling Problem

SIMON SIRAK

KRISTOFFER CHAMMAS

KTH ROYAL INSTITUTE OF TECHNOLOGY

SCHOOL OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE

(2)

En utvärdering av The Great Deluge på KTH-inspirerade University Course

Timetabling Problem

SIMON SIRAK

KRISTOFFER CHAMMAS

Degree Project in Computer Science, DD142X Date: June 5, 2019

Supervisor: Alexander Kozlov Examiner: Örjan Ekeberg

KTH Royal Institute of Technology

School of Electrical Engineering and Computer Science

(3)
(4)

iii

Abstract

The University Course Timetabling Problem (UCTP) can be loosely described as assigning events (e.g lectures) to rooms and timeslots in a way that results in a feasible timetable that is optimal according to some custom criteria. The problem has become increasingly relevant as more programs become available in universities. Due to the complexity of UCTP, the problem is usually solved approximately using heuristics.

The KTH-inspired UCTP is a variant of the UCTP that is adapted to KTH Royal Institute of Technology. However, few heuristics have been implemented for this variant of UCTP. Therefore, this study introduces an implementation of The Great Deluge heuristic to the KTH-inspired UCTP, and compares it to a state-of-the-art solver for KTH-inspired UCTP.

The Great Deluge implementation was compared against the state-of-the- art KTH-inspired UCTP solver for different time limits. For each time limit, the output timetable quality was recorded over several executions. The com- parison was done on two problem instances of varying complexity.

The results suggest a behavior that varies over time. For larger time limits, GD produced better timetables than the state-of-the-art and the overall quality of timetables was consistent over several executions. For smaller time limits, GD produced worse timetables than the state-of-the-art and the overall quality of timetables was inconsistent over several executions.

A few potential causes for the improved performance during the later stages of execution were found through further analysis of the results. Perhaps the biggest potential cause was utilizing the greedy behavior obtained during the mid to late stages of execution.

(5)

iv

Sammanfattning

”The University Course Timetabling Problem” (UCTP) handlar i grova drag om att, baserat på ett antal kriterier, schemalägga föreläsningar, övningar och laborationer på ett optimalt sätt. Problemets relevans har ökat allt eftersom universitet utökar sina programutbud. På grund av komplexiteten hos UCTP löses problemet vanligtvis approximativt med hjälp av heuristiker.

”KTH-inspired UCTP” är en KTH-anpassad variant av UCTP för vilken endast ett fåtal heuristiker har implementerats. Denna variant har exempelvis inte lösts av en vanlig heuristik inom UCTP, ”The Great Deluge” (GD). Denna studie fokuserar därför på att applicera GD på ”KTH-inspired UCTP” och jäm- föra denna med äldre implementationer, med fokus på den bästa tillgängliga implementationen.

GD-implementationen jämförs med den bästa tillgängliga implementatio- nen för ”KTH-inspired UCTP” för olika tidsgränser. Kvaliteten hos de resulte- rande schemana evalueras och sparas sedan över flera körningar. Jämförelsen gjordes på två probleminstanser av olika komplexitet.

Resultatet av jämförelsen föreslår att GD producerade bättre scheman för högre tidsgränser men sämre scheman för lägre tidsgränser. Vidare analys fö- reslår att denna förbättring beror på utnyttjandet av det giriga beteendet som vår GD-implementation uppvisar vid senare delar av exekvering.

(6)

v

Acknowledgements

We would like to thank our supervisor for his guidance and support throughout this study.

(7)

Abbreviations

GD The Great Deluge.

SA Simulated Annealing.

UCTP University Course Timetabling Problem.

vi

(8)

Contents

1 Introduction 1

1.1 Problem Statement . . . 2

1.2 Scope . . . 2

2 Background 3 2.1 Local Search Heuristics . . . 3

2.2 The Great Deluge . . . 3

2.3 KTH-inspired UCTP . . . 4

2.4 Neighborhoods Used in UCTP . . . 5

2.5 Previous Efforts in UCTP . . . 6

2.5.1 General Efforts . . . 6

2.5.2 Efforts in KTH-inspired UCTP . . . 7

3 Methodology 9 3.1 The Algorithm . . . 9

3.2 The Fitness Function . . . 10

3.3 The Neighborhoods . . . 10

3.3.1 Choice of Neighborhoods . . . 10

3.3.2 Choice of Combination . . . 11

3.4 The Problem Instances . . . 11

3.5 The Comparison . . . 12

4 Results 14 5 Discussion 17 5.1 Results . . . 17

5.1.1 Fitness . . . 17

5.1.2 Consistency . . . 18

5.1.3 Reliability of Results . . . 19

5.2 Proposal for Further Research . . . 20

vii

(9)

viii CONTENTS

5.3 Relation to Research Questions . . . 21

6 Conclusions 22

Bibliography 23

A KTH-inspired UCTP instances 25

A.1 Medium Problem Instance . . . 25 A.2 Large Problem Instance . . . 27

(10)

Chapter 1 Introduction

The University Course Timetabling Problem (UCTP) can be loosely described as assigning events (e.g lectures) to rooms and timeslots in a way that results in a feasible timetable that is optimal. A feasible solution is defined by the hard constraints of the specific problem, and the quality of a solution is derived from the soft constraints. A hard constraint could be to disallow a student to have more than one lecture simultaneously, and a soft constraint could be preference-based, such as not having several lectures in succession.

UCTP is becoming an increasingly important topic as more programs be- come available in universities. This variety has led to an increased complexity in scheduling lectures and other activities for the students of a specific program [1]. In order to accommodate for this complexity, it is appropriate to automate the scheduling process using algorithms.

UCTP is an NP-hard combinatorial optimization problem [2], meaning the task of finding an optimal solution is computationally intractable for large in- put sizes. Therefore, tremendous effort has been put into constructing heuristic algorithms with the intent to construct a feasible timetable that is not neces- sarily optimal, in a reasonable amount of time.

One heuristic that is commonly used for solving variants of UCTP is the Great Deluge algorithm [3, 4, 5, 6]. It is a heuristic that is considered easy to configure, only having one parameter. This makes it a strong candidate for use by individuals with no domain-knowledge.

However, there is a lack of experimentation with The Great Deluge algo- rithm in research related to UCTP for Royal Institute of Technology. Yamazaki and Pertoft [7] constructed the KTH-inspired UCTP with a number of problem instances and applied a Genetic Algorithm heuristic to them, only taking hard constraints into consideration. Norgren and Jonasson [8] constructed a hybrid

1

(11)

2 CHAPTER 1. INTRODUCTION

algorithm by combining Yamazaki’s Genetic Algorithm with their own imple- mentation of Simulated Annealing, taking some soft constraints into consid- eration as well. We will build upon the current research by introducing the Great Deluge algorithm into the KTH-inspired UCTP.

1.1 Problem Statement

The aim of this study is to investigate the performance of the Great Deluge algorithm in KTH-inspired UCTP. In particular, we would like to answer the following research question:

• For the KTH-inspired UCTP, how does our implementation of the Great Deluge algorithm compare to other heuristic implementations with re- spect to:

– the number of soft constraint violations;

– the consistency between resulting timetables over several execu- tions?

1.2 Scope

We will mainly compare against the results of Norgren and Jonasson [8], due to their implementation being available online. They are also (as of the publi- cation of this study) one of very few that include both soft and hard constraints in their KTH-inspired UCTP solver. Furthermore, the implementation of Nor- gren and Jonasson [8] can be considered the state-of-the-art for KTH-inspired UCTP (see section 2.5.2 for further motivation), which makes it a good refer- ence solver for this problem.

(12)

Chapter 2 Background

The chapter is divided into five sections. The first section describes the pre- requisites in Local Search Heuristics needed to understand the components of the Great Deluge algorithm. The second describes the Great Deluge algo- rithm. The third section defines the KTH-inspired UCTP. The fourth section describes common and relevant neighborhoods used in various UCTP solvers.

Finally, the fifth section presents relevant previous efforts in UCTP.

2.1 Local Search Heuristics

For a given problem, a Local Search Heuristic operates by making perturba- tions to a current solution of that problem, in order to find an improved solution according to some acceptance criteria. The set of modified solutions (neigh- bors) are defined by a number of neighborhoods combined according to some structure (examples of neighborhoods can be found in section 2.4). The qual- ity of a solution is defined by a fitness function, which calculates an overall quality measure (“fitness”) given a solution. The acceptance criteria defines which neighbors can be accepted to replace the current solution.

2.2 The Great Deluge

The Great Deluge algorithm (GD) is based on the notion of escaping a deluge by staying above the water level without drowning. In the context of GD, this water level represents a fitness threshold, and is used to define the acceptance criteria of GD. In particular, GD accepts any modified solution that has a better fitness than the water level or the current solution. Throughout the execution of GD, the water level rises towards the expected optimum fitness.

3

(13)

4 CHAPTER 2. BACKGROUND

The rate at which the water level rises is determined by a decay function. In the original GD algorithm, the decay function is a simple linear decay function with no other modifications to the boundary. However, many GD implemen- tations use variations of the standard algorithm by applying non-linear decay functions or decay functions that reconfigure the boundary whenever it is ap- propriate. This is also true in the context of UCTP [3, 5, 6].

Algorithm 1 describes the standard GD as presented by Dueck [9], where initial is an initial solution, F is a fitness function and decay is a decay func- tion based on some decayRate. We will assume that an improved fitness is signified by an increase, similar to the water level analogy.

Algorithm 1 The Great Deluge

1: boundary = F(initial)

2: current = initial

3: best = current

4: set decayRate

5: while ¬T imeLimitExceeded do

6: choose neighbor from Neighborhoods

7: if F (neighbor) > F (current) then

8: current = neighbor

9: if F (neighbor) > F (best) then

10: best = neighbor

11: else if F (neighbor) > boundary then

12: current = neighbor

13: decay(boundary)

14: return best

2.3 KTH-inspired UCTP

The problem description chosen for this study was described by Norgren and Jonasson [8], the KTH-inspired University Course Timetabling Problem. The KTH-inspiration comes from the specific constraints and problem instance for- mat. A problem instance consists of:

• A set of events that are to be scheduled;

• A set of teachers that supervise the events;

(14)

CHAPTER 2. BACKGROUND 5

• A disjoint set of student groups, where each student group is defined as a set of students that take the same courses;

• A set of rooms in which events can take place;

Each event is defined by a course, a teacher, a student group and an activity type. As such, each student group can be seen as having its own instance of a course. The activity type can be one of LECTURE, EXERCISE or LAB.

Furthermore, each room has an activity type associated with it.

A solver should schedule all the events into one week of 20 timeslots (5 days of 4 timeslots each) and a room such that the following hard constraints are all satisfied:

• A room cannot be used for multiple events at the same time (H1)

• Students cannot attend more than one event at the same time (H2)

• Teachers cannot supervise more than one event at the same time (H3)

• An event must be assigned to a room with the required room type (H4) Furthermore, the goal of the solver should be to minimize the number of vio- lations of the following soft constraints (S):

• No more than one lecture per day in each course (S1)

• All lectures belonging to the same course should be held in the same room (S2)

• No events in the last timeslot of a day (S3)

• Students should not have a day with only one event (S4)

• A room cannot hold more students than its capacity (S5)

2.4 Neighborhoods Used in UCTP

In UCTP, two neighborhoods frequently used are Nmove and Nswap. Given a current timetable, Nmove consists of all timetables achievable by moving a single event to another empty timeslot-room pair. Nswapconsists of all timeta- bles achievable by swapping the timeslot-room pair of two events. Generating a member from any of these neighborhoods is a cheap operation due to the small perturbation made to the current solution.

(15)

6 CHAPTER 2. BACKGROUND

A more complex neighborhood used by Shaker and Abdullah [5] is Nkempe. Given a current solution, Nkempe consists of all timetables achievable by per- forming a sequence of event swaps. The neighborhood operation is defined as follows. Let X be the set of all events in timeslot T1and let Y be the set of all events in timeslot T2. Then, a bipartite graph G = (XS Y, E) can be con- structed by adding edges e = {x, y} ∈ E between events x ∈ X and y ∈ Y if any of the following holds:

• x and y are located in the same room.

• x and y are supervised by the same lecturer.

• x and y are attended by the same student group.

The graph G can be roughly described as connecting all events in two different timeslots that cannot be held simultaneously. A sub-graph K ⊆ G is then generated by choosing a starting event x0 ∈ X to perform breadth-first search from. Lastly, K is traversed and the events with the same rooms are swapped.

The sub-graph K is known as a Kempe Chain, hence the neighborhood name Nkempe.

Nkempehas a few characteristics that differentiates it from Nmoveand Nswap. Firstly, the graph G is constructed in a way that allows Nkempeto maintain fea- sibility, provided that the input timetable was originally feasible. Secondly, Nkempehas the added benefit of yielding a larger perturbation than Nmoveand Nswap, as multiple events may be swapped in one operation.

2.5 Previous Efforts in UCTP

This section contains previous efforts in UCTP. Firstly, general efforts involv- ing UCTP and GD are presented. Then, efforts in KTH-inspired UCTP are presented.

2.5.1 General Efforts

One implementation of GD for UCTP was constructed and studied by Mcmul- lan [3]. The implementation uses a linear decay function and samples from the Nswap neighborhood. In addition to this, it varies from the standard GD by incorporating a reconfiguration strategy for the boundary. In particular, the implementation resets the boundary to the fitness of the current solution if no improvements are made after a certain time period. This was hypothesized

(16)

CHAPTER 2. BACKGROUND 7

by the author to prevent the boundary from outpacing the current solution to some extent.

The results showed moderate improvements compared to a GD implemen- tation without reconfiguration. However, the author noted that the implemen- tation had trouble improving when the optimal solution had a low number of soft constraint violations. A potential reason discussed in their study was the use of a simple neighborhood, Nswap.

Another implementation of the GD algorithm for UCTP was studied by Obit and Landa-Silva [6]. The implementation uses an exponential decay function, and samples from three neighborhoods, two of which are Nmoveand Nswap. Furthermore, this implementation also reconfigures the boundary by lowering the water level by an offset whenever it passes the current solution.

Overall, Obit and Landa-Silva saw moderate success with their implemen- tation, outperforming the linear decay counterpart of their implementation.

The suggested reason was the exponential decay function, which had the ob- served effect of slowing down the boundary as it approaches the expected op- timum. This allowed the current solution to stay ahead of the boundary longer, meaning a worse neighbor could still be accepted if better than the boundary.

However, studying the fitness plots in their report reveals that this implementa- tion also had trouble improving when at a low number of constraint violations.

A third implementation of the GD algorithm for UCTP was studied by Shaker and Abdullah [5]. The implementation uses a linear decay function, a boundary reconfiguration strategy similar to Obit and Landa-Silva [6], and sampled from Nmove, Nswap and Nkempe. The choice of which neighborhood to sample from was based on which was successful in previous iterations.

The implementation showed great results. Although the authors did not discuss the cause of this improvement, possible reasons could be the addition of Nkempeand the principle of locality used in the neighborhood combination strategy.

2.5.2 Efforts in KTH-inspired UCTP

Only a few studies in the context of KTH-inspired UCTP take soft constraints into consideration. One of these studies were performed by Norgren and Jonas- son [8].

Norgren and Jonasson [8] studied different solvers for the KTH-inspired UCTP from a fitness perspective. The superior solver was an implementation of Simulated Annealing (SA), another local search heuristic. The implemen- tation used three neighborhoods, two of which were Nmove and Nswap. The

(17)

8 CHAPTER 2. BACKGROUND

implementation generated a neighbor by applying the three neighborhoods in succession. The SA implementation was superior to other solvers [8, 7] com- pared against, making it a suitable state-of-the-art solver for the KTH-inspired UCTP in the context of our study.

(18)

Chapter 3

Methodology

This section presents the details of our GD implementation. Specifically, we describe and motivate the choice of parameters, fitness function, neighbor- hoods and problem instances. The section ends by describing and motivating how the GD implementation will be evaluated.

3.1 The Algorithm

The GD algorithm to be implemented is presented in algorithm 1. The initial solution is obtained by assigning each event into a random, available timeslot- room pair. This gives more varied startups of the GD implementation, allow- ing us to observe the overall performance better. It also allows us to start with a complete assignment of each event to a timeslot-room pair, which is required for all feasible timetables. The initial boundary is chosen to be the fitness of the initial solution, as described in algorithm 1.

The decay function is a non-linear decay function, implemented as follows:

boundary = boundary ∗ (1 − decayRate)

where 0 < decayRate < 1. Using a non-linear decay function is helpful for our fitness function, since the fitness function initially generates rather large absolute fitness values. Having a linear decay function would not be feasible since it would decay either too fast (with a large decay rate) or too slow (with a small decay rate) to be useful.

The decay rate was chosen by experimentation, due to its dependency to any given problem instance. It was chosen to allow the GD implementation to act greedily (i.e with the boundary passing the current solution fitness) in the

9

(19)

10 CHAPTER 3. METHODOLOGY

later stages of execution, with respect to the 60 second time limit specified in section 3.5. The value chosen through experimentation was 0.0002.

3.2 The Fitness Function

The GD implementation employs a fitness function identical to Norgren and Jonasson [8]. This choice reduces the number of variations between our GD implementation and the SA implementation developed by Norgren and Jonas- son.

The fitness function used in the study consisted of a weighted sum of con- straints, defined as follows:

F () = −1 ∗ (1000 ∗ hardConstraints() + sof tConstraints()) (3.1) where hardConstraints() and sof tConstraints() are defined as:

hardConstraints() =X

H1 + 2X

H2+X

H3+ 4X H4, sof tConstraints() = 4X

S1+X

S2+X

S3+ 2X

S4+ 4X S5 Violations of H1can be avoided if the data structures used in an implementa- tion are designed in a way that never allows two events to be assigned to the same timeslot-room pair. One such strategy to avoid H1 violations, which is used in this study, is to index events by timeslot-room pairs.

3.3 The Neighborhoods

This section defines the two important aspects of our neighborhood necessary to implement it. The first section describes and motivates the choice of neigh- borhoods to use. The second section describes and motivates how a neighbor is chosen from these neighborhoods (in other words, how the neighborhoods are combined).

3.3.1 Choice of Neighborhoods

The chosen neighborhoods are Nmove, Nswap and Nkempe. Nmove and Nswap were chosen due to their lightweight and fast nature, and their documented success in previous studies on UCTP [3, 5, 6]. Nkempe is chosen because of its larger perturbation size, its ability to maintain feasibility on timetables as well as its moderate success in a GD context [5].

(20)

CHAPTER 3. METHODOLOGY 11

3.3.2 Choice of Combination

In this study, the neighborhoods Nmove, Nswapand Nkempeare combined using a Token-Ring structure, as defined by Lü, Hao, and Glover [10]. The combi- nation structure uses a particular neighborhood until it fails to generate an ac- cepted neighbor, and then changes to the next neighborhood in a round-robin pattern.

There are several studies that motivate the use of the Token-Ring combi- nation structure. Lü, Hao, and Glover [10] compared combination by Token- Ring and combination by Union when applied to standard Local Search Heuris- tics in UCTP, and found that the Token-Ring combination was superior in all heuristics. Shaker and Abdullah [5] and Abdullah et al. [11], both studying the UCTP, combined neighborhoods in similar ways as the Token-Ring com- bination and experienced a strong overall performance in terms of the quality of the timetables.

3.4 The Problem Instances

The problem instances used were provided by Yamazaki and Pertoft [7], and later revised by Norgren and Jonasson [8]. The problem instances were de- fined for the KTH-inspired UCTP presented in section 2.3 and vary in size and complexity. This study will be based on the medium and large problem instances, due to the lack of complexity in the smaller instances that was noted by Norgren and Jonasson [8]. The data for the medium and large problem in- stances and the input format is found in appendix A.

The complexity of the problem instances may come from different com- ponents of the input data. One is the number of events to be scheduled, where each event requires compliance with both hard and soft constraints. A sec- ond component is the number of courses, where each added course requires a teacher that can be available for one or more instances of that course. A third component is the number of student groups, where each student group re- quires its own instance of their specified courses. An increase in these compo- nents would correspond to taking more programs (such as Computer Science or Chemical Engineering) and courses into consideration when scheduling a particular week.

The problem instances vary by changing these components. The medium problem instance has a smaller number of student groups, courses and rooms, essentially taking fewer programs and courses into consideration. In contrast, the large problem instance has an increased number of courses and student

(21)

12 CHAPTER 3. METHODOLOGY

Medium Large

Events 115 159

Timeslot-room pair 240 320

Lecture rooms 2 3

Exercise rooms 5 6

Lab rooms 5 7

Courses 15 21

Teachers 12 15

Student groups 8 12

Density 0.48 0.50

Table 3.1: Characteristics of the Medium and Large Problem Instances.

groups to schedule, as well as a larger number of events to schedule, while still maintaining about the same number of teachers. This implies that the large problem instance takes more programs and courses into consideration for the weekly scheduling, resulting in more realistic data.

The characteristics of the medium and large problem instances can be found in table 3.1. The density of events per timeslot-room pair can be seen as another indication of the complexity of the instance. However this metric is not noticeably different between the problem instances.

3.5 The Comparison

The resulting timetables from our implementation will be compared to the timetables generated by the SA-implementation provided by Norgren and Jonas- son [8]. The metric used for comparison in the finished timetables will be the unweighted sum of all soft constraint violations. This makes the comparisons properly reflect the quality of a solution, as weights can skew the quality of a timetable. For completeness, we also report on the ability to achieve feasibility when appropriate.

The benchmark program recorded the number of soft constraint violations for the time limits of 10, 20, 30 and 60 seconds over 10 runs of GD and SA.

Performing the calculations on different time limits will help illustrate how per- formance varies over time. Recording the results of 10 runs for each time limit will give a decent measurement of the average behavior and consistency, as il- lustrated by the standard deviation. Adding more time limits or more runs than specified above causes the benchmark program to take an infeasible amount of

(22)

CHAPTER 3. METHODOLOGY 13

time to execute. The mean number of soft constraint violations for a timetable along with the standard deviation will then be presented in the form of a bar chart.

We will also record the time when the GD implementation turns “greedy”, denoted as the GreedyPoint. It is defined as the time after which the current solution becomes permanently worse than the boundary. In other words, the solution becomes worse and never catches up to the boundary again. Any progress made after this time will be achieved by a greedy behavior, per defi- nition of GD. This data will be helpful in discussing the impact of the greedy behavior of the GD implementation in terms of fitness and consistency.

The benchmark program will be executed on a computer running the Ubuntu 18.04.2 LTS operating system. The CPU is an Intel Core i7-7700K 4.20GHz with 8 hardware threads. The programming language used is Java, because the SA implementation to compare against [8] was implemented in Java.

(23)

Chapter 4 Results

The results below present the observed number of hard constraint violations for the medium and large problem instances. Then, the observed number of soft constraint violations are presented in bar charts. Lastly, the GreedyPoint for the GD implementation will be presented.

For the medium problem instance, both the GD and SA implementations had 0 hard constraints for all time limits. For the large problem instance, the GD and SA implementations both had 0 hard constraint violations for the time limits of 20, 30 and 60 seconds. For the 10 second time limit, the GD im- plementations had 5 hard constraint violations on average, meaning it was not able to construct a feasible timetable in 10 seconds.

Figure 4.1 illustrates, for the medium problem instance, the average num- ber of soft constraint violations for different time limits. For smaller time limits, the GD implementation has more soft constraint violations than the SA implementation. As the time limit increases, the GD implementation rapidly reduces the number of violations as well as the inconsistent behavior, eventu- ally outperforming the SA implementation.

14

(24)

CHAPTER 4. RESULTS 15

Figure 4.1: Average number of soft constraint violations for medium instance.

The black lines represent the standard deviation.

Figure 4.2 illustrates, for the large problem instance, the average number of soft constraint violations for different time limits. For smaller time limits, the GD implementation has more soft constraint violations than the SA imple- mentation. As the time limit increases, the GD implementation reduces the number of violations as well as the inconsistent behavior, eventually outper- forming the SA implementation. The overall performance of GD in the large problem instance is a bit worse than for the medium problem instance.

(25)

16 CHAPTER 4. RESULTS

Figure 4.2: Average number of soft constraint violations for large instance.

The black lines represent the standard deviation.

Table 4.1 presents, for each problem instance, the average GreedyPoint of the GD implementation. The GreedyPoint denotes the time during execution after which any progress made is achieved by greedy behavior.

Problem Instance Medium Large

Avg GreedyPoint (s) 9 25

Table 4.1: Average GreedyPoint for both problem instances.

(26)

Chapter 5 Discussion

This section begins by presenting our discussion of the results. Then, propos- als for further research are made. Lastly, a discussion is made in direct relation to the research questions.

5.1 Results

In this section, we discuss the results of our GD implementation and present potential explanations for the results. First, a discussion on performance is made in terms of fitness. Then, the discussion focuses on the consistency of solutions over several executions. Lastly, we discuss the overall reliability of the results.

5.1.1 Fitness

Our GD implementation varied in performance depending on the specified time limit. Figures 4.1 and 4.2 show the average number of soft constraint violations for the timetables produced by the solvers for different time lim- its. For the smaller time limit of 10 seconds, our solver was outperformed by the SA implementation provided by Norgren and Jonasson [8] in both prob- lem instances. However, the performance of the GD implementation improves rapidly as the time limit increases, and GD outperforms SA for the larger time limit of 60s.

There are a few possible reasons for GD having a relatively poor start. One reason could be the large absolute value of the initial fitness, which causes the boundary to take longer to converge and allows the current solution to pick al- most any candidate. Another reason could be the use of simple neighborhoods

17

(27)

18 CHAPTER 5. DISCUSSION

in our GD implementation (in particular, Nmove and Nswap). These neigh- borhoods may generate worse solutions. This might, in conjunction with the boundary taking longer to converge, cause the GD implementation to repeat- edly accept worse solutions until the boundary catches up to the fitness of the current solution. The exponential decay rate used in our GD implementation was chosen to mitigate this problem, but the issue of a slow start is still present to a certain degree.

There are a few factors that could be related to the improvement of the GD implementation for longer time limits. Perhaps the biggest reason could be the greedy behavior obtained after 9 seconds (for the medium problem in- stance) and 25 seconds (for the large problem instance), as specified by the GreedyPoints in table 4.1. The fact that our GD implementation shows con- siderable improvement even after a GreedyPoint suggests that the combina- tion of neighborhoods is varied enough to give further improvements even in a greedy context. In contrast, the SA implementation used a neighborhood that (in practice) performed one large perturbation to the current solution, which may have limited the improvement gained during the later stages of search.

The implementations described in sections 2.5.1 and 3.3.2 give further motivation why the balanced neighborhood and greedy behavior could have caused the improvements during the later stages of execution. For instance, the implementations with simple neighborhoods or aggressive boundary reconfig- uration strategies had a difficult time improving when there were a lower num- ber of constraint violations left [3, 6]. Furthermore, the implementations with balanced neighborhoods and less aggressive (or no) boundary reconfiguration strategies had good performance even at a lower number of constraint viola- tions [5, 11]. The behavior of these implementations all seem to fall in line with the analysis conducted on our results, which could indicate an increased level of validity in our analysis.

5.1.2 Consistency

The consistency of the solutions over several executions for our GD implemen- tation varied between time limits. Figures 4.1 and 4.2 illustrate the standard deviation from the average number of soft constraint violations for different time limits. For the smaller time limits of 10 and 20 seconds, the number of violations was rather inconsistent between average and extreme behavior. For the larger time limits of 30 and 60 seconds, the consistency was competitive with the consistency of the SA implementation.

The potential reasons for inconsistencies for smaller time limits are simi-

(28)

CHAPTER 5. DISCUSSION 19

lar to the reasons discussed for the poor number of constraint violations dur- ing early stages of execution. The large absolute value of the initial bound- ary allows for the GD implementation to repeatedly accept worse solutions.

The simplicity of two of the neighborhoods used (Nmoveand Nswap) can yield worse neighbors. As long as the neighbor has better fitness than the bound- ary, the neighbor is accepted and the Token-Ring strategy chooses to stay on that neighborhood. This could cause the GD implementation to waste time worsening the current solution, instead of using the time to improve.

As for the larger time limits, we suspect that the consistent behavior is a result of the boundary eventually catching up to the current solution. The GreedyPoint of the medium problem instance is at 9 seconds and the con- sistent behavior starts to show at the next recorded time limit of 20 seconds.

Similarly, the GreedyPoint of the large problem instance is at 25 seconds and the consistent behavior is first recorded at around 30 seconds. We suspect that most inconsistencies are gradually resolved around/slightly before the Greedy- Point. During this time, the GD implementation can run at the same pace as the boundary and resolve poor decisions made as a result of the unguided early stages of execution. This could explain the consistent performance for larger time limits.

5.1.3 Reliability of Results

This study only used two problem instances. The lack of variety in the problem instances negatively impacts the ability to draw more general conclusions than for this particular GD implementation.

Despite this, many precautions were taken in order to increase reliability of the results. One was to use randomly initialized solutions for the GD im- plementation, in order to allow different starting scenarios for proper analysis of consistency. Another was to perform the experiment 10 times for each time limit, to get a decent approximation of average behavior. We believe that these actions help increase reliability somewhat.

Although only two problem instances were used, it is worthwhile noting that the behavior in terms of fitness improvement and consistency between the instances were similar. We believe this indicates a level of stability in the GD implementation. However, constructing more, diverse problem instances should be the primary focus in future work in order to give a more accurate representation of the overall behavior of different KTH-inspired UCTP solvers.

(29)

20 CHAPTER 5. DISCUSSION

5.2 Proposal for Further Research

This study only introduced GD to the KTH-inspired UCTP. In fact, there are several research topics that could be investigated further in relation to GD.

One research topic worthwhile exploring is comparing our results to a GD algorithm implemented in a two-phase context. The first phase (any heuris- tic) would ensure that no hard constraints are violated and the second phase (GD in particular) would minimize the number of soft constraint violations withoutviolating any hard constraints. This is a common strategy used in GD implementations [3, 5, 6]. The change would greatly reduce the large absolute value of the initial boundary generated by our current GD implementation, since there would be no need for a large weight on the hard constraints (hard and soft constraints would instead be compared separately). Because the initial boundary is suspected to cause the slow start, it is worthwhile to see if using a two-phase implementation could improve consistency or overall fitness.

Another research topic could be to perform case studies on different sched- ules of KTH, with the aim to create more realistic and varied KTH-inspired UCTP instances. This would greatly improve the quality and reliability of all future studies made on the KTH-inspired UCTP.

A third research topic could be to investigate the usability of the different heuristics for KTH-inspired UCTP with respect to general users. The study could investigate which heuristic is easier for the user to control as they modify the heuristic parameters. This would ultimately help bring the results of our study into practise.

A fourth research topic could be to investigate a more robust strategy to choose the decay rate for GD, given a problem instance. There have been a few rules of thumb in choosing linear decay rate [9], but the rules yield static choices that do not change throughout execution. As such, unless the decay function is chosen with respect to a problem instance, applying the same de- cay function to a slightly modified instance could slow down the search pro- cess or cause the boundary to pass the current solution. Investigating different static and dynamic strategies for choosing a non-linear decay rate based on the problem instance could therefore help increase the robustness of future GD implementations.

(30)

CHAPTER 5. DISCUSSION 21

5.3 Relation to Research Questions

The first research question is

For the KTH-inspired UCTP, how does our implementation of The Great Deluge algorithm compare to other heuristic implementa- tions with respect to the number of soft constraint violations?

The discussion suggests that our GD implementation is worse than the SA implementation for smaller time limits, but better for larger. The reason for the slow start is suspected to be the large absolute value of the initial boundary.

The reason for a great later stage is suspected to be the balanced combination of neighborhoods used, in combination with the greedy behavior.

The second research question is

For the KTH-inspired UCTP, how does our implementation of The Great Deluge algorithm compare to other heuristic implementa- tions with respect to the consistency between resulting timetables over several executions?

The discussion suggests that our GD implementation is less consistent than the SA implementation for smaller time limits, but equally consistent for larger.

The reason for the inconsistent start is suspected to be the large absolute value of the initial boundary in conjunction with the randomized sampling in the neighborhoods used. The reason for a consistent later stage is suspected to be the balanced combination of neighborhoods, which are able to balance out inconsistencies around the GreedyPoint.

(31)

Chapter 6

Conclusions

This study investigates how an implementation of the GD algorithm compares to a state-of-the-art SA implementation for the KTH-inspired UCTP, with re- spect to the number of violated constraints and the consistency of the solutions over several executions. For the GD implementation, the boundary had an ex- ponential decay rate and neighborhoods of varying complexity were combined using a Token-Ring strategy.

The results suggest that the GD implementation produced better timetables than the SA implementation and was consistent for larger time limits, but was outperformed by the SA implementation and inconsistent for smaller time lim- its. One possible reason for the good performance of our GD implementation during the later stages of execution is the utilization of the greedy behavior ob- tained after the GreedyPoint, in conjunction with the balanced neighborhoods.

In conclusion, the GD implementation is suitable when time is not the most important factor. Further research could investigate how putting the GD imple- mentation into a two-phase context could affect the number of soft constraint violations and overall consistency. Further research could also incorporate case studies on existing KTH schedules, in order to create a set of more realis- tic and varied problem instances. This could lead to more accurate results for future studies on the KTH-inspired UCTP.

22

(32)

Bibliography

[1] Edmund Burke et al. “Automated university timetabling: The state of the art”. In: The computer journal 40.9 (1997), pp. 565–571.

[2] Shimon Even, Alon Itai, and Adi Shamir. “On the complexity of time ta- ble and multi-commodity flow problems”. In: 16th Annual Symposium on Foundations of Computer Science (sfcs 1975). IEEE. 1975, pp. 184–

193.

[3] Paul Mcmullan. “An extended implementation of the great deluge al- gorithm for course timetabling”. In: International Conference on Com- putational Science. Springer. 2007, pp. 538–545.

[4] Rhydian Lewis. “A survey of metaheuristic-based techniques for uni- versity timetabling problems”. In: OR spectrum 30.1 (2008), pp. 167–

190.

[5] Khalid Shaker and Salwani Abdullah. “Incorporating great deluge ap- proach with kempe chain neighbourhood structure for curriculum-based course timetabling problems”. In: 2009 2nd Conference on Data Min- ing and Optimization. IEEE. 2009, pp. 149–153.

[6] Joe Henry Obit and Dario Landa-Silva. “Computational study of non- linear great deluge for university course timetabling”. In: Intelligent Systems: From Theory to Practice. Springer, 2010, pp. 309–328.

[7] Hiroyuki Vincent Yamazaki and John Pertoft. Scalability of a Genetic Algorithm that solves a UniversityCourse Scheduling Problem Inspired by KTH. 2014.

[8] Eric Norgren and Johan Jonasson. Investigating a Genetic Algorithm- Simulated Annealing Hybrid Applied to University Course Timetabling Problem: A Comparative Study Between Simulated Annealing Initial- ized with Genetic Algorithm, Genetic Algorithm and Simulated Anneal- ing. 2016.

23

(33)

24 BIBLIOGRAPHY

[9] Gunter Dueck. “New optimization heuristics: The great deluge algo- rithm and the record-to-record travel”. In: Journal of Computational physics104.1 (1993), pp. 86–92.

[10] Zhipeng Lü, Jin-Kao Hao, and Fred Glover. “Neighborhood analysis:

a case study on curriculum-based course timetabling”. In: Journal of Heuristics17.2 (2011), pp. 97–118.

[11] Salwani Abdullah et al. “Dual sequence simulated annealing with round- robin approach for university course timetabling”. In: European Con- ference on Evolutionary Computation in Combinatorial Optimization.

Springer. 2010, pp. 1–10.

(34)

Appendix A

KTH-inspired UCTP instances

In this section the different problem instances are shown. Each problem in- stance is divided into 4 parts; rooms, courses, lecturers and student groups.

The input format for each part is as follows:

• For each room the name of the room, the capacity of the room and the room type are specified. 0 is the lecture room-type, 1 is the exercise room-type and 2 is the lab room-type.

• For each course the name of the course, number of lectures, number of lessons and number of labs are specified.

• For each teacher the name of the teacher and one or more course names are specified.

• For each student group the name of the group, number of students in the group and one or more course names are specified.

A.1 Medium Problem Instance

# ROOMS D1 200 0 D2 50 1 D3 50 1 D45 40 1 D46 40 1 E1 350 0 E35 40 1

25

(35)

26 APPENDIX A. KTH-INSPIRED UCTP INSTANCES

SPEL 40 2 SPOR 30 2 MUSI 40 2 ROD 30 2 ORA 30 2

# COURSES CALC 2 1 0 JAVA 1 0 1 MULT 2 0 1 CTEC 1 2 0 CSEC 0 1 1 SCON 1 1 1 DIGI 1 0 1 ENGM 1 0 1 ALGD 1 1 0 ELEC 1 0 0 PROB 1 0 1 OPER 1 1 0 TERM 2 0 1 DIFF 2 1 0 MECH 0 1 2 OOPC 1 1 1 REAC 1 0 2

# TEACHERS SVEN CALC MULT

BERT JAVA SCON OOPC KARL CSEC

GUNN CTEC BERI DIGI ERIK DIFF SARA OPER

OLLE ENGM ELEC BENG ALGD

JUDI TERM REAC MANS MECH

PELL PROB

# STUDENT GROUPS COMP_1 200 CALC JAVA COMP_2 120 MULT CTEC

(36)

APPENDIX A. KTH-INSPIRED UCTP INSTANCES 27

COMP_3 70 CSEC SCON INFO_1 200 DIGI ENGM INFO_2 100 ALGD ELEC INFO_3 50 PROB OPER PHYS_1 200 CALC TERM PHYS_2 180 DIFF MECH

A.2 Large Problem Instance

# ROOMS D1 200 0 D2 50 1 D3 50 1 D45 40 1 D46 40 1 E1 350 0 E35 40 1 E36 40 1 F1 300 0 SPEL 40 2 SPOR 30 2 MUSI 40 2 ROD 30 2 ORA 30 2 VIO 40 2 GRA 30 2

# COURSES CALC 2 1 0 JAVA 1 0 1 MULT 2 0 1 CTEC 1 2 0 CSEC 0 1 1 SCON 1 1 1 DIGI 1 0 1 ENGM 1 0 1 ALGD 1 1 0 ELEC 1 0 0 PROB 1 0 1 OPER 1 1 0

(37)

28 APPENDIX A. KTH-INSPIRED UCTP INSTANCES

TERM 2 0 1 DIFF 2 1 0 MECH 0 1 2 QUAN 1 1 0 OOPC 1 1 1 TCHE 2 1 0 PERS 1 0 0 REAC 1 0 2 POLY 1 1 0

# TEACHERS SVEN CALC MULT

BERT JAVA SCON OOPC KARL CSEC

GUNN CTEC BERI DIGI ERIK DIFF SARA OPER

OLLE ENGM ELEC BENG ALGD

JUDI TERM REAC MANS MECH

MICH QUAN PELL PROB

DARI TCHE POLY MORT PERS

# STUDENT GROUPS COMP_1 200 CALC JAVA COMP_2 120 MULT CTEC COMP_3 70 CSEC SCON

INFO_1 200 DIGI ENGM INFO_2 100 ALGD ELEC INFO_3 50 PROB OPER PHYS_1 200 CALC TERM PHYS_2 180 DIFF MECH PHYS_3 100 QUAN OOPC CHEM_1 150 CALC TCHE CHEM_2 130 PERS DIFF CHEM_3 100 REAC POLY

(38)

www.kth.se

TRITA-EECS-EX-2019:359

References

Related documents

Exakt hur dessa verksamheter har uppstått studeras inte i detalj, men nyetableringar kan exempelvis vara ett resultat av avknoppningar från större företag inklusive

För att uppskatta den totala effekten av reformerna måste dock hänsyn tas till såväl samt- liga priseffekter som sammansättningseffekter, till följd av ökad försäljningsandel

Från den teoretiska modellen vet vi att när det finns två budgivare på marknaden, och marknadsandelen för månadens vara ökar, så leder detta till lägre

Generella styrmedel kan ha varit mindre verksamma än man har trott De generella styrmedlen, till skillnad från de specifika styrmedlen, har kommit att användas i större

All courses at Bachelor and Master levels at Karolinska Institutet must have an open, not password protected, course web (page).. The information on the course web should be

However, both ACO variations produced results with fewer hard constraint violations for the hard difficulty problems than for the medium difficulty problems when the heuristic was

The aim of this thesis is to compare the performance of a Genetic Algorithm- Simulated Annealing hybrid implementation with the performance of each of the algorithms individually

The implementation consisted of obtaining and adapting the Yamazaki- Pertoft Genetic Algorithm UCTP solver, re-implementing the Renman- Fristedt Tabu Search UCTP solver, and