An Evaluation of the Great Deluge Algorithm in Course Timetabling
Total Page:16
File Type:pdf, Size:1020Kb
DEGREE PROJECT IN 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 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 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. 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. v Acknowledgements We would like to thank our supervisor for his guidance and support throughout this study. Abbreviations GD The Great Deluge. SA Simulated Annealing. UCTP University Course Timetabling Problem. vi 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 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 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 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. 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 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.