27.07.2013 Views

The Doctor Rostering Problem - Asser Fahrenholz

The Doctor Rostering Problem - Asser Fahrenholz

The Doctor Rostering Problem - Asser Fahrenholz

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

TECHNICAL UNIVERSITY OF DENMARK<br />

<strong>The</strong> <strong>Doctor</strong> <strong>Rostering</strong> <strong>Problem</strong><br />

by<br />

<strong>Asser</strong> Stubbe <strong>Fahrenholz</strong> , s032651<br />

Department of Informatics and Mathematical Modelling<br />

11. November 2008


Preface<br />

This Master <strong>The</strong>sis presents the work of <strong>Asser</strong> Stubbe <strong>Fahrenholz</strong>, February to November<br />

2008. <strong>The</strong> work describes a solution for the doctor rostering problem of a small medical<br />

practice housing six doctors, in St. Heddinge, Denmark.<br />

Signed:<br />

Date:<br />

i


TECHNICAL UNIVERSITY OF DENMARK<br />

Abstract<br />

Department of Informatics and Mathematical Modelling<br />

author: <strong>Asser</strong> Stubbe <strong>Fahrenholz</strong> , s032651<br />

<strong>The</strong> <strong>Doctor</strong> <strong>Rostering</strong> <strong>Problem</strong> (DRP) covers the scheduling of doctors to shifts with<br />

respect to a range of constraints, that ensure satisfied employees. <strong>The</strong> problem is first<br />

modelled mathematically and then solved heuristicly by the use of two metaheuristics,<br />

GRASP and Simulated Annealing. Both heuristics are described in theory and are tested<br />

on real world data, as well as constructed problems that tests the various parameters of<br />

the implementation as well as the effect of more or less constrained problems. A relaxed<br />

version of the problem is solved in GAMS to optimality and the solution is compared to<br />

the solution of the heuristics. <strong>The</strong> heuristics are implemented in a prototype of a software<br />

program ready to use by the medical practice. Test results indicate that near-optimal to<br />

optimal solutions are found and that the construction heuristic are the dominant factor<br />

for the quality of the solutions.


DANMARKS TEKNISKE UNIVERSITET<br />

Resumé<br />

Institut for Informatik og Matematisk Modellering<br />

forfatter: <strong>Asser</strong> Stubbe <strong>Fahrenholz</strong> , s032651<br />

Læge planlægnings problemet dækker over tildelingen af vagter til læger, i forhold til<br />

en række begrænsninger, som sikre de ansattes tilfredshed. <strong>Problem</strong>et modelleres først<br />

matematisk og løses dernæst heuristisk ved hjælp af to metaheuristikker, GRASP og<br />

Simuleret Udglødning. Teorien for begge heuristikke er beskrevet og begge er testet p˚a<br />

et rigtigt problem instans, s˚avel som problem instanser der tester de forskellige param-<br />

eter og effekten af mere eller mindre begrænsede problemer. En relakseret udgave af<br />

problemet løses i GAMS til optimalitet og løsningen sammenlignes med resultater fra<br />

heuristikkerne. Heuristikkerne implementeres i en software prototype, klar til brug af<br />

lægepraksisen. Test resultater indikerer at nær-optimale til optimale løsninger bliver<br />

fundet og at konstruktionsheuristikken er den dominerende faktor for kvaliteten af<br />

løsningerne.


Acknowledgements<br />

Foremost, I would like to thank my advisor, associate professor Jesper Larsen of the<br />

Department of Informatics and Mathematical Modelling at the Technical University of<br />

Denmark, for his advice and support. Always providing explanations when needed,<br />

encouraging me and helping me keep focus.<br />

I also wish to thank professor Jens Clausen, for his time and advice when my project<br />

seemed to stall and needed to make further progress.<br />

iv


Contents<br />

Preface i<br />

Abstract ii<br />

Resumé iii<br />

Acknowledgements iv<br />

List of Figures viii<br />

List of Tables ix<br />

List of Algorithms x<br />

1 Introduction 1<br />

1.1 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1<br />

1.2 Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2<br />

2 <strong>The</strong> <strong>Doctor</strong> <strong>Rostering</strong> <strong>Problem</strong> 3<br />

2.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3<br />

2.1.1 <strong>The</strong> staff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4<br />

2.1.2 Shift types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4<br />

2.2 Rolling Days Off . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5<br />

2.3 Literature review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5<br />

3 A mathematical model for the DRP 8<br />

3.1 Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8<br />

3.2 Hard constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9<br />

3.3 Soft constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10<br />

3.4 <strong>The</strong> objective function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13<br />

3.4.1 <strong>Problem</strong> size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13<br />

4 Solving the DRP 15<br />

4.1 DRP complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15<br />

4.2 Exact methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16<br />

4.3 Heuristics for the DRP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17<br />

v


Contents vi<br />

4.3.1 A construction heuristic . . . . . . . . . . . . . . . . . . . . . . . . 18<br />

4.3.2 Neighborhoods and Local Search . . . . . . . . . . . . . . . . . . . 20<br />

4.3.3 <strong>The</strong> GRASP metaheuristic . . . . . . . . . . . . . . . . . . . . . . 23<br />

4.3.4 <strong>The</strong> Simulated Annealing metaheuristic . . . . . . . . . . . . . . . 25<br />

4.3.5 Heuristic bounds . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26<br />

4.4 Heuristic implementations . . . . . . . . . . . . . . . . . . . . . . . . . . . 27<br />

4.4.1 <strong>The</strong> data structure . . . . . . . . . . . . . . . . . . . . . . . . . . . 27<br />

4.4.2 A partial enumeration . . . . . . . . . . . . . . . . . . . . . . . . . 28<br />

4.4.3 Construction heuristic . . . . . . . . . . . . . . . . . . . . . . . . . 29<br />

4.4.4 Metaheuristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29<br />

4.4.5 Implementation optimisations . . . . . . . . . . . . . . . . . . . . . 30<br />

5 Optimal solution 31<br />

5.1 Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31<br />

6 <strong>The</strong> DRP Program 34<br />

6.1 <strong>The</strong> user . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34<br />

6.2 <strong>The</strong> Graphical User Interface . . . . . . . . . . . . . . . . . . . . . . . . . 35<br />

6.2.1 Measuring the quality of the solution . . . . . . . . . . . . . . . . . 40<br />

6.3 End user feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40<br />

6.4 From prototype to release candidate . . . . . . . . . . . . . . . . . . . . . 41<br />

7 Metaheuristic tests 42<br />

7.1 Test setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42<br />

7.2 Results and discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44<br />

7.2.1 Instance parameter effects . . . . . . . . . . . . . . . . . . . . . . . 44<br />

7.2.2 Metaheuristic parameter effects . . . . . . . . . . . . . . . . . . . . 46<br />

7.2.3 Metaheuristic performance . . . . . . . . . . . . . . . . . . . . . . 48<br />

7.3 Test conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51<br />

8 Future considerations 53<br />

8.1 User-added rules - relation/logic of shifts . . . . . . . . . . . . . . . . . . . 53<br />

8.2 Neighborhood delta function and feasibility . . . . . . . . . . . . . . . . . 54<br />

8.3 GRASP learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55<br />

8.3.1 GRASP stop criterion . . . . . . . . . . . . . . . . . . . . . . . . . 55<br />

8.4 SA extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56<br />

9 Conclusion 57<br />

A Implementation 59<br />

A.1 Neighborhoods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59<br />

A.1.1 Inversion neighborhood . . . . . . . . . . . . . . . . . . . . . . . . 59<br />

A.1.2 Rotation neighborhood . . . . . . . . . . . . . . . . . . . . . . . . 60<br />

A.2 Construction heuristic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61<br />

A.3 GRASP metaheuristic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64<br />

A.4 Simulated Annealing metaheuristic . . . . . . . . . . . . . . . . . . . . . . 67<br />

A.5 Choosing the assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70


Contents vii<br />

A.5.1 Shift assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70<br />

A.5.2 Permutations of size k chosen from N elements . . . . . . . . . . . 72<br />

A.5.3 Day assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73<br />

B GAMS Model 76<br />

B.1 <strong>The</strong> night, evening and wishes . . . . . . . . . . . . . . . . . . . . . . . . . 76<br />

B.2 <strong>The</strong> GAMS model and report . . . . . . . . . . . . . . . . . . . . . . . . . 76<br />

B.3 <strong>The</strong> solved model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84<br />

B.3.1 GAMS solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84<br />

B.3.2 <strong>The</strong> best greedy solution . . . . . . . . . . . . . . . . . . . . . . . . 85<br />

B.3.3 <strong>The</strong> best GRASP solution . . . . . . . . . . . . . . . . . . . . . . . 86<br />

C Tests 87<br />

C.1 Test instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87<br />

C.1.1 Instance 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88<br />

C.1.2 Instance 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90<br />

C.1.3 Instance 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91<br />

C.1.4 Instance 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92<br />

C.1.5 Instance 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93<br />

C.1.6 Instance 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95<br />

C.1.7 Instance 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97<br />

C.1.8 Instance 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98<br />

C.1.9 Instance 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99<br />

C.1.10 Instance 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99<br />

C.2 Summarized results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99<br />

C.2.1 RCL performance . . . . . . . . . . . . . . . . . . . . . . . . . . . 99<br />

C.2.2 Enum effect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100<br />

C.2.3 Weights effect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105<br />

C.2.4 Iterations effect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110<br />

C.2.5 Highlighted results . . . . . . . . . . . . . . . . . . . . . . . . . . . 115<br />

Bibliography 117


List of Figures<br />

4.1 <strong>The</strong> transformation chain from SAT to Timetable Design . . . . . . . . . 16<br />

4.2 Various types of RCL parameters . . . . . . . . . . . . . . . . . . . . . . . 19<br />

4.3 Local and global optima . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20<br />

4.4 <strong>The</strong> rotation principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21<br />

4.5 <strong>The</strong> inversion principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21<br />

4.6 <strong>The</strong> implementation of the schedule . . . . . . . . . . . . . . . . . . . . . 27<br />

4.7 Heuristics inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28<br />

5.1 Comparison of heuristic performances for the GAMS problem . . . . . . . 33<br />

6.1 <strong>The</strong> main window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35<br />

6.2 <strong>The</strong> file menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36<br />

6.3 Microsoft Excel workbook containing the night and evening shifts . . . . . 36<br />

6.4 <strong>The</strong> main window w. imported shifts . . . . . . . . . . . . . . . . . . . . . 37<br />

6.5 <strong>The</strong> settings menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37<br />

6.6 <strong>The</strong> weights window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38<br />

6.7 <strong>The</strong> codes window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39<br />

6.8 RDO enabled and disabled . . . . . . . . . . . . . . . . . . . . . . . . . . 39<br />

6.9 <strong>The</strong> main window w. generated schedule . . . . . . . . . . . . . . . . . . . 40<br />

7.1 GRASP performance: Test 0 . . . . . . . . . . . . . . . . . . . . . . . . . 49<br />

7.2 SA performance: Test 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50<br />

7.3 GRASP performance: Test 5 . . . . . . . . . . . . . . . . . . . . . . . . . 50<br />

7.4 GRASP performance: Test 6 . . . . . . . . . . . . . . . . . . . . . . . . . 51<br />

7.5 SA performance: Test 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51<br />

7.6 SA performance: Test 2 and 5 . . . . . . . . . . . . . . . . . . . . . . . . . 52<br />

C.1 Optimal solution for test 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . 115<br />

C.2 Example of the decreasing temperature . . . . . . . . . . . . . . . . . . . 116<br />

viii


List of Tables<br />

2.1 Rolling days off, NDO: no day off . . . . . . . . . . . . . . . . . . . . . . . 5<br />

4.1 <strong>The</strong> initial solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19<br />

7.1 Test instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43<br />

7.2 Test instance groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43<br />

7.3 Test instance results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44<br />

7.4 RCL effect: Test 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46<br />

7.5 RCL effect: Test 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46<br />

7.6 RCL effect: Test 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46<br />

7.7 RCL effect: Test 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46<br />

7.8 RCL Effect: All tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47<br />

7.9 Enumeration effect: All tests . . . . . . . . . . . . . . . . . . . . . . . . . 47<br />

7.10 Enumeration effect: Test 4, RCL 1 . . . . . . . . . . . . . . . . . . . . . . 47<br />

7.11 Enumeration effect: Test 7, RCL 50 . . . . . . . . . . . . . . . . . . . . . 47<br />

7.12 Weights effect: All tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48<br />

7.13 Weights effect: Test 0, RCL 1 . . . . . . . . . . . . . . . . . . . . . . . . . 48<br />

7.14 Weights effect: Test 4, RCL 1 . . . . . . . . . . . . . . . . . . . . . . . . . 48<br />

7.15 Iterations effect: All tests . . . . . . . . . . . . . . . . . . . . . . . . . . . 49<br />

B.1 Solution found by GAMS . . . . . . . . . . . . . . . . . . . . . . . . . . . 84<br />

B.2 Best greedy, RCL 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85<br />

B.3 Best GRASP, RCL 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86<br />

ix


List of Algorithms<br />

4.1 Adaptive greedy - require: RCL parameter p, schedule S . . . . . . . . . . 19<br />

4.2 Local Search - require: schedule S . . . . . . . . . . . . . . . . . . . . . . 22<br />

4.3 GRASP - require: RCL parameter p . . . . . . . . . . . . . . . . . . . . . 24<br />

4.4 Simulated Annealing - require: Schedule S, start temperature T . . . . . 26<br />

8.1 Delta function H0 - require: schedule S . . . . . . . . . . . . . . . . . . . 55<br />

x


Chapter 1<br />

Introduction<br />

During the last five decades, growing interest in optimisation and efficiency has put focus<br />

on developing, not just valid schedules, but good schedules. Even though computerisa-<br />

tion and mathematics has come to the aid of a lot of workplaces, many still use manual<br />

scheduling to satisfy both production needs as well as employee happiness. Without the<br />

aid of decision support tools, the creation of a good solution for any non-trivial problem,<br />

takes overview, coordination and most importantly, time. In health care institutions,<br />

ward managers usually spends upwards 10 to 20 hours each quarter, or even monthly,<br />

to plan a good schedule, and even then, some needs are not met. Finally, measuring<br />

the quality of the schedule is troublesome, due to the constraints and the number of<br />

decisions that needs to be made.<br />

<strong>The</strong> medical practice in St. Heddinge houses six doctors, taking care of patients in the<br />

immediate vicinity, unless the patient needs hospitalisation. At least one of these six<br />

doctors must be available for treating acute patients during working hours. <strong>The</strong> <strong>Doctor</strong><br />

<strong>Rostering</strong> <strong>Problem</strong> (DRP) is the problem of assigning one or more doctors to noon and<br />

afternoon shifts, in such a way that certain shift- and employee-requirements are met.<br />

In this thesis, I take a practical approach to solving the problem.<br />

1.1 Purpose<br />

<strong>The</strong> purpose of this thesis is to:<br />

1. Develop an objective function or cost function measuring the value of solutions for<br />

the DRP.<br />

2. Provide a solution, within a relatively short amount of time, to the DRP.<br />

1


Chapter 1. Introduction and problem context 2<br />

3. Provide a software implementation that will allow the end user to find solutions.<br />

1.2 Structure<br />

An introduction to the <strong>Doctor</strong> <strong>Rostering</strong> <strong>Problem</strong> (DRP) and a literary review is found<br />

in chapter 2. Chapter 3 contains a mathematical model for the hard and soft con-<br />

straints. Through chapter 4, the problem complexity is analysed and the discussion of a<br />

construction heuristics, the GRASP framework and the Simulated Annealing algorithm<br />

for solving the problem is included along with the implementation of these methods. In<br />

chapter 5 a relaxed DRP problem is solved in GAMS and the solution is compared to<br />

solutions found by the heuristics. Chapter 6 describes the implementation of the DRP<br />

Program that will allow the medical practice to create their own schedules. In chapter<br />

7 the performance of the heuristics is tested on a range of problems and the results<br />

are discussed. Through chapter 8, a discussion of future considerations and extensions<br />

to the solutions is found. Finally, in chapter 9 I summarise the conclusions from each<br />

individual chapter in this thesis.


Chapter 2<br />

<strong>The</strong> <strong>Doctor</strong> <strong>Rostering</strong> <strong>Problem</strong><br />

In this chapter, I present the background for the problem, the specific problem concepts<br />

and review literary sources that have served as inspiration to this project.<br />

2.1 Background<br />

Every four months, one of the doctors at the medical practice in St. Heddinge 1 , schedules<br />

the treatment of the acute patients in the immediate vicinity. This treatment must be<br />

done by one or two of the six doctors, subject to higher workloads after weekends and<br />

holidays and before holidays (somehow, people can avoid getting ill during holidays).<br />

<strong>The</strong> scheduling is done with no computer aided support, takes approximately five to ten<br />

hours and is tedious due to required gathering of available hours from each individual<br />

member of the workforce. <strong>The</strong> information tells the planner which doctor is available<br />

when, during the next four months. <strong>The</strong> planner must then assign the doctors to shifts<br />

in such a way that certain shift-patterns are avoided and such that every member of the<br />

workforce receives equally many shifts. This approach to schedule planning, performed<br />

by an employee without decision support tools, is often called self-scheduling (Burke<br />

et al. [5]).<br />

<strong>The</strong> schedule planned by the doctor is chosen to be non-cyclical, or flexible (Silvestro<br />

and Silvestro [22]), due to the medical practice being a private one, where the members<br />

of the workforce prefer ad-hoc schedules.<br />

This problem is similar in nature to the Nurse Scheduling <strong>Problem</strong> (NSP) (or Staff<br />

Scheduling <strong>Problem</strong>). NSP is the problem of assigning a fleet of nurses to shifts of<br />

varying types, in a period of time. <strong>The</strong> assignments must respect both personal wishes<br />

1 South-east of Køge, Denmark<br />

3


Chapter 2. <strong>The</strong> <strong>Doctor</strong> <strong>Rostering</strong> <strong>Problem</strong> 4<br />

along with holidays and union contract stipulations. This problem is the main source of<br />

inspiration for this project.<br />

Another problem that shows similar features is the Gotlieb Class-Teacher <strong>Problem</strong> (or<br />

Timetable Design <strong>Problem</strong>) of assigning teachers to classes, in such a way that every class<br />

has one teacher and no teacher has two classes at the same time. Very little material<br />

has been found on this, but an important contribution by this field, shall be noted in<br />

chapter 4.<br />

2.1.1 <strong>The</strong> staff<br />

As opposed to a public health care institution, where the staff is subject to a range of<br />

stipulations and union contracts, the planner in this project has a much higher degree of<br />

control over the work flow of the institution. As the private institution is not subject to<br />

the same form of bureaucracy (due to the small size and being private), the constraints<br />

are not based upon public requirements, but rather personal requests and experiences.<br />

This is a direct consequence of the joint owners of the office controlling their own working<br />

hours and thereby controlling their pay.<br />

In typical NSP, the staff consist of a large number of nurses, divided into categories<br />

based on their qualification level and responsibilities. Several degrees of qualification can<br />

exist allowing a lower qualified member of the staff to be replaced by a higher qualified<br />

member. <strong>The</strong> staff can also be divided into full time or part time employees and some<br />

NSPs require higher qualified members to supervise the lower qualified members. In the<br />

context of this project, the staff that needs assigning are not divided into qualification<br />

groups. Due to decisions made in the practice, any interns/nurses in the practice will<br />

be assigned shifts manually.<br />

2.1.2 Shift types<br />

This project deals with four shift types: night-, noon-, afternoon- and evening shifts.<br />

<strong>The</strong> night- and evening shifts are given through a public body and can not be changed,<br />

leaving the noon- and afternoon shifts to be assigned. One or two doctors must be<br />

assigned to these two shifts.<br />

A standard NSP contains the three shifts: night-, day- and evening shifts, and most<br />

often requires more than one nurse to be assigned to the shift.


Chapter 2. <strong>The</strong> <strong>Doctor</strong> <strong>Rostering</strong> <strong>Problem</strong> 5<br />

<strong>Doctor</strong> 1 2 3 4 5 6<br />

Week 1 Tuesday NDO Wednesday Thursday Friday Monday<br />

Week 2 NDO Wednesday Thursday Friday Monday Tuesday<br />

Week 3 Wednesday Thursday Friday Monday Tuesday NDO<br />

Week 4 Thursdag Friday Monday Tirsdag NDO Wednesday<br />

Week 5 Friday Monday Tirsdag NDO Wednesday Thursdag<br />

Week 6 Monday Tirsdag NDO Wednesday Thursdag Friday<br />

Table 2.1: Rolling days off, NDO: no day off<br />

2.2 Rolling Days Off<br />

A specific requirement of this project is rolling days off (RDO). <strong>The</strong>se define which<br />

weeks a doctor gets a day off and which weeks contains no day off (NDO) for each<br />

doctor. Table 2.1 illustrates the concept of rolling days off.<br />

A key point of RDO is the fact that all doctors receive weekends where they have both<br />

the predating Friday and the postdating Monday off.<br />

<strong>The</strong> RDO as a constraint is omitted from the mathematical model of this problem and<br />

is instead implemented as a program mechanism.<br />

2.3 Literature review<br />

Previous work on the nurse scheduling problem (NSP) has been covered by many ap-<br />

proaches, taking different angles and perspectives throughout the problem environment.<br />

In this section, I briefly review articles that has served as inspiration to this project.<br />

Nonobe and Ibaraki [18] applies a general weighted constraint satisfaction problem<br />

(WCSP) solver, using a Tabu Search (TS), to a range of problems, incl. the NSP.<br />

Also applying a weight control mechanism to each iteration of TS works well for them.<br />

<strong>The</strong>y choose to handle hard and soft constraints on the same level of processing.<br />

Dias et al. [7] deals with a relatively large problem. <strong>The</strong>y apply both a Genetic Algorithm<br />

(GA) heuristic and a TS for solving a problem with over 1500 nurses, 30 supervisory<br />

nurses and 30 wards and finds that the two heuristics performs equally well, with one<br />

more time efficient and slightly worse results than the other and vice versa.<br />

In Bard and Purnomo [2] the authors discuss the issue of sudden shortages appearing due<br />

to the fluctuation in patients needing health care. <strong>The</strong> problems handled are relatively<br />

large, scheduling more than 120 nurses.


Chapter 2. <strong>The</strong> <strong>Doctor</strong> <strong>Rostering</strong> <strong>Problem</strong> 6<br />

Resende and Ribeiro [20] and Resende and Feo [19] considers the Greedy Random-<br />

ized Adaptive Search Procedure (GRASP). <strong>The</strong> GRASP described by the authors is<br />

the main source of inspiration for the metaheuristic chosen in this project. <strong>The</strong>y also<br />

implement various improvements to their GRASP, incl. reactive GRASP, automated<br />

RCL adjustments, variable neighborhoods, path-relinking, optimising memory-usage as<br />

well as allowing for efficient cooperative parallel strategies. <strong>The</strong>y show that the use of<br />

GRASP along with these improvements can significantly improve the time required to<br />

find a near-optimal solution compared to basic GRASP. Where Resende and Ribeiro<br />

[20] investigates the use of GRASP on the set covering problem, Resende and Feo [19]<br />

covers the effect of various hybridisations to GRASP.<br />

Burke et al. [5] reviews the state of Nurse Scheduling <strong>Problem</strong> research. In their review,<br />

they describe how different authors have approached the NSP, including bibliographic<br />

reviews and research papers on various algorithms for solving the NSP. Silvestro and<br />

Silvestro [22] argues that self-scheduling<br />

. . . can easily lead to over- or understaffing, that the schedule is made for<br />

the convenience of staff, and that there are no formal procedures for conflict<br />

solving.<br />

Opposite to this, Hung [14] argues that self-scheduling leads to greater staff-satisfaction<br />

and improves co-operation. Both are different approaches to viewing the subject. Sil-<br />

vestro and Silvestro [22] concludes that the benefits of self-scheduling relies on the size<br />

and complexity of the problem. It can work well in smaller wards where the constraints<br />

remain relatively simple. Burke et al. [5] also notes how finding the optimal solution is<br />

largely meaningless, when most hospital administrators want to get high quality results<br />

in a short amount of time. <strong>The</strong> administrators prefer quick generation of schedules that<br />

satisfy all hard constraints and as many soft constrains as possible. Another observation<br />

made by Burke et al. [5] is that optimal solutions in the literature tend to simplify the<br />

problem, making them inapplicable for real world problems.<br />

In their section covering TS, they note how Dowsland [8] allows search to go back and<br />

forth from the feasible region, which is an important feature as todays problems in large<br />

health care institutions tend to be nearly impossible to solve, while maintaining fea-<br />

sibility. Contrary to this, Burke et al. [3] develops a model in which search remains<br />

in the feasible part of the solution space. <strong>The</strong>y describe PLANE, a commercial nurse<br />

rostering system which employs a hybrid TS, embodying a TS coupled with either a<br />

diversification mechanism or a shuffling technique to model human scheduling behavior.<br />

Comparing their hybrid algorithm to a basic Steepest Descent (SD) search- or TS al-<br />

gorithm, they find that their hybrid search algorithm performs overall better than the


Chapter 2. <strong>The</strong> <strong>Doctor</strong> <strong>Rostering</strong> <strong>Problem</strong> 7<br />

original algorithms. Burke et al. [3] applies the model to several hospitals in Belgium,<br />

taking a dynamic, user-defined, set of constraints into account. Burke et al. [5] ends<br />

their review by concluding that very few of the solutions are applicable to real world<br />

problems and highlights a range of areas they believe would benefit from more research.<br />

<strong>The</strong>se includes Robustness (if a person calls in sick, most solutions suffer a chain-reaction<br />

of disruptions) and Ease of Use (no hospital administrator is able to set the parameters<br />

for any algorithm designed to solve a problem), noting how more research is needed on<br />

parameter-less algorithms.<br />

<strong>The</strong> varying nature of the problems solved in the literature, including the size of the<br />

staff, the complexity and amount of constraints, the type of shifts, demands, preferences<br />

and qualifications to name a few, indicates that NSP can not be classified as only one<br />

problem. For this to be the case, a uniform model of the problem is needed.


Chapter 3<br />

A mathematical model for the<br />

DRP<br />

This chapter describes the mathematical model for the doctor rostering problem stated<br />

by the medical practice. A number of constraints was given; some which has to be satis-<br />

fied (called hard constraints), and some which are not essential, but are preferably and<br />

as much as possible satisfied (the soft constraints). <strong>The</strong> hard constraints also partitions<br />

the solution space into feasible and infeasible. A solution is said to be feasible when no<br />

hard constraints are violated and infeasible otherwise. In this project, I model the DRP<br />

as a minimisation problem.<br />

3.1 Parameters<br />

<strong>The</strong> constraints have all been thoroughly discussed with the medical practice throughout<br />

the project. It should be noted that these all stem from personal point-of-views, wishes<br />

etc. as the medical practice is a private one, and not a public institution, which would<br />

no doubt be heavily influenced by union-restrictions and/or laws.<br />

In describing the constraints, the following binary variable is used:<br />

xijk =<br />

1 if on day i, shift j, the doctor is k<br />

0 otherwise<br />

And the following parameters are introduced:<br />

8


Chapter 3. <strong>The</strong> model and design 9<br />

⎧<br />

1 if on day i, doctor k has a shift<br />

⎪⎨<br />

j outside the house. It follows that<br />

bijk =<br />

the doctor is not available for the surrounding shifts<br />

⎪⎩ 0 otherwise<br />

⎧<br />

⎪⎨<br />

sij =<br />

⎪⎩<br />

⎧<br />

1 if on day i, doctor k has<br />

⎪⎨<br />

requested shift j off. <strong>The</strong> doctor is then<br />

cijk =<br />

available for the surrounding shifts<br />

⎪⎩ 0 otherwise<br />

l if on day i, shift j must be assigned 1+l<br />

doctors. This happens on noonshifts following weekends and<br />

holidays, and afternoonshifts preceding holidays<br />

0 otherwise<br />

<strong>The</strong> index j defines: 1: Night shift, 2: Noon shift, 3: Afternoon shift, 4: Evening shift.<br />

Furthermore, shift j is said to be an assignment shift (as) if it doesn’t lie on a holiday,<br />

nor a weekend and is not a night- nor evening shift.<br />

Let n be the number of days in the problem, and m be the number of doctors:<br />

i ={1, 2 . . . n}<br />

k ={1, 2 . . . m}<br />

In the following, I assume the schedule starts on a Monday, that the index of this day<br />

is 1 and that the schedule ends on a Sunday and the index of this day is n.<br />

I also define the sets of days:<br />

3.2 Hard constraints<br />

M : i%7 = 1 ∀i<br />

F : i%7 = 5 ∀i<br />

This section describes the constraints that must be satisfied for the solution to be feasible:


Chapter 3. <strong>The</strong> model and design 10<br />

H0 No doctor may take two shifts in a row:<br />

xijk + x i(j+1)k ≤ 1 ∀ i, j = {1, 2, 3}, k (H0)<br />

H1 After an evening shift, a doctor cannot have a noon shift on the following day:<br />

bi4k + x (i+1)2k ≤ 1 ∀ i = {1 . . . n − 1}, k (H1)<br />

H2 Following a night shift, a doctor cannot have a noon shift nor an afternoon shift:<br />

bi1k + xi2k + xi3k ≤ 1 ∀ i, k (H2)<br />

H3a <strong>Doctor</strong>s having a shift outside the house cannot have one in the house simultane-<br />

ously:<br />

H3b Requests for a shift off must be granted:<br />

H4 Demands must be met:<br />

xijk + bijk ≤ 1 ∀ i, j, k (H3a)<br />

xijk + cijk ≤ 1 ∀ i, j, k (H3b)<br />

m<br />

xijk = 1 + sij ∀ i, j (H4)<br />

k=1<br />

H5 No afternoon shift before an evening shift:<br />

3.3 Soft constraints<br />

xi3k + bi4k ≤ 1 ∀ i, k (H5)<br />

<strong>The</strong> soft constraints does not require validity for the solution to be feasible, though the<br />

quality of the solution improves the fewer soft constraints are invalid. Soft constraints are<br />

commonly modelled in the evaluation or objective function, as a sum of the penalties<br />

that arise when not satisfying the individual constraints. Each soft constraint has a<br />

weight δ attached, allowing the user to prioritise certain constraints over others.<br />

I now introduce the following variables:


Chapter 3. <strong>The</strong> model and design 11<br />

⎧<br />

⎪⎨ 1 if rule o is violated on<br />

yiko =<br />

⎪⎩<br />

0<br />

day i for doctor k<br />

otherwise<br />

⎧<br />

⎪⎨ 1 if rule 3 is violated on day i<br />

yijk3 =<br />

⎪⎩<br />

0<br />

shift j for doctor k<br />

otherwise<br />

⎧<br />

⎪⎨ 1 if the LHS of rule o is zero,<br />

tiko =<br />

⎪⎩<br />

0<br />

allows yiko to remain zero too<br />

otherwise<br />

⎧<br />

⎪⎨ 1 if the LHS of rule 3 is zero,<br />

tijk3 =<br />

⎪⎩<br />

0<br />

allows yijk3 to remain zero too<br />

otherwise<br />

<strong>The</strong> y-variables are used as counting variables, indicating how many violations of a soft<br />

constraint the doctor has. <strong>The</strong> t-variables are used for the specific case of the left hand<br />

side of the equation is zero. This variable, and the fact that we are dealing with a<br />

minimisation problem, allows the y-variable to remain zero.<br />

<strong>The</strong> following are the soft constraints that apply when constructing a model for the<br />

DRP:<br />

B0 No doctor should have both the Monday noon shift and the following Friday afternoon<br />

shift in the same week:<br />

min δB0<br />

<br />

i<br />

yik0<br />

<br />

∀ k<br />

st. xi2k + x (i+4)3k = 1 + yik0 − tik0<br />

∀ k, i ∈ M<br />

(B0)<br />

B1 No doctor should have both the Friday afternoon shift and the following Monday<br />

noon shift:<br />

min δB1<br />

<br />

i<br />

yik1<br />

<br />

∀ k<br />

st. xi3k + x (i+3)2k = 1 + yik1 − tik1<br />

∀ k, i ∈ F ∧ i < n − 3<br />

(B1)


Chapter 3. <strong>The</strong> model and design 12<br />

B2 All shifts assigned should be divided equally among all doctors.<br />

δB2<br />

⎛<br />

⎝max<br />

k<br />

<br />

i,j∈sa<br />

xijk − min<br />

k<br />

<br />

i,j∈sa<br />

xijk<br />

⎞<br />

⎠ (B2)<br />

B3 No doctor should have two noon shifts nor two afternoon shifts two days in a row:<br />

⎛<br />

min δB3 ⎝ <br />

i,j<br />

yijk3<br />

⎞<br />

⎠ ∀ k<br />

st. xijk + x (i+1)jk = 1 + yijk3 − tijk3<br />

∀i = {1 . . . n − 1}, j ∈ sa, k<br />

B4 No doctor should have the afternoon shift the day after an evening shift:<br />

min δB4<br />

<br />

i<br />

yik4<br />

<br />

∀ k<br />

st. bi4k + x (i+1)3k = 1 + yik4 − tik4<br />

∀i = {1 . . . n − 1}, k<br />

B5 No doctor should have the noon shift the same day as an evening shift:<br />

min δB5<br />

<br />

i<br />

yik5<br />

<br />

∀ k<br />

st. bi4k + xi2k = 1 + yik5 − tik5<br />

∀i, k<br />

(B3)<br />

(B4)<br />

(B5)<br />

B6 No doctor should have the noon shift the day after an afternoon shift and vice verca:<br />

min δB6a<br />

<br />

i<br />

yik6a<br />

<br />

∀ k<br />

st. xi3k + x (i+1)2k = 1 + yik6a − tik6a<br />

min δB6b<br />

∀i = {1 . . . n − 1}, k<br />

<br />

i<br />

yik6b<br />

<br />

∀ k<br />

st. xi2k + x (i+1)3k = 1 + yik6b − tik6b<br />

∀i = {1 . . . n − 1}, k<br />

(B6a)<br />

(B6b)


Chapter 3. <strong>The</strong> model and design 13<br />

3.4 <strong>The</strong> objective function<br />

<strong>The</strong> constraints described in the two previous sections is the complete list of constraints<br />

as the medical practice has described them.<br />

<strong>The</strong> objective function value of a schedule s is the collective sum of the above described<br />

soft constraints and is denoted z(s):<br />

min z(s) = δB0<br />

+ δB2<br />

<br />

i<br />

⎛<br />

yik0<br />

⎝max<br />

k<br />

⎛<br />

+ δB3 ⎝ <br />

+ δB5<br />

+ δB6b<br />

i,j<br />

<br />

i<br />

<br />

i<br />

<br />

+ δB1<br />

i,j∈sa<br />

<br />

i<br />

yik1<br />

<br />

<br />

xijk − min<br />

k<br />

<br />

⎞ <br />

<br />

⎠ + δB4<br />

yijk3<br />

yik5<br />

<br />

yik6b<br />

+ δB6a<br />

<br />

i<br />

<br />

∀k<br />

i<br />

i,j∈sa<br />

yik4<br />

yik6a<br />

xijk<br />

<br />

<br />

⎞<br />

⎠<br />

(Z(S))<br />

An objective function value of 0 means that we have found an optimal solution for any<br />

DRP problem. If the objective function value is positive, it can still be optimal, but<br />

under any circumstances means that one or more soft constraints are invalid. Leaving<br />

the weight, δ, of all the soft constraints equal to 1 means that we can derive from an<br />

objective function value of i.e. 4, that soft constraints are invalid in 4 cases. If we<br />

choose to alter the weights of the rules, the same still applies, but the transparency of<br />

the objective function value decreases.<br />

<strong>The</strong> objective function thus determines the value of solutions for the DRP and is used<br />

by optimal solvers such as GAMS (see chapter 5) and the heuristics in the next chapter,<br />

which will describe how solutions can be found for the DRP.<br />

3.4.1 <strong>Problem</strong> size<br />

<strong>The</strong> amount of variables with 4 shifts per day, 6 doctors and 100 working days:


Chapter 3. <strong>The</strong> model and design 14<br />

|V ars| = |Shifts| · |<strong>Doctor</strong>s| · |Schedule|<br />

= 4 · m · n = 4 · 6 · 100<br />

= 2400<br />

Given 10 constraints, the total number of constraints for this problem becomes:<br />

|Equations| = |Shifts| · |<strong>Doctor</strong>s| · |Schedule| · |Constraints|<br />

= 4 · m · n · 10 = 4 · 6 · 100 · 10<br />

= 24000<br />

Commonly, problems are big if they have more than 2500 variables and 10000 equations.<br />

This is not ruling out that any larger problems can not be solved, as techniques (i.e.<br />

Cutting-plane method, Branch and cut) exist that, using the constraints, can limit the<br />

search region of the problem. A topic not addressed in this project.


Chapter 4<br />

Solving the DRP<br />

In this chapter, the reader is presented with several methods for solving the DRP. First,<br />

the complexity of the problem is analysed and based on this, an approach is chosen. For<br />

each chosen method I briefly discuss the background, the theory and common extensions.<br />

In the last section I cover how they were implemented in this project.<br />

4.1 DRP complexity<br />

Complexity theory investigates how algorithms scale when the problems given as input<br />

to the algorithms scales. <strong>Problem</strong>s are divided into two main complexity classes, the P<br />

and NP classes. <strong>The</strong> two classes represent the problems that can be solved in polynomiel<br />

time and those that can be solved nondeterministicly in polynomiel time. <strong>The</strong> NP-class<br />

also have the property that a postulate in the form of a Yes/No question is verifiable in<br />

polynomiel time. Another class is NP-hard problems, that are defined as those problems<br />

which all NP-problems can be transformed into. NP-hard problems are, put another way,<br />

those which are at least as hard as NP problems (but may be harder). NP-hard problems<br />

does not need to be a postulate in the form of a Yes/No question. Some problems are<br />

also NP-complete and are defined as those which are both NP-hard and are also NP.<br />

With these definitions in mind, one should be aware of the complexity of the problem<br />

for which a solution is sought. <strong>The</strong> NP-complete problems should be given special<br />

attention, as the time to solve these grow exponentially with the size of the problem.<br />

<strong>The</strong>se problems are also called intractable. Meaning, exploring the entire feasible region<br />

of any but the smallest problems, is impossible in any lifetime.<br />

This means, that if DRP is NP-complete, we can start looking for approximations or<br />

partial solutions since there is little chance an algorithm can be developed able to solve<br />

15


Chapter 4. Solving the DRP 16<br />

it in a short amount of time (Hopcroft et al. [13]). If the DRP problem is NP-complete<br />

and an algorithm does exist, able to solve the problem deterministically in polynomial<br />

time, then it would follow that all NP-complete problems are solvable deterministically<br />

in polynomial time and so P = NP , a statement that has been investigated for the last<br />

50 years without any definite results 1 . As such, it is widely believed that P = NP , since<br />

no polynomial time algorithms has been devised to solve an NP-complete problem.<br />

To prove that a problem is NP-complete, one can transform an already known NP-<br />

complete problem (in polynomial time) to the problem for which a proof is sought.<br />

Fortunately, a problem, very close to the DRP, has already been proven NP-complete. It<br />

is stated in Garey and Johnson [10] as [SS19], referring to Even et al. [9] who transformed<br />

the 3SAT (Karp [15]) problem, which again was transformed from the SAT problem<br />

(Cook [6]). <strong>The</strong> chain of transformations is shown in figure 4.1.<br />

Figure 4.1: <strong>The</strong> transformation chain from SAT to Timetable Design<br />

Garey and Johnson [10] defines the instance as: A set H of ”work periods”, a set C<br />

of ”craftsmen”, a set T of ”tasks”, a subset A(c) ⊆ H of ”available hours” for each<br />

craftsman c ∈ C, a subset A(t) ⊆ H of available hours for each task t ∈ T , and, for each<br />

pair (c, t) ∈ C × T , a number R(c, t) ∈ Z + 0<br />

of ”required work periods”.<br />

Applying this to the DRP: <strong>The</strong> set H defines the work periods in which shifts must lie,<br />

the set C is the set of doctors and the set T is the shifts. A(c) defines when a doctor<br />

is available, which in this project is defined by all the hard constraints except H4. A(t)<br />

describes when a shift can be performed and R(c,t) defines how long a shift t takes<br />

for doctor c to perform. In this project R(c, t) = 1 ∀ c, t. This instance describes a<br />

timetable for completing all shifts in time. <strong>The</strong> Timetable Design problem can thus be<br />

transformed to the DRP and hence, DRP is NP-complete. This means that no known<br />

algorithm can deterministically find an optimal solution to the DRP in polynomiel time.<br />

4.2 Exact methods<br />

Given a set of constraints, as described in chapter 3, the goal of finding a solution to the<br />

problem can be accomplished by using an optimal solver such as GAMS. As concluded<br />

above, solving the DRP to optimality can take an exponential amount of time. Due to<br />

1 One of the Millennium <strong>Problem</strong>s : Claymath.org/millennium/


Chapter 4. Solving the DRP 17<br />

this, only a subproblem of the DRP is tried and tested in an optimal solver (see chapter<br />

5).<br />

To overcome the problem of exponential search time, approximations or heuristics are<br />

used.<br />

4.3 Heuristics for the DRP<br />

Heuristics are trial-and-error methods, using some evaluation or objective function to<br />

evaluate solutions. It is important to note that optimality of the results obtained from<br />

heuristics can not be guaranteed and a measure of how good the heuristic is, can be hard<br />

to find. <strong>The</strong> main goal of a heuristic is to find high quality or near-optimal approxima-<br />

tions to solutions of a computationally difficult problem, in a relatively short amount<br />

of time. A key part of heuristics is the fact that they are tailored specifically for the<br />

problem to which they are applied, using problem specific knowledge to guide the search<br />

for better solutions. Heuristics can be either deterministic, meaning, given the same<br />

input, then the heuristic will produce the same result every time, or non-deterministic<br />

and are non-exhaustive, since if they were exhaustive, they could be classified as an<br />

exact method, and not an approximation.<br />

Different types of heuristics exist to reach a solution. First, there are constructive- or<br />

construction heuristics, that builds a solution from scratch. <strong>The</strong>se are considered fast<br />

as they are often only used once or in a one-pass manner. <strong>The</strong> second type of heuristics<br />

are optimisation heuristics, such as the class of Local Search (LS) heuristics, exploring<br />

the solution space around a given solution, using a well defined function. <strong>The</strong> last<br />

notion of heuristics that will be addressed here, are Metaheuristics. <strong>The</strong>se are a class of<br />

more general, in some sense advanced or sophisticated, heuristics, using some algorithm-<br />

dependent mechanism to guide the search for a better solution. In this project, three<br />

heuristics will be addressed; a greedy construction heuristic, the Greedy Randomized<br />

Adaptive Search Procedure metaheuristic and the Simulated Annealing metaheuristic.<br />

Due to the structure of this problem, I (similar to Dowsland [8]) allow infeasible solutions<br />

in the heuristics, thus not only seeking global optimum of objective function value, but<br />

also seeking minimisation of violations of hard constraints. Minimising these violations<br />

is of higher priority than the objective function value.


Chapter 4. Solving the DRP 18<br />

4.3.1 A construction heuristic<br />

<strong>The</strong> initial solution is the basis for optimisation and as such, is an important part of any<br />

heuristic modelled to solve this problem. One goal of a construction heuristic is often<br />

to be fast as to allow time to be focused on other parts of the process. In the context of<br />

this DRP, several construction heuristics can be identified:<br />

Zero solution is a straightforward and easy solution to construct and consists of noth-<br />

ing but an empty schedule. This is a very fast (O(1)) solution to generate but is<br />

infeasible (over all shifts) due to constraint H4 on page 10.<br />

Random solution consists of randomly assigning doctors to shifts that are unassigned,<br />

until all shifts are assigned a doctor. This can be done by assigning each shift a<br />

random doctor, or, for each doctor, assigning that doctor to approximately n<br />

m<br />

random shifts. <strong>The</strong> random solution does not guarantee feasibility and is worse,<br />

in running time (O(n)), than the zero solution.<br />

Greedy solution is based on the concept of choosing what looks best, given a candi-<br />

date set and a selection function, here and now. That is, it bases its choice upon<br />

knowledge of the present and past shifts, but not the future ones as they have not<br />

yet been assigned a doctor. It makes no reconsideration of past choices, contrary<br />

to e.g. dynamic programming algorithms, that bases decisions on all previous de-<br />

cisions and as such, may reconsider the past. Several notions of the candidate set<br />

are used in the literature, but in the context of this project, I define the Local<br />

Candidate List as a list unique to each shift consisting of all doctors, ordered by<br />

their heuristic value when assigning them to the given shift. <strong>The</strong> greedy algorithm<br />

picks the best doctor from the candidate list and assigns it to the shift at hand.<br />

<strong>The</strong> basic version of the greedy is deterministic, i.e. given the same input, greedy<br />

always returns the same output. In an adaptive greedy algorithm (Resende and<br />

Ribeiro [20]), the doctor is randomly chosen from the local candidate list. To rule<br />

out the possibility of choosing the worst doctor for the shift, I introduce the Re-<br />

stricted Candidate List as the n best, measured by either a heuristic value or by a<br />

percentage, elements in the candidate list. Figure 4.2 on the next page illustrates<br />

various kinds of RCL parameters for a minimisation problem. Another option for<br />

the RCL list, is to define it as a list of ordered pairs, consisting of all unassigned<br />

shifts coupled with the doctor that has the highest heuristic value when assigned to<br />

the specific shift. This option was discarded due to the time required to construct<br />

the list being O(n · m) and the fact that the list would have to be reconstructed<br />

for each shift. <strong>The</strong> greedy solution does not guarantee feasible solutions, though<br />

the odds has improved vastly, from that of the random solution.


Chapter 4. Solving the DRP 19<br />

(a) RCL: 50% elements<br />

(rounded<br />

down)<br />

(b) RCL: 5 elements<br />

(c) RCL: Value<br />

below 5.0<br />

Figure 4.2: Various types of RCL parameters<br />

(d) RCL: Value<br />

below 60 % of the<br />

worst<br />

<strong>The</strong> various construction heuristics all bring advantages and disadvantages. <strong>The</strong>se are<br />

outlined in table 4.1.<br />

Feasible Construction Evaluation<br />

Zero solution No O(1) O(1)<br />

Random solution Perhaps O(n) O(n)<br />

Greedy solution Perhaps O(n · m) O(n)<br />

Table 4.1: <strong>The</strong> initial solutions<br />

Out of the described heuristics, the adaptive greedy algorithm is chosen as the con-<br />

struction heuristic of this project, along with the RCL parameter type shown in figure<br />

4.2(a). This type of RCL parameter ensures that a certain degree of randomisation can<br />

be achieved, contrary to the RCL parameter shown in figure 4.2(b), where an absolute<br />

size is chosen (this can not ensure a certain degree of randomisation when the size of<br />

the RCL varies).<br />

<strong>The</strong> adaptive greedy algorithm is outlined in algorithm 4.1.<br />

Algorithm 4.1 Adaptive greedy - require: RCL parameter p, schedule S<br />

for all Unassigned Shift in S do<br />

RCList = {}<br />

for all <strong>Doctor</strong>s do<br />

RCList ← RCList ∪ V alueOf(<strong>Doctor</strong>, Shift)<br />

end for<br />

Sort(RCList)<br />

Restrict RCList according to p<br />

Pick a doctor randomly from RCList and assign it to Shift<br />

end for


Chapter 4. Solving the DRP 20<br />

Given a schedule, a need to improve upon this schedule arises. This is where neighbor-<br />

hoods comes in.<br />

4.3.2 Neighborhoods and Local Search<br />

To guide the search in finding better solutions, I introduce the well known term Neigh-<br />

borhoods. A neighborhood is defined as:<br />

N(S) = { solutions obtained by applying a single local transformation to S }<br />

A neighbor is a potential replacement for a solution and need only vary from the solution<br />

at hand by a single element. <strong>The</strong> whole set of replacements produced by some change<br />

or function on the solution is called a neighborhood. <strong>The</strong> process of moving from one<br />

solution to another in its basic form, is called Local Search (LS) and is, if exhaustive,<br />

able to find a local optimum. Figure 4.3 shows how moving through the solution space<br />

may increase and decrease the heuristic value of the solution. Only accepting solutions<br />

with higher Z(S) is called hill climbing (and analogously hill descending).<br />

Figure 4.3: Local and global optima<br />

For any given problem, several possible neighborhoods often exist. <strong>The</strong> neighborhoods<br />

identified in this thesis are, thanks to the nature of this problem, two very simple<br />

functions:<br />

Rotation is moving the doctor of all shifts to another shift in the set, such that all<br />

doctors are moved in rotation. <strong>The</strong> principle is depicted in figure 4.4 on the next<br />

page<br />

Inversion is for all selected shifts, to populate the shifts with another doctor than the<br />

one that is originally assigned to it. Figure 4.5 on the following page illustrates the<br />

principle. One could pass an empty schedule to a Local Search algorithm using


Chapter 4. Solving the DRP 21<br />

Figure 4.4: <strong>The</strong> rotation principle<br />

this neighborhood and it would then populate the shifts itself. This would then<br />

be similar to the random initial solution.<br />

Figure 4.5: <strong>The</strong> inversion principle<br />

For each of them, it applies that a random set of shifts are selected, upon which the<br />

function is carried out.<br />

One immediate advantage of these neighborhoods, is that they are simple and easy to<br />

implement. <strong>The</strong> implementation of these can be found in appendix A.1.<br />

Nielsen [17] also implements the inversion and rotation, which is similar to the insert,<br />

delete and replace moves in the neighborhoods chosen in Meisels and Schaerf [16]. Both<br />

rotation and inversion can be translated to a combination of replace moves. Other than<br />

these sources, very few authors in the literature describe their neighborhood functions<br />

in-depth. This may be due to how the structure and nature of problems often limits the<br />

choices in neighborhoods to a degree, where the choice seems obvious.<br />

It is important to recognise that the generation of neighbors is a factor in the running<br />

time of the entire search. As such, I have placed an upper limit on how many shifts are<br />

randomly selected and used in the neighborhood.


Chapter 4. Solving the DRP 22<br />

Since the two neighborhoods described above are both based on a set of randomly<br />

chosen shifts and we are dealing with a relatively large problem, search exhaustion of<br />

the neighborhoods in any reasonable amount of time is impossible. As one of the goals<br />

of this project is to reach a relatively good solution within a relatively short amount of<br />

time, LS needs another stop-criterion. Two very common criteria are time and iterations<br />

(neighborhoods explored), which is implemented in this project. A less common criteria,<br />

also worth noting, is stopping LS after a certain amount of time has passed without any<br />

improvements to the incumbent solution.<br />

For a minimisation problem algorithm 4.2 lists the basic LS.<br />

Algorithm 4.2 Local Search - require: schedule S<br />

S ← S<br />

while ¬Stop do<br />

S ← choose S from N(S)<br />

if z( S) < z(S) then<br />

S ← S<br />

end if<br />

end while<br />

If the N(S) function selects random neighbors, then the LS in algorithm 4.2 is called<br />

a random improving search, moving to the first (randomly selected) solution that im-<br />

proves the value of the incumbent. Contrary to this approach, there is also the best<br />

improving search, where all members of the neighborhood is inspected and the best is<br />

chosen (Nielsen [17], Resende and Feo [19]) and first improving, where the neighbors are<br />

investigated systematically and the first one to improve the incumbent is chosen (Nielsen<br />

[17]).<br />

When LS is only accepting better solutions, it can suffer the fate of getting stuck in<br />

a local optimum. To get out of these, and hopefully move on to a global optimum,<br />

several techniques exist that allows Local Search to leave a better solution for a worse,<br />

in hope of eventually finding a new best solution. Three such techniques are GRASP,<br />

the Simulated Annealing (SA) algorithm and the Tabu Search (TS). <strong>The</strong> TS, originally<br />

presented in its final form by Glover [11], enables the search to accept non-improving<br />

solutions, while cycling back to previously explored solutions is prevented through the<br />

Tabu List containing the most recent solutions visited. While both TS and Simulated<br />

Annealing can require extensive parameter tuning for desired results to be reached,<br />

GRASP requires little to none. GRASP and Simulated Annealing was chosen and will<br />

be described in the following sections.


Chapter 4. Solving the DRP 23<br />

4.3.3 <strong>The</strong> GRASP metaheuristic<br />

When heuristics come up short in the search for an acceptable solution, perhaps getting<br />

stuck in local optima, several improvements can be implemented. <strong>The</strong> improvement can<br />

be as simple as implementing a restart mechanism into the algorithm. <strong>The</strong> framework<br />

consisting of such ’outer’ mechanisms that guide heuristics are called metaheuristics.<br />

Burke and Kendall [4] defines a metaheuristics, referring to Glover and Laguna [12], as:<br />

. . . a master strategy that guides and modifies other heuristics to produce<br />

solutions beyond those that are normally generated in a quest for local op-<br />

timality.<br />

which is also implied in the name, derived from the prefix meta (beyond) and heuristic<br />

(to find).<br />

A metaheuristic is a general framework used when knowledge of the problem, that can be<br />

exploited, is sparse or if implementation of a problem-specific algorithm is impractical.<br />

It requires little to no information and as such, acts similar to a black box, taking<br />

a problem as input and if it can find one, gives a solution as output. <strong>The</strong> fact that<br />

metaheuristics are general search algorithms brings up the issue of whether there exists<br />

a better algorithm for the purpose of solving the problem. Whitley and Watson [25]<br />

concludes from Wolpert and Macready [26] that:<br />

For all possible performance measures, no search algorithm is better than<br />

another when its performance is averaged over all possible discrete functions.<br />

Which is the conclusion of applying the No Free Lunch theorem to search. Whitley and<br />

Watson [25] notes, much as Wolpert and Macready [27] concludes, that search algorithms<br />

need to be tailored to the problem, exploiting problem specific information as much as<br />

possible.<br />

<strong>The</strong> search algorithms in this project does not, as the above suggests, exploit problem<br />

specific information in the search for better solutions. <strong>The</strong> two neighborhood functions<br />

described in section 4.3.2 on page 20 can be enhanced to cater for the problem specific<br />

constraints, which is also suggested in section 8.2.<br />

<strong>The</strong> Greedy Randomized Adaptive Search Procedure (GRASP) is a metaheuristic. GRASP<br />

has very few parameters, namely a RCL parameter and a stop-criterion (commonly time<br />

or iterations) and as such is easy to implement. This allows the developer to put focus<br />

on implementing optimal data structures. GRASP is an iterative process, in which each<br />

iteration consists of two phases:


Chapter 4. Solving the DRP 24<br />

1. Construction of an initial solution, using a given construction heuristic. In this<br />

project, the construction heuristic used in GRASP is the same as the adaptive<br />

greedy algorithm described above. <strong>The</strong> RCL parameter is used during the con-<br />

struction phase in the same manner, though, in more sophisticated versions of<br />

GRASP, the probabilistic when choosing the random element from the RCL can<br />

be influenced by a learning mechanism (more on this later). Resende and Ribeiro<br />

[20] defines the re-evaluation of the RCL list as the adaptive part of the algorithm.<br />

In this project, re-evaluation of the RCL does not occur as the RCL list is only<br />

created once per shift.<br />

2. Local Search for a better solution.<br />

Over all iterations, the best incumbent solution is kept and at the end returned by the<br />

algorithm.<br />

<strong>The</strong> basic GRASP algorithm, for a minimisation problem, is listed in algorithm 4.3.<br />

Algorithm 4.3 GRASP - require: RCL parameter p<br />

S ← new empty schedule<br />

S ← ∅<br />

while ¬ Stop do<br />

S ← Greedy(p, S)<br />

S ← Local Search( S)<br />

if z( S) < z(S) then<br />

S ← S<br />

end if<br />

end while<br />

One key point, as noted in Resende and Feo [19] and Resende and Ribeiro [20], of<br />

GRASP is that many initial solutions can be generated in the same amount of time that<br />

one LS takes to finish. <strong>The</strong> best of these random initial solutions are often better than<br />

the one found by LS. Resende and Feo [19] also notes that while a fully greedy RCL<br />

parameter (one that leaves only the best element in the RCL) may produce a good mean<br />

solution value, it is also often suboptimal. When relaxing the RCL parameter, the mean<br />

value degrades but the variance of the solutions found increases and thus leaves room<br />

for finding a solution that outperforms the mean of the fully greedy RCL parameter.<br />

While being a simple algorithm, GRASP still allows for a number of hybridisations.<br />

<strong>The</strong>se enhancements are meant to remove or improve upon the shortcomings of the<br />

framework. One obvious flaw in the GRASP framework is the lack of memory usage. In<br />

the basic GRASP, all information is discarded between each iteration. Resende and Feo<br />

[19] identifies several enhancements that could well be classified as learning mechanisms.<br />

<strong>The</strong>se include:


Chapter 4. Solving the DRP 25<br />

• Reactive GRASP in which the RCL parameter is automatically tuned in each it-<br />

eration of GRASP, produces better results than a static RCL parameter. Resende<br />

and Ribeiro [20] restates a formulation including a set of RCL parameters coupled<br />

with a probability to choose that exact parameter. <strong>The</strong> probability for each pa-<br />

rameter is reevaluated each iteration, using the average value of solutions found<br />

through the parameter and the incumbent.<br />

• Cost pertubation is an idea of maintaining a list of prizes corresponding to the<br />

value of adding each element to the solution in the construction phase. This list<br />

is then maintained by two different schemes: Pertubation by elimination, where a<br />

fraction of the element prizes are set to zero, and Pertubation by prize changes, in<br />

which each prize is changed by a factor produced by a parameter.<br />

• Bias functions are probability distributions used to bias the selection of the RCL<br />

elements.<br />

• Intelligent construction: memory and learning that covers long-term memory, such<br />

as the one used in Tabu Search.<br />

• POP in construction, where a Local Search is applied during the construction of<br />

the initial solution.<br />

• Path-relinking, where paths between elite solutions are constructed and explored<br />

in hope of finding better solutions.<br />

<strong>The</strong> time horizon on this project did not allow implementation of these improvements,<br />

however, specific improvements to the current implementation has been suggested in<br />

chapter 8.<br />

4.3.4 <strong>The</strong> Simulated Annealing metaheuristic<br />

<strong>The</strong> Simulated Annealing (SA) algorithm is an analogue to the real world process that<br />

takes place during controlled cooling of solids. If a solid is melted, the particles in the<br />

matter arranges themselves randomly, whereas in a solid state, the particles arranges<br />

themselves in a structured lattice (Aarts et al. [1]). When cooling the melted solid, the<br />

energy of the atoms decreases and the atoms then arrange themselves in the lattice. At<br />

lower temperatures, a change of state in the solid is less likely to occur. <strong>The</strong> result of the<br />

process, with a high enough maximum temperature and a slow enough cooling, being a<br />

solid whose particles are arranged in the most stable way possible.<br />

Analoguesly, in the appliance of SA to computational problems, the chance of accepting<br />

a neighborhood leading to a worse objective function value (higher energy in the solid)


Chapter 4. Solving the DRP 26<br />

decreases over time. Given, a temperature T , an incumbent value z(S) and a neighbor<br />

value z( S), the probability of accepting a neighborhood, in a minimisation problem, is<br />

commonly chosen to be the Metropolis criterion:<br />

pmin(z(S), z( S), T ) =<br />

<br />

1 if z( S) ≤ z(S)<br />

exp( z( S)−z(S)<br />

T ) otherwise<br />

When the algorithm starts and the temperature is still high, the criterion accepts arbi-<br />

trarily large deteriorations in solution value, but as the temperature drops only smaller<br />

deteriorations are accepted and finally, when the temperature reaches zero, no deteri-<br />

orations are accepted. At this point, the SA is essentially a basic, hill climbing (or<br />

descending), LS. <strong>The</strong> temperature is controlled by some scheme, also implemented in<br />

this project, that can be as simple as T = α · T , where α ∈ [0, 1[. This scheme is a static<br />

scheme, but one can also choose a dynamic scheme, such as one based on the ratio of<br />

accepted solutions.<br />

Algorithm 4.4 outlines the basic SA steps.<br />

Algorithm 4.4 Simulated Annealing - require: Schedule S, start temperature T<br />

S ← S<br />

while ¬Stop do<br />

S ← choose S from N(S)<br />

if z(S) > z( S) then<br />

S ← S<br />

else if exp( z( S)−z(S)<br />

T<br />

S ← S<br />

end if<br />

T ← Update(T )<br />

end while<br />

) > random[0,1) then<br />

<strong>The</strong> initial value and update of the temperature in each iteration is one of the parameters<br />

that need to be tuned to each problem. In this project I set T = 1000 and α = 0.999.<br />

<strong>The</strong>se values was accepted after due tuning and allows the temperature to drop towards<br />

a defined end-temperature in a steady manner. An example is given in figure C.2 in<br />

appendix C.2.5.<br />

4.3.5 Heuristic bounds<br />

It can be useful to describe the bounds of the search algorithm which is chosen. I do<br />

however feel, that proving the bound of the approximations described above is out of<br />

the scope of this project and I thus leave it for future considerations. Chapter 7 includes<br />

(M)


Chapter 4. Solving the DRP 27<br />

Figure 4.6: <strong>The</strong> implementation of the schedule<br />

tests of the heuristics which should provide an indication of the performance of the<br />

heuristics.<br />

4.4 Heuristic implementations<br />

In this section, I will briefly cover the implementation of the heuristics described in<br />

this chapter, but before doing so, it is necessary to describe the data structure of the<br />

implementation.<br />

4.4.1 <strong>The</strong> data structure<br />

<strong>The</strong> language chosen to implement the heuristics is Java. It contains specific JDK 1.6<br />

implementations, meaning that the runtime environment required to run the program is<br />

Java JRE 1.6, which can be downloaded from Sun.com. <strong>The</strong> fact that one goal of this<br />

project was to deliver a program allowing the end user to produce schedules and that I<br />

had no previous experience with other environments than Java, made this decision easy.<br />

<strong>The</strong> approach chosen to design the program is one where user friendliness is prioritised.<br />

It was accepted from the beginning that neither I nor the end user would appreciate<br />

a low level language implementation, such as one in C, containing no graphical user<br />

interface.<br />

<strong>The</strong> implementation is done in an object oriented approach, meaning that every schedule,<br />

shift and day is instantiated as objects. This approach is chosen due to simplicity when<br />

modeling the problem. A downside to this is that the amount of object allocations can<br />

rise quickly when testing several problem instances.<br />

<strong>The</strong> schedule is modeled as a list (a Vector) of days and days are modeled as a list (an<br />

ArrayList) of shifts. Due to constraint H4, all days contains four shifts, while certain<br />

days contains five or six. <strong>The</strong> implementation is pictured in figure 4.6.


Chapter 4. Solving the DRP 28<br />

This model, where only a variable for each day and shift is available, is different from<br />

what is done in an optimal solver, i.e. GAMS. <strong>The</strong> difference lies in the approach of<br />

solving the problem. In my implementation, each shift object is assigned a doctor object,<br />

is chosen. In the GAMS model, a binary variable for every day, shift and doctor exists.<br />

<strong>The</strong> schedule, being the main object of the implementation also contains the methods<br />

for selecting the best doctor for a given shift or day. <strong>The</strong>se two methods are included in<br />

appendix A.5.<br />

In the following sections, I describe the implementation of the construction heuristic and<br />

the metaheuristics chosen in this project. It is important to note that the implemen-<br />

tations share several methods and therefore are extending the same basic class. This<br />

allows the classes to take advantage of Javas extend, allowing the heuristics to inherit<br />

methods that they share from so called parent classes. This is depicted in figure 4.7.<br />

4.4.2 A partial enumeration<br />

Figure 4.7: Heuristics inheritance<br />

In the construction heuristic, the option of enumerating the assignments of a whole day<br />

of shifts, as opposed to only assigning one shift at a time, is available. <strong>The</strong> enumeration<br />

algorithm produces all permutations of size k chosen from N elements and is adopted<br />

from Sedgewick and Wayne [21] (which no longer seems to be available as of the time of<br />

writing). Sedgewick and Wayne [21] originally created the class for use with characters<br />

only. I adopted it into a version permuting a list of doctor objects instead. This<br />

permutation class can be found in appendix A.5.2.


Chapter 4. Solving the DRP 29<br />

As there are between two and four shifts on a given day, with six doctors to choose from,<br />

we get between: n!<br />

(n−k)!<br />

= 6!<br />

(6−2)! = 30 and 6!<br />

(6−4)!<br />

= 360 possible combinations, which is,<br />

at maximum, an increase of 6000% in combinations to explore. On a 1 GHz computer,<br />

this results in a solution generation taking several minutes as opposed to no enumeration<br />

solutions taking mere seconds. <strong>The</strong> increase in time when using enumeration makes fur-<br />

ther enumeration, a whole week for instance (332640 possible combinations), undesirable<br />

to the end user. Testing of this function proved useful as shall be shown in chapter 7.<br />

4.4.3 Construction heuristic<br />

<strong>The</strong> implementation of the greedy algorithm is, given the data structure, straight for-<br />

ward. <strong>The</strong> implementation can be found in appendix A.2, and in short, loops through<br />

each day, each shift and requests the best doctor for either the shift or the set of best<br />

doctors for the whole day (depending on whether the enumeration is used) and then<br />

performs the assignments that are returned.<br />

4.4.4 Metaheuristics<br />

For the implementation of the two metaheuristics, it applies that a neighborhood is<br />

investigated by the following procedure:<br />

1. Find neighborhood n<br />

2. Apply neighborhood n<br />

3. Calculate objective function value and feasibility<br />

4. Decide whether:<br />

(a) To keep the new solution<br />

(b) To undo neighborhood n<br />

When applying the neighborhood-transformation to a solution, the information con-<br />

tained in the neighborhood is saved, such that the search procedure can quickly revert<br />

the transformation if the new solution should turn out inferior.<br />

GRASP<br />

My implementation of the GRASP framework is based, to the letter, on the algorithms<br />

describing the adaptive greedy algorithm (algorithm 4.1 on page 19) and Local Search<br />

(algorithm 4.2 on page 22). <strong>The</strong> entire GRASP class is found in appendix A.3.


Chapter 4. Solving the DRP 30<br />

Simulated Annealing<br />

<strong>The</strong> Simulated Annealing implementation is based on algorithm 4.4 on page 26 and is<br />

included in appendix A.4.<br />

4.4.5 Implementation optimisations<br />

As noted above, the two heuristics calculate the objective function value and feasibility<br />

every time a neighborhood transformation has been applied. This presents an obvious<br />

area for optimisation. One optimisation that did not make it into the implementation<br />

is that of a delta function, which I describe in detail in chapter 8.<br />

As one of the questions that spring to mind when developing an application could be:<br />

What operations of this implementation are taking the most time?, I was fortunate to<br />

be in possession of a tool to investigate this exact area. <strong>The</strong> Netbeans IDE 6.1 allows<br />

profiling of the program, enabling the developer to investigate which methods are taking<br />

the most time. When doing so, I found that the operation requiring the most time are<br />

Hash Code checks. Hash Codes are 32 bit signed integers identifying objects by a single<br />

value, found by the use of prime numbers and the values of the class-fields.<br />

<strong>The</strong> new (optimised) hash code this lead to, can be seen in listing 4.1, where several<br />

lines, now commented out, were previously calculated. Only the ID-number is really<br />

needed to uniquely identify the doctor.<br />

1 public class <strong>Doctor</strong> implements Comparable < <strong>Doctor</strong> >, Serializable {<br />

2<br />

.<br />

3 @Override<br />

4 public int hashCode () {<br />

5 // final int prime = 31;<br />

6 // int result = 1;<br />

7 // result = prime * result + IDnumber ;<br />

8 // result = prime * result + (( name == null ) ? 0 : name . hashCode ());<br />

9 // result = prime * result + numberOfShifts ;<br />

10 // result = prime * result + (( shifts == null ) ? 0 : shifts . hashCode ());<br />

11 return IDnumber ;<br />

12 }<br />

13<br />

.<br />

14 }<br />

Listing 4.1: <strong>The</strong> new hashcode method<br />

<strong>The</strong> optimisation may not seem that big, but when the calculation of this hash code<br />

is done once per doctor per shift per constraint, every time we need to calculate the<br />

objective function value, it adds up!


Chapter 5<br />

Optimal solution<br />

This chapter provides a comparison of solutions to the DRP provided by GAMS, the<br />

adaptive greedy algorithm and the GRASP metaheuristic described in section 4.3 re-<br />

spectively. Testing of SA has been left to chapter 7. Only a subproblem comparison is<br />

done due to the complexity of the problem and therein the explosion in time required<br />

by GAMS to reach a solution.<br />

<strong>The</strong> model implemented in GAMS is the mathematical model described in chapter 3. In<br />

this model, a binary variable for every day, shift and doctor exists. It could potentially<br />

be done with positive variables equal to the id of the doctor assigned to each shift, but<br />

then the problem of assigning two doctors to a shift arises.<br />

5.1 Comparison<br />

To properly measure how good the solutions found through the heuristics described in<br />

chapter 4 are, we need to compare them to some solution, whose bounds we can prove.<br />

That is, find an optimal solution and measure the heuristic value of that particular<br />

solution to the heuristic value of schedules found through the heuristics. This will give<br />

an indication of how far from optimum the heuristics are.<br />

Due to the explosion of time when increasing the problem, the length of the schedule<br />

given to GAMS has been reduced to 4 weeks. <strong>The</strong> GAMS-model included in the GAMS-<br />

report in appendix B.2 includes the night shifts, evening shifts and wishes in appendix<br />

B.1. <strong>The</strong> subproblem modelled in GAMS is relaxed due to the fact that the RDO<br />

constraint is not included for these four weeks. Should time have allowed, GAMS testing<br />

of several datasets including more and less constrained problems would have been of<br />

higher priority.<br />

31


Chapter 5. Optimal solution 32<br />

<strong>The</strong> GAMS report, included in appendix B.2, reports that the objective function value<br />

Z(S) = 2 and that the solution is optimal.<br />

Both the greedy algorithm and GRASP are tested with and without the partial enumer-<br />

ation described in section 4.4.2, and RCL equal to 1 (only the best element), 50 (list size<br />

is cut in half) and 100 (list size is unchanged). Three tests are done and the results are<br />

shown in figure 5.1 on the following page, where Z(S) and V (S) indicate the objective<br />

function value and the number of hard constraints that are violated, respectively.<br />

<strong>The</strong> results indicate that the enumeration makes a difference and that the solutions found<br />

are near-optimal, when using the enumeration. Specifically we can see that the greedy<br />

construction (with enumeration and RCL = 1 finds optimal solution, figure 5.1(a) on<br />

the next page) are superior to grasp (both with and without enumeration, for RCL = 1).<br />

This indicates that the construction heuristic is the dominant factor of performance for<br />

GRASP. Further investigation of this is found in chapter 7. Over all instances and RCL-<br />

parameters, GRASP (w. enumeration) is superior, as it, at worst, finds solution with<br />

V (S) = 1 (see figure 5.1(a) on the following page).<br />

<strong>The</strong> assigning of a day results in near-optimal to optimal objective function values. As<br />

such, it is a valuable observation that, for this test-instance, further enumeration, such<br />

as assigning a whole week of shifts at the same time, is not needed. In this conclusion,<br />

I recognise the importance of testing GAMS with other instances of the problem. It is<br />

unfortunate that there was not time to do so.<br />

<strong>The</strong> best greedy solution and the best GRASP solution respectively, can be seen in<br />

appendix B.3 together with the solution found by GAMS. <strong>The</strong>re are, as suspected,<br />

similarities amongst the solutions. This indicates that the solution space is locked to a<br />

certain degree.


Chapter 5. Optimal solution 33<br />

Amount<br />

Amount<br />

Amount<br />

1<br />

0<br />

1<br />

0<br />

1<br />

0<br />

Results<br />

7,1,20 8,50,13 6,50,2 6,100,8 2,1,0 1,100,4 3,1,7 7,50,2 14,1,0 31,50,0 50,100,2 52,100,1<br />

Z(S), RCL (%), V(S)<br />

Greedy-Shift Greedy-Day GRASP-Shift GRASP-Day<br />

(a) Test 1<br />

Results<br />

6,1,19 5,50,16 2,50,1 8,1,0 10,100,10 1,100,4 5,1,2 6,50,5 11,1,0 33,50,0 44,100,1 56,100,0<br />

Z(S), RCL (%), V(S)<br />

Greedy-Shift Greedy-Day GRASP-Shift GRASP-Day<br />

(b) Test 2<br />

Results<br />

6,1,23 10,50,18 9,50,3 6,100,11 3,100,4 4,1,0 4,1,6 2,50,3 13,1,0 19,50,0 47,100,3 62,100,0<br />

Z(S), RCL (%), V(S)<br />

Greedy-Shift Greedy-Day GRASP-Shift GRASP-Day<br />

(c) Test 3<br />

Figure 5.1: Comparison of heuristic performances for the GAMS problem


Chapter 6<br />

<strong>The</strong> DRP Program<br />

Through this chapter, the reader is presented with the implementation of a graphical<br />

user interface, provided to the medical practice. <strong>The</strong> various features are described as to<br />

the allow reader to gain an insight into how the user interface connects with the concepts<br />

described in chapters 3 and 4 respectively.<br />

It should be noted that the implementation is a prototype of a software product and will<br />

most likely contain use cases that will cause the program to stop responding, fail or even<br />

crash. This is a direct consequence of the time horizon on this project. <strong>The</strong> program<br />

does enable the user to create usable schedules within minutes or even seconds. At the<br />

end of this chapter, I briefly review what program features are missing or lacking, for<br />

the program to be commercialised.<br />

<strong>The</strong> software can be found on the enclosed dvd 1 .<br />

6.1 <strong>The</strong> user<br />

When developing an application, it is important to keep in mind who will be using the<br />

application. I recognise that the end user of the DRP program is not necessarily, on any<br />

level, good with computers or IT in general. It was a goal of this implementation to allow<br />

both experienced IT users to quickly grasp the features of the program, utilising all of<br />

the features and novice IT users to simply make use of the basic features. <strong>The</strong>re is a fine<br />

line between adding features that enhance the capabilities of the software product and<br />

making it too complex for anyone outside the project to understand. This is also in line<br />

with the conclusion by Burke et al. [5], who recognise the importance of parameterless<br />

implementations.<br />

1 Run the .jar-file, in the ”DRP/dist” folder<br />

34


Chapter 6. <strong>The</strong> DRP Program 35<br />

Due to the small size of the medical practice in this project, existing commercial so-<br />

lutions, such as PLANE (Burke et al. [3]) or ANSOS (Warner et al. [24]), are simply<br />

too advanced. <strong>The</strong>y would probably work fine after configuration had been done, but<br />

using these systems in a small medical practice would be overkill. This supports the<br />

development of a DRP program, targeted only at small sized medical practices.<br />

6.2 <strong>The</strong> Graphical User Interface<br />

Several libraries was used in the development of the application, the main being JCal-<br />

endar (Toedter [23]), which is for graphically picking a date.<br />

<strong>The</strong> Graphical User Interface (GUI) is designed to be accessible, providing an overview<br />

of the problem, allowing for easy changes to the problem and the solution, while main-<br />

taining a simple, non-obtrusive layout. <strong>The</strong> GUI is designed with the end user in mind,<br />

however, there has been little communication with the end user regarding the design.<br />

Figure 6.1 shows the main application window that appears when starting the program.<br />

Figure 6.1: <strong>The</strong> main window<br />

One of the first areas of the GUI the user will notice is the calendar. This is the view of<br />

the schedule and the shifts on each day. No information will appear until a schedule is<br />

generated or a set of shifts and wishes have been imported. <strong>The</strong> menu bar contains two<br />

menus, file and settings. Through the file menu (figure 6.2 on the next page), the user<br />

can save and load the schedule in various forms.


Chapter 6. <strong>The</strong> DRP Program 36<br />

Figure 6.2: <strong>The</strong> file menu<br />

<strong>The</strong> top save and load menu items are linked to serialisations of the schedule. A se-<br />

rialisation is a way to store objects in Java. <strong>The</strong> bottom save and load are linked to<br />

Microsoft Excel workbooks, allowing the user to inspect the information of the saved<br />

schedule. Finally, an option to save the schedule in a form of overview is available (this<br />

option should be chosen for printing the schedule).<br />

Importing nights and evening shifts is done through means of a Microsoft Excel-workbook<br />

(through load (xls-file)). Each sheet in the workbook represents a doctors night and<br />

evening shifts, which, for convenience can be copy-pasted directly from Laegevagt.net,<br />

where these are delegated. Figure 6.3 shows an example of a sheet ready for import.<br />

For each sheet in the workbook, a doctor is created and imported to the application.<br />

Figure 6.3: Microsoft Excel workbook containing the night and evening shifts<br />

Figure 6.4 shows the application window, after the user has imported a set of shifts.


Chapter 6. <strong>The</strong> DRP Program 37<br />

Figure 6.4: <strong>The</strong> main window w. imported shifts<br />

If the user is not importing any shifts, the option of adding doctors manually is also<br />

available. A set of doctors is needed to generate a schedule, so one of these options must<br />

be chosen.<br />

Once a set of doctors has been added the buttons Generate (SLOW) and Generate<br />

(FAST) will be enabled to the user. <strong>The</strong>y represent a single run of the greedy con-<br />

struction heuristic (see section 4.3.1) and the grasp metaheuristic (see section 4.3.3)<br />

respectively.<br />

Before starting the generation of a schedule, several features are available in the Settings-<br />

menu, shown in figure 6.5, that will allow modification of the end-result:<br />

Figure 6.5: <strong>The</strong> settings menu<br />

Rule weights allows for modification of the weights of the soft constraints. This en-<br />

ables the priority of certain rules over others. Contrary to Nonobe and Ibaraki<br />

[18], where an automated weight control mechanism is implemented, the weights


Chapter 6. <strong>The</strong> DRP Program 38<br />

of the constraints in this project are ultimately left to the end user to decide. <strong>The</strong><br />

weight-window is shown in figure 6.6.<br />

Figure 6.6: <strong>The</strong> weights window<br />

View codes shows the various shift-abbreviations, their meaning, where the shift takes<br />

place and what shifts it covers (night, noon, afternoon or evening, or a combination<br />

of either). <strong>The</strong> user can add or delete definitions here. <strong>The</strong> codes are used when<br />

importing shifts.<br />

Set code file is for loading another code definition list than the one already loaded.<br />

<strong>The</strong> format used for the codes file is .xls (Microsoft Excel).<br />

Rolling Day Off enables the user to select whether the RDO-mechanism should be<br />

enabled and for which weeks the RDO should include. Figure 6.8 shows the RDO<br />

window. As of now, the mechanism works with six doctors as is the goal. Though a<br />

more dynamic algorithm is preferable, time was of the essence when implementing<br />

the algorithm.<br />

Day starts at 8am specifies whether a day in the sense of shifts starts at 08.00 am or<br />

at 00.00 am. Tradition sometimes dictates that the night shift of the 20 th physically<br />

lies on the 21 st . <strong>The</strong> underlying function is to move imported night shifts from<br />

day x to day x + 1, and when showing the schedule in the calendar-view, moving<br />

them back.<br />

Pressing either Generate-button, will result in a generated schedule, showing progress in<br />

the status-bar and when the generation of the schedule is done, the value and violations<br />

of the schedule. Figure 6.9 on page 40 shows the application window after a schedule<br />

has been generated.


Chapter 6. <strong>The</strong> DRP Program 39<br />

Figure 6.7: <strong>The</strong> codes window<br />

(a) RDO enabled (b) RDO partially enabled (c) RDO disabled<br />

Figure 6.8: RDO enabled and disabled<br />

<strong>The</strong> final option available to the user is optimising a schedule. When a schedule has been<br />

generated, the optimise button is enabled and the user can now optimise the schedule<br />

shown in the schedule-view. This button initiates the Simulated Annealing algorithm<br />

described in section 4.3.4, on the current schedule.


Chapter 6. <strong>The</strong> DRP Program 40<br />

Figure 6.9: <strong>The</strong> main window w. generated schedule<br />

6.2.1 Measuring the quality of the solution<br />

<strong>The</strong> status bar in the bottom of the application window shows various solution mea-<br />

surements:<br />

Z(S) the heuristic value of the solution.<br />

V(S) the number of hard constraint violations.<br />

Cons is a measurement of how constrained the problem is. If the problem is 100%<br />

constrained, no doctors can be assigned to any shifts without breaking a hard<br />

constraint. It is an average of how many doctors violate one or more rules when<br />

assigned to a shift, over all shifts. Importing shifts and adding RDO to the schedule<br />

are factors that raises this measurement.<br />

6.3 End user feedback<br />

Much like Dias et al. [7], who also develops a user interface, the end user of the software<br />

program described in this chapter, gains the most in time spent creating the schedule.<br />

<strong>The</strong> gathering of information from the workforce is still a tedious process, though much<br />

improved through the import-function, and the schedule is still inspected manually after<br />

it has been created by the software. It is estimated that the total time required to<br />

produce a schedule, going from 5-10 hours, will be around 0.5 hours. Should previous


Chapter 6. <strong>The</strong> DRP Program 41<br />

schedules be taken into account in future versions of the program, the total time required<br />

to produce schedules would drop even more.<br />

Not unlike this program, PLANE (Burke et al. [3]) seeks to please the nurses on a per-<br />

sonal level and treats all nurses equally. PLANE is commended by the users for having<br />

high personal preference satisfaction and a low degree of constraint violation.<br />

6.4 From prototype to release candidate<br />

For this product to be commercialised, several things are needed:<br />

Past schedules should be considere. <strong>The</strong> assignment of unpopular shifts, such as on<br />

new years eve, new years day, christmas day etc., should be divided equally over<br />

several schedules.<br />

<strong>The</strong> data structure needs to be optimised for faster computations. <strong>The</strong> implementa-<br />

tion as it is now, does not fully exploit the object reference advantages.<br />

More dynamic coding is needed. <strong>The</strong> constraints need to be implemented into some<br />

easily editable form. <strong>The</strong> doctor-objects could also be coded in a more dynamic<br />

sense, letting the user specify fields for the doctors, and afterwards filling them in.<br />

But for the product to be sold, the buyer must be gaining a savings, i.e. if the doctor<br />

planning the roster is paid to do so, then it could save the medical practice money. If,<br />

on the other hand, the doctor is planning the roster for free, then no savings come from<br />

buying the DRP Program.


Chapter 7<br />

Metaheuristic tests<br />

This chapter will show the performance of the metaheuristics, described in chapter 4, on<br />

a set of problems including one real world problem. Two libraries used during testing<br />

(to output diagrams of the heuristic performances and .xls-files containing the primitive<br />

test data) was the JFreeChart 1 and the Apache POI 2 respectively.<br />

I will begin by explaining the setup of the test, wherein the various key parameters<br />

in the test shall be introduced. After the setup has been explained, the effect of the<br />

test instance variations and the effect of varying configurations of metaheuristics will<br />

be covered respectively. I end this chapter by discussing the pros and cons of GRASP<br />

and SA for the DRP, making a few conclusions based on the observations done in this<br />

chapter.<br />

Appendix C on page 87 contains all summarised test results. All primitive data is<br />

included on the enclosed dvd 3 .<br />

7.1 Test setup<br />

<strong>The</strong> purpose of the tests is to document the performance of GRASP and Simulated<br />

Annealing on real world test instances, and if possible to support the decision of values<br />

for the parameters. It was only possible to procure one real world problem, so other<br />

instances had to be constructed. All constructed test instances have been constructed<br />

to measure the effect of varying problem parameters on the solution.<br />

<strong>The</strong> test instances can be found in appendix C.<br />

1 http://www.jfree.org/jfreechart/<br />

2 http://poi.apache.org/<br />

3 In the ”DRP/diagrams/Test” folder<br />

42


Chapter 7. Tests, results and discussion 43<br />

Table 7.1 displays the test instances and the problem factors that can affect the solution.<br />

For every instance, Cons notes how constrained the problem is. I expect that adding<br />

more night shifts, evening shifts and wishes (raising the Cons) also make the problem<br />

harder to solve and likewise when decreasing the number of doctors.<br />

Table 7.1: Test instances<br />

Test Length (months) Cons (%) <strong>Doctor</strong>s<br />

0 4 13 6<br />

1 4 17 6<br />

2 4 12 7<br />

3 4 13 5<br />

4 8 13 6<br />

5 4 18 6<br />

6 2 17 7<br />

7 6 13 8<br />

8 4 5 6<br />

9 4 0 6<br />

<strong>The</strong> test instances can then be partitioned into the groups shown in table 7.2. This<br />

shows the test instances that have equal values in what categories and will be used for<br />

comparing results across groups in the next section.<br />

Table 7.2: Test instance groups<br />

Length Constrained <strong>Doctor</strong>s<br />

{0,1,2,3,5,8,9},<br />

{4}, {6}, {7}<br />

{0,3,4,7}, {1,6},<br />

{2}, {5}, {8}, {9}<br />

{0,1,4,5,8,9},<br />

{2,6}, {3}, {7}<br />

<strong>The</strong> problem factors will be the starting point for evaluating test results. From there, I<br />

move on to discuss effects of the metaheuristic factors, such as the RCL parameter, the<br />

enumeration and the weight of the constraints. <strong>The</strong> test instances have all been tested<br />

with the following parameters:<br />

RCL parameter {1 (Leaving only the best element in the list), 50 (cutting the list in<br />

half), 100 (leave the list as it is)}<br />

Enumeration Day, Shift<br />

Constraint weights δi = 1, δi = 2<br />

In the following, I denote the value of the objective function value Z(S) and the num-<br />

ber of invalid hard constraints by V (S). Together they will be noted in the form of<br />

(Z(S), V (S)).


Chapter 7. Tests, results and discussion 44<br />

7.2 Results and discussion<br />

<strong>The</strong>re are two types of test results documented by the tests. <strong>The</strong> first documents, by<br />

a graph, the performance of the metaheuristic on a given test instance, with given pa-<br />

rameters, which I leave for the last part of this chapter. <strong>The</strong> second is the metaheuristic<br />

results, given all combinations of the above parameters, on a given instance. I will then,<br />

in the next section, try to perform a well founded instance and parameter evaluation by<br />

comparing each test instance and metaheuristic result to these derived values. I will not<br />

cross-compare every parameter result, as the number of comparisons, given the param-<br />

eters of these tests, are simply too many to be covered in this project. I shall, though,<br />

highlight the cases where a clear observation can be made even if the results are across<br />

parameters.<br />

7.2.1 Instance parameter effects<br />

In this section I will highlight the effects of the problem parameters and on that basis<br />

conclude, if possible, which parameters have what effects.<br />

Table 7.3: Test instance results<br />

Test Cons (%) Z(S) V(S) <strong>Doctor</strong>s<br />

Test 0 13 196,099 14,38281 6<br />

Test 1 17 222,9297 19,58594 6<br />

Test 2 12 164,1276 12,68229 7<br />

Test 3 13 258,3281 18,03646 5<br />

Test 4 13 349,0755 32,41927 6<br />

Test 5 18 251,0703 20,03125 6<br />

Test 6 17 109,6927 6,403646 7<br />

Test 7 13 246,9219 22,96354 8<br />

Test 8 7 127,4193 9,070313 6<br />

Test 9 0 4,364583 2,289063 6<br />

<strong>The</strong> data in table 7.3 summarises the test results and are averages over all parameters. It<br />

is brought to the readers attention, to underline the effects of varying these parameters,<br />

which will be described in the next sections. Note that the average value of the solutions<br />

generated is not representative of average values of searches for optimal values. <strong>The</strong>y<br />

are averages over all results, including the test runs where weights of the constraints<br />

has been set to 1 and those for which it was set to 2. <strong>The</strong> comparisons are meant to<br />

highlight numbers relative to each other, not their absolute value.


Chapter 7. Tests, results and discussion 45<br />

Imported shifts<br />

From table 7.3 on the previous page, we can see that test instance 5 with Cons = 18 has<br />

an average metaheuristic output of (251,20), which then decreases, over the results of<br />

e.g. test instance 2 with (164,12), to test instance 9 with (4,2). It clearly does make the<br />

problem harder when we add night shifts, evening shifts and wishes. It would have been<br />

interesting to investigate what amount of these shifts, for each doctor, that is needed,<br />

before feasibility cannot be guaranteed. Unfortunately, there was not time to do so.<br />

Amount of doctors<br />

When comparing test 0 (196,14), 2 (164,12), 3 (258,18) and 6 (109,6), we see the same<br />

results as we did for the effect of varying amounts of imported shifts. <strong>The</strong>re is then the<br />

problematic result of test 7, which actually comes out with the highest average V(S) out<br />

of the four (246,22). This could be due to the instance containing some periods of time<br />

that are over constrained, such that no amount of optimisation could solve that period<br />

to feasibility.<br />

It is peculiar that test 2 and 6 produces the results that they do considering that the<br />

cons of test 6 is higher than that of test 2. I propose that the length of the schedule is<br />

also a factor in how hard the problem is to solve.<br />

Schedule length<br />

When the length of the schedule varies, we see an immediate effect on the numbers in<br />

table 7.3 on the preceding page. Test 4 (349,32) , 6 (109,6) and 7 (246,22) varies the most<br />

in length and also varies greatly in average values. With test instance 4 being the longest,<br />

the test also produces the worst results, contrary to test 6 that actually has a higher Cons<br />

but produces far better results. I conclude that the length of the schedule has great effect<br />

on the average results of tests. This is actually not unexpected, as the implementation<br />

of the neighborhoods is such, that the transformation is done on a random set of shifts.<br />

When the length of the schedule increases, the ”length” between the shifts that are<br />

invalidating constraints also increase. Had there been implemented a form of guiding<br />

mechanism for the neighborhood transformation, targeting the transformations at shifts<br />

that are invalidating one or more constraints, I suspect the results would have been<br />

different from what we see here.


Chapter 7. Tests, results and discussion 46<br />

7.2.2 Metaheuristic parameter effects<br />

In this section I will discuss the effects of changing the metaheuristic parameters. In the<br />

tables presented in this section, the average results of SA is the results of giving SA the<br />

output from GRASP. As such, there are a much higher number of SA runs than there<br />

is GRASP.<br />

<strong>The</strong> RCL parameter<br />

<strong>The</strong> RCL parameter is fundamental to GRASP and allows the metaheuristic to ran-<br />

domise the construction of the initial solution in each iteration.<br />

Imps Z(S) V(S)<br />

GRASP 1 17,1875 3,5625 25,9375<br />

GRASP 100 14,625 392,75 19,3125<br />

GRASP 50 13,5 5,625 21,125<br />

Table 7.4: RCL effect: Test 0<br />

Imps Z(S) V(S)<br />

GRASP 1 19,625 5 32<br />

GRASP 100 15,3125 363,6875 27,875<br />

GRASP 50 13,625 6,125 27,5<br />

Table 7.5: RCL effect: Test 1<br />

Table 7.4 shows how, against suspecion, a more random RCL parameter, GRASP 100<br />

(393,19) actually results in a lower V(S). It does come with a cost, namely the high<br />

Z(S). In this case, I suspect that a more balanced result, such as for the GRASP 50<br />

(6,21), would be more preferable to the medical practice. <strong>The</strong> same goes for test 1,<br />

where GRASP 100 (364,28) produces a lower V(S) than GRASP 1 (5,32). This is, also<br />

described earlier, a key observation, which is not that far from what Resende and Feo<br />

[19] says. A fully greedy RCL may produce good mean values, but when we increase<br />

the randomisation, we may produce better results.<br />

<strong>The</strong> conclusion that a fully greedy RCL parameter is not optimal is supported by test<br />

8 and 9, shown in table 7.7 and 7.6 respectively. In these tables we see an obvious<br />

reduction in V(S) when going from fully greedy to fully random RCL parameter, even<br />

on test 9 where there are no night shifts, evening shifts or wishes.<br />

Imps Z(S) V(S)<br />

GRASP 1 7,6875 3,375 8,125<br />

GRASP 100 8,75 7,5 1<br />

GRASP 50 6,0625 2,875 3,375<br />

Table 7.6: RCL effect: Test 9<br />

Imps Z(S) V(S)<br />

GRASP 1 15,5 4,9375 19<br />

GRASP 100 11,0625 185,0625 9,625<br />

GRASP 50 14,625 4,625 14,9375<br />

Table 7.7: RCL effect: Test 8<br />

Over all tests, the average values of the solutions grouped by RCL parameters are shown<br />

in table 7.8 on the following page. In this table we can see that the average value of<br />

Z(S) increases significantly when the metaheuristic manage to decrease V(S).


Chapter 7. Tests, results and discussion 47<br />

<strong>The</strong> enumeration<br />

Table 7.8: RCL Effect: All tests<br />

RCL Z(S) V(S)<br />

GRASP 1 4,125 28,53125<br />

50 5,5 21,98125<br />

100 356,1875 20,34375<br />

<strong>The</strong> enumeration changes the way the construction heuristic builds the initial solution.<br />

Thus, in the following, we shall, as in the previous section, only focus on how GRASP<br />

performs with and without the enumeration mechanism.<br />

Table 7.9: Enumeration effect: All tests<br />

Z(S) V(S)<br />

Test Day Shift Day Shift<br />

0 112,6667 155,2917 5,625 38,625<br />

1 112,625 137,25 9,458333 48,79167<br />

2 73,125 103,3333 7,916667 32,08333<br />

3 131 186,3333 8,291667 44,45833<br />

4 205,375 288,3333 9 82,54167<br />

5 133,2917 188,75 10,75 47,75<br />

6 52,45833 73,91667 3,125 18,25<br />

7 141,2917 204,7917 7,208333 61,125<br />

8 52,66667 77,08333 2,291667 26,75<br />

9 2,416667 6,75 0 8,333333<br />

From table 7.9, I conclude that the enumeration improves the performance of grasp<br />

considerably. For all instances, it is the case that the average solution of GRASP with<br />

enumeration is superior to the average solutions of GRASP without enumeration. To<br />

highlight the effect, see table 7.10 and 7.11 respectively. <strong>The</strong>se two tables, for RCL 1<br />

and RCL 50 respectively, shows the effect of the enumeration to a great extend. Espe-<br />

cially, table 7.11, where 50% randomisation has been implemented in the construction<br />

mechanism, the enumeration still ensures low average values of V(S).<br />

RCL 1<br />

GRASP Z(S) V(S)<br />

Day 3 0,125<br />

Shift 5,75 110<br />

4,375 55,0625<br />

Table 7.10: Enumeration effect:<br />

Test 4, RCL 1<br />

RCL 50<br />

GRASP Z(S) V(S)<br />

Day 7,875 5,375<br />

Shift 5,625 53,375<br />

6,75 29,375<br />

Table 7.11: Enumeration effect:<br />

Test 7, RCL 50


Chapter 7. Tests, results and discussion 48<br />

<strong>The</strong> constraint weights<br />

Table 7.12 shows the overall effect of solving problems with weights δR1 = 1 and δR2 = 2<br />

respectively. <strong>The</strong> V(S), as expected, is not affected by varying weights, but for Z(S) we<br />

see a small increase in objective function value. Note, however, that the Z(S) for R2 is<br />

not double of Z(S) for R1, this means, on average, fewer soft constraints invalidated.<br />

Table 7.12: Weights effect: All tests<br />

Z(S) V(S)<br />

GRASP R1 106,075 23,99167<br />

R2 137,8 23,24583<br />

SA R1 234,8229 8,035417<br />

R2 293,4839 7,877352<br />

Highlighting a few, more in-depth, examples, tables 7.13 and 7.14 shows how Simulated<br />

Annealing ends up with just about equal numbers of soft constraints broken, for both<br />

R1 and R2.<br />

SA Z(S) V(S)<br />

R1 73,875 6,84375<br />

R2 148,5938 7,40625<br />

Ave 111,2344 7,125<br />

Table 7.13: Weights effect: Test<br />

0, RCL 1<br />

<strong>The</strong> number of iterations<br />

SA Z(S) V(S)<br />

R1 85,65625 20,5625<br />

R2 162,875 20,375<br />

Ave 124,2656 20,46875<br />

Table 7.14: Weights effect: Test<br />

4, RCL 1<br />

Not surprisingly, the number of iterations also has great effect on the quality of the<br />

produced solution. Table 7.15 on the following page shows the average solution values<br />

over all tests, grouped by the number of iterations for each of the metaheuristics. As<br />

expected, Z(S) is also higher on average, for lower values of V(S).<br />

7.2.3 Metaheuristic performance<br />

<strong>The</strong> performances of the metaheuristics has so far been investigated in the light of<br />

the parameters that guide them and the problems they solve. How the metaheuristics<br />

converge and how they compare to each other, are some of the aspects that will be<br />

discussed in this section.


Chapter 7. Tests, results and discussion 49<br />

Table 7.15: Iterations effect: All tests<br />

Iterations Z(S) V(S)<br />

GRASP 156 105,1354 27,78333<br />

3276 143,3542 19,64583<br />

SA 500 257,9729 12,31146<br />

2500 270,3089 3,597446<br />

Focusing on the real world problem once again, figures 7.1 and 7.2 on the following<br />

page shows the performance of a GRASP and SA taking over from the GRASP. It is<br />

clear that GRASP with enumeration finds near optimal values (using a higher number<br />

of iterations results in actual optimal solutions, see figure C.1 in appendix C.2.5 on<br />

page 115) and compared to that of GRASP without enumeration is greatly superior.<br />

Figure 7.2(b) on the following page shows how SA is able to optimize the output from<br />

GRASP without enumeration, but in minimising V(S), it also increases Z(S). <strong>The</strong> same<br />

observation applies to figure 7.2(a) on the next page.<br />

20<br />

15<br />

10<br />

5<br />

0<br />

GRASP-Day-1-10-R2-13%<br />

0 25 50 75 100 125 150<br />

Iterations<br />

GRASP-Day-1-10-R2-13%-vio GRASP-Day-1-10-R2-13%-value<br />

Working vio Working score<br />

(a) GRASP, enumeration, R2, RCL 1<br />

100<br />

80<br />

60<br />

40<br />

20<br />

0<br />

GRASP-Shift-1-2-R2-13%<br />

0 25 50 75 100 125 150<br />

Iterations<br />

GRASP-Shift-1-2-R2-13%-vio GRASP-Shift-1-2-R2-13%-value<br />

Working vio Working score<br />

Figure 7.1: GRASP performance: Test 0<br />

(b) GRASP, no enumeration, R2, RCL 1<br />

One observation to be made from figure 7.1(b), is that GRASP without enumeration<br />

restarts too soon. It restarts while it is still able to find improving neighborhoods in LS,<br />

and ends up not being able to improve the incumbent solution again.<br />

Emphasising the effect of the enumeration I refer to figures 7.3 on the next page and 7.4<br />

on page 51.<br />

<strong>The</strong> effect of the enumeration is so strong, that in most cases, there isn’t anything for SA<br />

to optimise. <strong>The</strong> following will show that SA is in fact able to optimise poor solutions<br />

produced by GRASP.


Chapter 7. Tests, results and discussion 50<br />

100<br />

80<br />

60<br />

40<br />

20<br />

12<br />

10<br />

8<br />

6<br />

4<br />

2<br />

0<br />

0<br />

SA-Day-1-2-R2-13%<br />

0 500 1.000 1.500 2.000 2.500<br />

Iterations<br />

SA-Day-1-2-R2-13%-vio SA-Day-1-2-R2-13%-value<br />

Working vio Working score Temperature<br />

(a) SA, on the output from figure 7.1(a)<br />

GRASP-Day-1-2-R2-18%<br />

0 500 1.000 1.500 2.000 2.500 3.000<br />

Iterations<br />

GRASP-Day-1-2-R2-18%-vio GRASP-Day-1-2-R2-18%-value<br />

Working vio Working score<br />

1.000<br />

(a) Test 5: GRASP, enumeration, R2, RCL 1<br />

900<br />

800<br />

700<br />

600<br />

500<br />

400<br />

300<br />

200<br />

100<br />

Temperature<br />

160<br />

140<br />

120<br />

100<br />

Figure 7.2: SA performance: Test 0<br />

80<br />

60<br />

40<br />

20<br />

0<br />

SA-Shift-1-2-R2-13%<br />

0 500 1.000 1.500 2.000 2.500<br />

Iterations<br />

SA-Shift-1-2-R2-13%-vio SA-Shift-1-2-R2-13%-value<br />

Working vio Working score Temperature<br />

(b) SA, on the output from figure 7.1(b)<br />

GRASP-Shift-1-2-R2-18%<br />

1.000<br />

GRASP-Shift-1-2-R2-18%-vio GRASP-Shift-1-2-R2-18%-value<br />

Working vio Working score<br />

Figure 7.3: GRASP performance: Test 5<br />

100<br />

80<br />

60<br />

40<br />

20<br />

0<br />

0 500 1.000 1.500 2.000 2.500 3.000<br />

Iterations<br />

(b) Test 5: GRASP, no enumeration, R2, RCL<br />

1<br />

To comment on the performance of SA, I shall be highlighting test 9 (the empty sched-<br />

ule). In figure 7.5 on the next page it is seen that SA is able to optimise both solutions<br />

to a degree where V(S) = 0.<br />

Observing the performance of SA on more constrained problems, such as test 2 and<br />

test 5, figure 7.5 on the following page also shows how constrained problems makes SA<br />

increase Z(S) as V(S) decreases.<br />

900<br />

800<br />

700<br />

600<br />

500<br />

400<br />

300<br />

200<br />

100<br />

Temperature


Chapter 7. Tests, results and discussion 51<br />

25<br />

20<br />

15<br />

10<br />

5<br />

0<br />

GRASP-Day-Fifty-2-R1-17%<br />

0 500 1.000 1.500 2.000 2.500 3.000<br />

Iterations<br />

GRASP-Day-Fifty-2-R1-17%-vio GRASP-Day-Fifty-2-R1-17%-value<br />

Working vio Working score<br />

(a) Test 6: GRASP, enumeration, R2, RCL 50%<br />

30<br />

25<br />

20<br />

15<br />

10<br />

5<br />

0<br />

SA-Shift-Best-2-R1-0%<br />

0 500 1.000 1.500 2.000 2.500<br />

Iterations<br />

SA-Shift-Best-2-R1-0%-vio SA-Shift-Best-2-R1-0%-value<br />

Working vio Working score Temperature<br />

(a) Test 9: SA, R2, RCL 1%<br />

7.3 Test conclusions<br />

35<br />

30<br />

25<br />

20<br />

15<br />

10<br />

5<br />

0<br />

GRASP-Shift-Fifty-2-R1-17%<br />

0 25 50 75 100 125 150<br />

Iterations<br />

GRASP-Shift-Fifty-2-R1-17%-vio<br />

Figure 7.4: GRASP performance: Test 6<br />

1.000<br />

900<br />

800<br />

700<br />

600<br />

500<br />

400<br />

300<br />

200<br />

100<br />

Temperature<br />

Figure 7.5: SA performance: Test 9<br />

GRASP-Shift-Fifty-2-R1-17%-value Working vio Working score<br />

(b) Test 6: GRASP, no enumeration, R2, RCL<br />

50%<br />

35<br />

30<br />

25<br />

20<br />

15<br />

10<br />

5<br />

0<br />

SA-Shift-Best-2-R2-0%<br />

0 500 1.000 1.500 2.000 2.500<br />

Iterations<br />

SA-Shift-Best-2-R2-0%-vio SA-Shift-Best-2-R2-0%-value<br />

Working vio Working score Temperature<br />

(b) Test 9: SA, R2, RCL 1%<br />

First of all, it is clear that certain DRP’s pose greater problems, in the aspect of solving<br />

them. Longer schedules, fewer doctors and increasing amounts of imported shifts, pro-<br />

duces worse average results. One must be aware, that the problems are still solvable,<br />

even to optimality, if we choose the right approach. That is, if we choose to enumerate<br />

a whole day and if we use GRASP and SA in conjunction with each other. <strong>The</strong> obser-<br />

vations on the performance of GRASP and SA does not make one seem superior to the<br />

other, as both finds a niche to perform well in. GRASP is extremely good at finding<br />

good solutions, if we choose to enumerate, but in some cases, does not find optimal<br />

solutions. Should we choose to use SA on these problems, we must be mindful of the<br />

1.000<br />

900<br />

800<br />

700<br />

600<br />

500<br />

400<br />

300<br />

200<br />

100<br />

Temperature


Chapter 7. Tests, results and discussion 52<br />

250<br />

200<br />

150<br />

100<br />

50<br />

0<br />

SA-Shift-1-10-R2-12%<br />

0 500 1.000 1.500 2.000 2.500<br />

Iterations<br />

SA-Shift-1-10-R2-12%-vio SA-Shift-1-10-R2-12%-value<br />

Working vio Working score Temperature<br />

(a) Test 2: SA, R2, RCL 1%<br />

1.000<br />

900<br />

800<br />

700<br />

600<br />

500<br />

400<br />

300<br />

200<br />

100<br />

Temperature<br />

100<br />

80<br />

60<br />

40<br />

20<br />

0<br />

SA-Day-Fifty-2-R2-18%<br />

0 500 1.000 1.500 2.000 2.500<br />

Iterations<br />

SA-Day-Fifty-2-R2-18%-vio SA-Day-Fifty-2-R2-18%-value<br />

Working vio Working score Temperature<br />

Figure 7.6: SA performance: Test 2 and 5<br />

(b) Test 5: SA, R2, RCL 50%<br />

fact that the Z(S) can increase, sometimes ten-fold, as SA makes V(S) decrease towards<br />

0.<br />

Secondly, an use-case evaluation, given the test results in this chapter, brings me to<br />

the conclusion that GRASP with enumeration, RCL 1-5 % and a number of iterations<br />

between 5000 and 10000, would yield the best results of all possible combinations.<br />

Had there been time to do so, it would have been of great importance to test following:<br />

• Solving test-instances with GAMS, yielding proven bounds and comparing the<br />

heuristic solutions to these bounds.<br />

• How the initial temperature and update of the temperature affects the performance<br />

of SA.<br />

• How a skew distribution of weights would have affected the results of both GRASP<br />

and SA.<br />

1.000<br />

900<br />

800<br />

700<br />

600<br />

500<br />

400<br />

300<br />

200<br />

100<br />

Temperature


Chapter 8<br />

Future considerations<br />

This chapter describes suggested improvements to the implemented methods for solving<br />

the DRP. It is a goal of this chapter that the descriptions are as thorough as possible,<br />

allowing the reader to gain a complete understanding of how it was to be implemented,<br />

should the time horizon on this project have allowed it.<br />

8.1 User-added rules - relation/logic of shifts<br />

As noted earlier, the rules of this project has been hard-coded. This means that no<br />

rules can be added or removed by the end user. For the end the user to be able to<br />

dynamically add rules, a framework is needed, that described how the elements in the<br />

rule are structured and what these elements can consist of. In the following, I describe<br />

the type of some of the rules that chapter 3 covers, such that the reader may gain an<br />

idea of how this was to be implemented if there had been time to do so (note, other<br />

types of rules could be devised as well):<br />

Type 1 is the basic ’if you have this shift, you can not have that shift’-rule: <strong>The</strong> user<br />

is given a starting point from which to define the rule. To start off, we assume<br />

all doctors to be equal so all rules apply to all doctors and all rules to apply to<br />

all days and shifts. Let us call the starting point of a rule p(i, j), where i defines<br />

the days and j defines the shift on that day. One way to define a user added rule<br />

could be to construct three basic elements in the rule:<br />

1. the starting point: a set P1 of starting points p(i, j)<br />

2. a comparator: =, =, ≤, ≥, < or ><br />

3. the end point: a set P2 of end points<br />

53


Chapter 8. Future considerations 54<br />

Combined, these three elements relate two sets of shifts to each other through a<br />

comparator. <strong>The</strong> end user specifies the end point through r1 and r2, that are the<br />

offset of days and the offset of shifts. I.e. equation H0 would be modelled by the<br />

comparator = and the offset 0 and 1 respectively. As we move on to implement<br />

other rules, a more specific representation of the subset i and j is needed. Several<br />

subset could be premade and ready for the end user to choose from, e.g. holidays,<br />

weekdays, Mondays, . . . Fridays, and likewise for the shifts.<br />

Type 2 describes demands on certain shifts. A default demand could be specified by<br />

the user, such that only shifts that deferred from this default demand would need<br />

to be specified. <strong>The</strong>se would consist of the following elements:<br />

1. the point p(i, j) on which to specify the demand<br />

2. the demand of doctors<br />

Type 3 is for dividing the assignments of shifts equally. This would simply be hard-<br />

coded and be available for the user to enable or disable.<br />

For all types, the user should be able to specify whether the rule is a hard or soft<br />

constraint.<br />

8.2 Neighborhood delta function and feasibility<br />

<strong>The</strong> most time consuming task of the heuristics is the calculation of a new objective func-<br />

tion value when exploring a given neighborhood (and feasibility of said neighborhood).<br />

To reduce the time spent on finding the new objective function value, a delta function<br />

can be implemented, allowing the calculation of only the changes a neighborhood brings,<br />

as opposed to the total objective function value.<br />

We note again, that selection of the shifts for a new neighbor is, as described in section<br />

4.3.2, random. Random selection of shifts to rotate or invert also means infeasible<br />

solutions explored in the Local Search. As mentioned earlier, due to how constrained the<br />

problem is, we allow infeasibility. Hence, the heuristics not only seek global optimum of<br />

solution value, but also minimisation of the number of violated shifts. This means, that<br />

it is not enough to check the objective function value when exploring a neighborhood,<br />

but also check the hard constraints (for feasibility).<br />

A delta function is generally a function calculating the value of a change. This means<br />

that we need the value of the old (shift,doctor)-assignments (of the shifts that are affected<br />

by the neighborhood). To do this, it is required, that for each (shift,doctor)-assignment


Chapter 8. Future considerations 55<br />

in the solution, a value of the contribution to the objective function is stored (both<br />

violations of hard constraints, but also the objective function value contribution).<br />

Algorithm 8.1 outlines a possible implementation of a delta function for equation H0.<br />

Algorithm 8.1 Delta function H0 - require: schedule S<br />

∆H0 = 0<br />

Set ← Select random shifts from S<br />

for all Shifti in Set do<br />

Shift2 ← S.getNextShift(Shifti)<br />

if Shifti.get<strong>Doctor</strong>()= Shift2.get<strong>Doctor</strong>() then<br />

∆H0 = ∆H0 + 1<br />

end if<br />

end for<br />

Return ∆H0<br />

∆H0 is then the amount of shifts in the new neighborhood that are violating constraint<br />

H0. Similar rules could be devised for the rest of the constraints, keeping hard constraints<br />

violations separated from soft constraints objective function value contribution.<br />

<strong>The</strong> total ∆ (over all constraints) could then be compared to that of the contribution<br />

made by the shifts affected by the neighborhood.<br />

8.3 GRASP learning<br />

A simple way to improve the GRASP algorithm used in this project would be to incor-<br />

porate one or more of the learning mechanisms described in section 4.3.3. One way to do<br />

this would be to track the (shift,doctor)-assignment that violates one or more rules and<br />

bias that specific assignment such that GRASP would be more inclined not to perform<br />

the same assignment in the next iteration.<br />

Expanding on this, could be more biasing towards (shift,doctor)-assignments that violate<br />

more or less rules than other (shift,doctor)-assignments. <strong>The</strong> bias-function could then<br />

be introduced through a ranking, where a higher rank means less violations and higher<br />

priority, or a probability distribution, with a probability for each assignment based on<br />

the average number of rules it violated in the previous iterations of GRASP (and perhaps<br />

how many violations it produces in the current).<br />

8.3.1 GRASP stop criterion<br />

An improvement, other than those presented in section 4.3.3, to the GRASP imple-<br />

mentation is that of another stop criterion. As concluded in chapter 7, the GRASP


Chapter 8. Future considerations 56<br />

algorithm may end an iteration even though it has improved the incumbent solution in<br />

the last LS-iteration. As such it could lead to faster convergence if the stop- and restart<br />

criterias was to be changed from time/iterations to ’time/iterations since improvement’.<br />

8.4 SA extensions<br />

<strong>The</strong> core property of Simulated Annealing is the opportunity to escape local optima,<br />

in search for global optima, done through the Metropolis criteria (see the Metropolis<br />

criterion on page 26). <strong>The</strong> current implementation of the Update(T )-function, makes<br />

sure that T converges towards a defined end-temperature, as time progresses. But, as<br />

the main feature of the temperature is to allow escape of local optima, it could make<br />

sense to actually increase the temperature if no improvements to the incumbent had<br />

been found in a certain amount of time. This would allow for much more inferior<br />

solutions to be accepted, if such are needed to escape the local optima, in which SA<br />

finds itself. Following this, an update to the α is also needed, seeing as temperature<br />

must converge towards the end-temperature near the end of Simulated Annealing. As<br />

such, some quick math could be done to decrease α by a certain amount, in order to<br />

ensure this convergence.


Chapter 9<br />

Conclusion<br />

This master thesis presents the reader with a solution to a real world doctor rostering<br />

problem, covering the scheduling of a number of doctors over a period of time with<br />

respect to a range of criteria that ensures satisfied work members.<br />

<strong>The</strong> problem, set down by a roster planning doctor, has been compared to that of<br />

standard nurse scheduling problems and has been found too small, due to problem size,<br />

shift types, and a range of very peculiar constraints, for the solution to be of any real<br />

value in NSP research beyond that of entry level planning. <strong>The</strong> research presented in this<br />

thesis may be of more value in the area of the Gotlieb class-teacher problem research.<br />

A mathematical model of the hard and soft constraints is described and an objective<br />

function describing the value of solutions is presented along with an estimation on the<br />

size of the problem.<br />

<strong>The</strong> problem is proven to be NP-complete and on this basis, solving the problem with<br />

heuristics are chosen over exact methods, which would require exponential time to finish.<br />

For these heuristics, various initial solutions are discussed and a greedy approach is se-<br />

lected. Once a solution generation has been established, two simple neighborhoods, the<br />

rotation and inversion, of the solutions and exploration of these through local search is<br />

described. GRASP, a metaheuristic framework is then discussed along with possible ex-<br />

tensions and the Simulated Annealing algorithm used for optimising already constructed<br />

solutions is presented. After the methods for solving the problem has been described,<br />

the steps taken to implement these methods has been described.<br />

<strong>The</strong> solutions found by the heuristics are then compared to a solution found by an<br />

optimal solver (GAMS). Due to problem size and complexity, only a subproblem of a<br />

given dataset is tested. It is found that GAMS is able to solve the problem to optimality<br />

as is the heuristics.<br />

57


Chapter 9. Conclusion 58<br />

<strong>The</strong> three heuristics are implemented in a program, written in Java and the program<br />

features are presented. <strong>The</strong> program is able to model the problem and all of the con-<br />

straints described by the end user. It consists of an intuitive, non-obtrusive layout with<br />

easy to configure settings, able to present a solution to a schedule of any length, with<br />

any number of doctors. Several measures of the solution value are displayed to the user<br />

to allow for solution evaluation. Due to the time horizon on the project, the program is<br />

not bugfree and several parts are hard coded, but it does deliver as promised.<br />

A more thorough testing of the heuristics indicates that the partial enumeration of<br />

the solution space is able to improve the solutions within an acceptable time frame in<br />

the perspective of time and solution trade-off. Larger enumerations is out of bounds<br />

compared to the limitations set down by the end user and the possible gain compared<br />

to the implemented enumeration is too small.<br />

Finally, the reader is presented with considerations for further implementations and<br />

improvements, that could possibly improve the quality of the solutions found and the<br />

implementation respectively. This includes a delta function allowing for the difference in<br />

objective function value to be calculated instead of the entire objective function value.<br />

<strong>The</strong> DRP has been discussed, analysed, modelled, solved and tested. It is, however,<br />

found that the problem is too specific for the solution to be applied to any other envi-<br />

ronment, such as larger hospitals or other private doctor offices. For this to be the case,<br />

a more dynamic setup of constraints, shifts and the incorporation of qualification levels<br />

is needed.


Appendix A<br />

Implementation<br />

This appendix lists the implementation of key points in the implementation of the heuris-<br />

tics and methods they use.<br />

A.1 Neighborhoods<br />

A.1.1 Inversion neighborhood<br />

1 package changes ;<br />

2<br />

3 import java . util . LinkedHashSet ;<br />

4<br />

5 import ds.Day ;<br />

6 import ds. <strong>Doctor</strong> ;<br />

7 import ds. Schedule ;<br />

8 import ds. Shift ;<br />

9<br />

10 public class N_invertion extends Change {<br />

11<br />

12 private static final long serialVersionUID = -717097533016180053 L;<br />

13<br />

14 public N_invertion ( int maxRotation , RotationInt rotationInt ) {<br />

15 setChangeType ( ChangeType . nRotation );<br />

16 setRotationInt ( rotationInt );<br />

17 setN ( maxRotation );<br />

18 }<br />

19<br />

20 public Change nextChange ( Schedule s) {<br />

21<br />

22 Change c = new Change ();<br />

23<br />

24 LinkedHashSet < Shift > list = new LinkedHashSet < Shift >() ;<br />

25<br />

26 // find shifts to invert<br />

59


Appendix A. Implementation 60<br />

27 // Random up to N and only N - size<br />

28 Day randDay ;<br />

29 Shift randShift ;<br />

30 int randomSize ;<br />

31 if ( getRotationInt (). compareTo ( RotationInt . RandomUpToN ) == 0) {<br />

32 randomSize = ( int ) ( Math . random () * getN ());<br />

33 } else {<br />

34 randomSize = getN ();<br />

35 }<br />

36 while ( list . size () < randomSize ) {<br />

37 randDay = s. get (( int ) Math . floor ( Math . random () * s. size ()));<br />

38 randShift = randDay . getShift (( int ) Math . floor ( Math . random () * randDay<br />

. size ()));<br />

39 if ( randShift . isMiddayShift () && ! randDay . isWeekend () && ! randDay .<br />

isHoliday ()) {<br />

40 list . add ( randShift );<br />

41 }<br />

42 }<br />

43<br />

44 // invert doctors ( meaning , that particular doctor will not have that<br />

45 // shift afterwards )<br />

46 Object [] al = list . toArray ();<br />

47<br />

48 for ( int i = 0; i < al. length ; i ++) {<br />

49 Shift shi = ( Shift ) al[i];<br />

50 // pick any other doctor for the shift :<br />

51 <strong>Doctor</strong> d = s. getRandomDoc ();<br />

52 while (d. equals ( shi . get<strong>Doctor</strong> ())) {<br />

53 d = s. getRandomDoc ();<br />

54 }<br />

55 c. put (shi , d);<br />

56 }<br />

57 return c;<br />

58 }<br />

59 }<br />

A.1.2 Rotation neighborhood<br />

1 package changes ;<br />

2<br />

3 import java . util . LinkedHashSet ;<br />

4<br />

5 import ds.Day ;<br />

6 import ds. <strong>Doctor</strong> ;<br />

7 import ds. Schedule ;<br />

8 import ds. Shift ;<br />

9<br />

10 public class N_rotation extends Change {<br />

11<br />

12 private static final long serialVersionUID = -2600577434569838673 L;<br />

13<br />

14 public N_rotation ( int maxRotation , RotationInt rotationInt ) {<br />

15 setChangeType ( ChangeType . nRotation );


Appendix A. Implementation 61<br />

16 setRotationInt ( rotationInt );<br />

17 setN ( maxRotation );<br />

18 }<br />

19<br />

20 public Change nextChange ( Schedule s) {<br />

21<br />

22 Change c = new Change ();<br />

23<br />

24 LinkedHashSet < Shift > list = new LinkedHashSet < Shift >() ;<br />

25<br />

26 // find shifts to swap around<br />

27 // Random up to N and only N - size<br />

28 Day randDay ;<br />

29 Shift randShift ;<br />

30 int randomSize ;<br />

31 if ( getRotationInt (). compareTo ( RotationInt . RandomUpToN ) == 0) {<br />

32 randomSize = ( int ) ( Math . random () * getN ());<br />

33 } else {<br />

34 randomSize = getN ();<br />

35 }<br />

36 while ( list . size () < randomSize ) {<br />

37 randDay = s. get (( int ) Math . floor ( Math . random () * s. size ()));<br />

38 randShift = randDay . getShift (( int ) Math . floor ( Math . random () * randDay<br />

. size ()));<br />

39 if ( randShift . isMiddayShift () && ! randDay . isWeekend () && randShift .<br />

isSet () && ! randDay . isHoliday ()) {<br />

40 list . add ( randShift );<br />

41 }<br />

42 }<br />

43<br />

44 // rotate doctors<br />

45 Object [] al = list . toArray ();<br />

46<br />

47 for ( int i = 0; i < al. length ; i ++) {<br />

48 Shift shi = ( Shift ) al[i];<br />

49 // Shift is the first element : Doc should be moved to the shift of<br />

50 // the last element<br />

51 if ( shi == al[al. length - 1]) {<br />

52 <strong>Doctor</strong> d = (( Shift ) al [0]) . get<strong>Doctor</strong> ();<br />

53 c. put (shi , d);<br />

54 } else {<br />

55 <strong>Doctor</strong> d = (( Shift ) al[i + 1]) . get<strong>Doctor</strong> ();<br />

56 c. put (shi , d);<br />

57 }<br />

58 }<br />

59 return c;<br />

60 }<br />

61 }<br />

A.2 Construction heuristic<br />

1 package heuristic . construction ;


2<br />

Appendix A. Implementation 62<br />

3 import basic . RCLParameter ;<br />

4 import heuristic . Heuristic ;<br />

5<br />

6 import java . util . Vector ;<br />

7<br />

8 import basic . Rules ;<br />

9 import changes . Change ;<br />

10 import ds.Day ;<br />

11 import ds. <strong>Doctor</strong> ;<br />

12 import ds. Pair ;<br />

13 import ds. Schedule ;<br />

14 import ds. Shift ;<br />

15 import java . util . HashMap ;<br />

16 import java . util . HashSet ;<br />

17<br />

18 /* *<br />

19 * <strong>The</strong> extended version of the greedy approach to assigning the shifts is based<br />

20 * on a relative behaviour . It examines each doctor for each shift and picks the<br />

21 * best doctor . This doctor is based on a score , which again is based on the<br />

22 * rules documented in the report , as well as in Rules <br />

23 *<br />

24 * @author <strong>Asser</strong> <strong>Fahrenholz</strong><br />

25 */<br />

26 public class GreedyExt extends Heuristic {<br />

27<br />

28 public Vector < Shift > unassignedShifts ;<br />

29 private final RCLParameter RCLsize ;<br />

30 private int newScore ;<br />

31 private int oldScore ;<br />

32 private int newVio ;<br />

33 private int newSoftVio ;<br />

34 private boolean minimize ;<br />

35<br />

36 public GreedyExt ( Rules myRules , RCLParameter RCLsize , Schedule s, DayOrShift<br />

dos , boolean minimize ) {<br />

37 super ( myRules , s, RCLsize , dos );<br />

38 this . minimize = minimize ;<br />

39 this . RCLsize = RCLsize ;<br />

40 }<br />

41<br />

42 public RCLParameter getRCL () {<br />

43 return this . RCLsize ;<br />

44 }<br />

45<br />

46 @Override<br />

47 public Void doInBackground () throws Exception {<br />

48 try {<br />

49 Pair < Integer , Pair < HashMap < Shift , HashSet >>,<br />

HashMap < Shift , HashSet >>>> workingSol = working .<br />

getSolutionValue ( false , getRules ());<br />

50 oldScore = 0;<br />

51<br />

52 newScore = workingSol . getE ();<br />

53 newVio = workingSol . getV (). getE (). size ();


Appendix A. Implementation 63<br />

54 {<br />

55 Day day ;<br />

56 Shift s;<br />

57 <strong>Doctor</strong> d;<br />

58 for ( int i = 0; i < working . size (); i ++) {<br />

59<br />

60 setProgress (100 * i / working . size ());<br />

61 oldScore = newScore ;<br />

62 workingSol = working . getSolutionValue ( false , getRules ());<br />

63 newScore = workingSol . getE ();<br />

64 newVio = workingSol . getV (). getE (). size ();<br />

65 newSoftVio = workingSol . getV (). getV (). size ();<br />

66 firePropertyChange (" score ", oldScore , newScore );<br />

67 firePropertyChange (" violations ", null , newVio );<br />

68 firePropertyChange (" violationsSoft ", null , newSoftVio );<br />

69 day = working . getDay (i);<br />

70 if (!( day . isWeekend () || day . isHoliday ())) {<br />

71<br />

72 if ( getDoS (). compareTo ( DayOrShift . Day ) == 0) {<br />

73 Change c = working . getBestChange ( day . getDayID () ,<br />

RCLsize , minimize , getRules ());<br />

74 working . performChange (c, false );<br />

75 continue ;<br />

76 }<br />

77<br />

78 Shift :<br />

79 for ( int j = 0; j < day . size (); j ++) {<br />

80 s = day . getShift (j);<br />

81<br />

82 if (s. isMiddayShift ()) {<br />

83 d = working . getBest<strong>Doctor</strong> (day , s, RCLsize ,<br />

minimize , getRules ());<br />

84 working . assign<strong>Doctor</strong>2Shift (day , d, s. getShiftInt<br />

() , false );<br />

85 }<br />

86 }<br />

87 }<br />

88 }<br />

89 }<br />

90 working . setConstructorID ( this . hashCode ());<br />

91 working . setRCL ( RCLsize );<br />

92 working . setDoS ( dos );<br />

93<br />

94 setBestSchedule ( working );<br />

95<br />

96 } catch ( Exception e) {<br />

97 System . out . println (" Caught e: " + e. getCause ());<br />

98 e. printStackTrace ();<br />

99 }<br />

100 return null ;<br />

101 }<br />

102 }


Appendix A. Implementation 64<br />

A.3 GRASP metaheuristic<br />

1 package heuristic . meta ;<br />

2<br />

3 import basic . RCLParameter ;<br />

4 import basic . Rules ;<br />

5 import changes . Change ;<br />

6 import changes . RotationInt ;<br />

7 import ds.Day ;<br />

8 import ds. <strong>Doctor</strong> ;<br />

9 import ds. Pair ;<br />

10 import ds. Schedule ;<br />

11 import ds. Shift ;<br />

12 import heuristic . Metaheuristic ;<br />

13 import java . util . HashMap ;<br />

14 import java . util . HashSet ;<br />

15 import org . jfree . data .xy. XYDataItem ;<br />

16 import org . jfree . data .xy. XYSeries ;<br />

17 import org . jfree . data .xy. XYSeriesCollection ;<br />

18<br />

19 /* *<br />

20 * A GRASP ( Greedy Randomised Adaptive Search Procedure ) class<br />

21 * @author <strong>Asser</strong> <strong>Fahrenholz</strong><br />

22 *<br />

23 */<br />

24 public class GRASP extends Metaheuristic {<br />

25<br />

26 private final RCLParameter RCLsize ;<br />

27 private int localLoopCounter ;<br />

28 private int counter = 0;<br />

29 private boolean minimize ;<br />

30<br />

31 public GRASP ( double timeToRun , int maxRotation , Rules myRules , RotationInt<br />

rotationInt , RCLParameter RCLsize , Schedule s, Type t, int rounds , boolean<br />

diagram , DayOrShift dos , boolean minimize ) {<br />

32 super ( timeToRun , maxRotation , myRules , rotationInt , s, t, rounds , RCLsize<br />

, dos );<br />

33 this . RCLsize = RCLsize ;<br />

34 this . minimize = minimize ;<br />

35 }<br />

36<br />

37 public RCLParameter getRCL () {<br />

38 return this . RCLsize ;<br />

39 }<br />

40<br />

41 @Override<br />

42 public Void doInBackground () throws Exception {<br />

43 XYDataItem point4 ;<br />

44 XYDataItem point3 ;<br />

45 XYDataItem point ;<br />

46 XYDataItem point2 ;<br />

47 try {<br />

48 seriesCol = new XYSeriesCollection ();<br />

49 series = new XYSeries (" Best vio ");<br />

50 series2 = new XYSeries (" Best score ");


Appendix A. Implementation 65<br />

51 series3 = new XYSeries (" Working vio ");<br />

52 series4 = new XYSeries (" Working score ");<br />

53 seriesCol . addSeries ( series );<br />

54 seriesCol . addSeries ( series2 );<br />

55 seriesCol . addSeries ( series3 );<br />

56 seriesCol . addSeries ( series4 );<br />

57<br />

58<br />

59 startTime = System . currentTimeMillis ();<br />

60 boolean test = ( super . type . compareTo ( Type . Rounds ) == 0) ? (<br />

loopCounter < maxRounds ) : ( System . currentTimeMillis () - startTime ) <<br />

getTimeToRun ();<br />

61 while ( test ) {<br />

62 localLoopCounter = 0;<br />

63 int progress = ( super . type . compareTo ( Type . Rounds ) == 0) ? (100 *<br />

64<br />

loopCounter / maxRounds ) : ( int ) (100 * ( System . currentTimeMillis () -<br />

startTime ) / getTimeToRun ());<br />

65 setProgress ( progress );<br />

66 working = getInitialSchedule ();<br />

67 /* GREEDY */<br />

68 {<br />

69 Day day ;<br />

70 Shift s;<br />

71 <strong>Doctor</strong> d;<br />

72 for ( int i = 0; i < working . size (); i ++) {<br />

73 day = working . getDay (i);<br />

74 if (!( day . isWeekend () || day . isHoliday ())) {<br />

75 if ( getDoS (). compareTo ( DayOrShift . Day ) == 0) {<br />

76 Change change = working . getBestChange ( day .<br />

getDayID () , RCLsize , minimize , getRules ());<br />

77 working . performChange ( change , false );<br />

78 continue ;<br />

79 }<br />

80 for ( int j = 0; j < day . size (); j ++) {<br />

81 s = day . getShift (j);<br />

82 if (s. isMiddayShift ()) {<br />

83 d = working . getBest<strong>Doctor</strong> (day , s, RCLsize ,<br />

minimize , getRules ());<br />

84 working . assign<strong>Doctor</strong>2Shift (day , d, s.<br />

getShiftInt () , false );<br />

85 }<br />

86 }<br />

87 }<br />

88 }<br />

89 }<br />

90<br />

91 /* LOCAL SEARCH : */<br />

92 double timeToRunLocal = getTimeToRun () / 5;<br />

93 int newLocalScore ;<br />

94 {<br />

95 double startTimeLocal = System . currentTimeMillis ();<br />

96 boolean test2 = ( super . type . compareTo ( Type . Rounds ) == 0) ? (<br />

localLoopCounter < maxLocalLoops ) : ( System . currentTimeMillis () -<br />

startTimeLocal ) < timeToRunLocal ;


Appendix A. Implementation 66<br />

97 while ( test2 ) {<br />

98 c = Math . random () * 1 > 0.5 ? n_rot . nextChange ( working ) :<br />

n_inv . nextChange ( working );<br />

99 working . performChange (c, false );<br />

100 Pair < Integer , Pair < HashMap < Shift , HashSet >>, HashMap < Shift , HashSet >>>> sol = working .<br />

getSolutionValue ( false , getRules ());<br />

101 newLocalScore = sol . getE ();<br />

102 newLocalVio = sol . getV (). getE (). size ();<br />

103 if ( newLocalVio < bestVio ) {<br />

104 setBestSchedule ( working );<br />

105 localImprovements ++;<br />

106 acceptedSolutions ++;<br />

107 } else if ( newLocalVio == bestVio ) {<br />

108 if (( newLocalScore > bestScore && ! minimize ) || (<br />

newLocalScore < bestScore && minimize )) {<br />

109 setBestSchedule ( working );<br />

110 localImprovements ++;<br />

111 acceptedSolutions ++;<br />

112 } else {<br />

113 working . performChange (c, true );<br />

114 rejectedSolutions ++;<br />

115 }<br />

116 } else {<br />

117 working . performChange (c, true );<br />

118 rejectedSolutions ++;<br />

119 }<br />

120 test2 = ( super . type . compareTo ( Type . Rounds ) == 0) ? (<br />

localLoopCounter ++ < maxLocalLoops ) : ( System . currentTimeMillis () -<br />

startTimeLocal ) < timeToRunLocal ;<br />

121 point = new XYDataItem ( super . type . compareTo ( Type . Rounds )<br />

== 0 ? counter : ( System . currentTimeMillis () - startTime ), bestVio );<br />

122 point2 = new XYDataItem ( super . type . compareTo ( Type . Rounds )<br />

== 0 ? counter : ( System . currentTimeMillis () - startTime ), bestScore );<br />

123 point3 = new XYDataItem ( super . type . compareTo ( Type . Rounds )<br />

== 0 ? counter : ( System . currentTimeMillis () - startTime ), newLocalVio );<br />

124 point4 = new XYDataItem ( super . type . compareTo ( Type . Rounds )<br />

== 0 ? counter ++ : ( System . currentTimeMillis () - startTime ), newLocalScore );<br />

125 series . add ( point );<br />

126 series2 . add ( point2 );<br />

127 series3 . add ( point3 );<br />

128 series4 . add ( point4 );<br />

129 }<br />

130 }<br />

131<br />

132 test = ( super . type . compareTo ( Type . Rounds ) == 0) ? ( loopCounter ++<br />

< maxRounds ) : (( System . currentTimeMillis () - startTime ) < getTimeToRun ());<br />

133 firePropertyChange (" score ", null , bestScore );<br />

134 firePropertyChange (" violations ", null , bestVio );<br />

135 }<br />

136<br />

137 printGRASPStatsToConsole ();<br />

138 printMetaStatsToConsole ();<br />

139 } catch ( Exception e) {<br />

140 System . out . println (" Caught exception : " + e. getCause ());


Appendix A. Implementation 67<br />

141 e. printStackTrace ();<br />

142 }<br />

143<br />

144 getBestSchedule (). setRCL ( this . RCLsize );<br />

145 getBestSchedule (). setConstructorID ( this . hashCode ());<br />

146 getBestSchedule (). setDoS ( this . dos );<br />

147<br />

148 return null ;<br />

149 }<br />

150<br />

151 public void printGRASPStatsToConsole () {<br />

152 Pair < Integer , Pair < HashMap < Shift , HashSet >>, HashMap<br />

< Shift , HashSet >>>> workingSol = working .<br />

getSolutionValue ( false , null );<br />

153 System . out . println (" -------------- GRASP STATS : --------------");<br />

154 System . out . println (" Working value : " + workingSol . getE () + "||" +<br />

workingSol . getV (). getE (). size ());<br />

155 System . out . println (" -------------- --------------");<br />

156 }<br />

157 }<br />

A.4 Simulated Annealing metaheuristic<br />

1 package heuristic . meta ;<br />

2<br />

3 import basic . Rules ;<br />

4 import changes . RotationInt ;<br />

5 import ds. <strong>Doctor</strong> ;<br />

6 import ds. Pair ;<br />

7 import ds. Schedule ;<br />

8 import ds. Shift ;<br />

9 import heuristic . Metaheuristic ;<br />

10 import java . beans . ExceptionListener ;<br />

11 import java . util . HashMap ;<br />

12 import java . util . HashSet ;<br />

13 import org . jfree . data .xy. XYDataItem ;<br />

14 import org . jfree . data .xy. XYSeries ;<br />

15 import org . jfree . data .xy. XYSeriesCollection ;<br />

16<br />

17 public class Simulated_annealing extends Metaheuristic implements<br />

18<br />

ExceptionListener {<br />

19 private double temp ;<br />

20 private double alpha = 0.999;<br />

21 private double temp_end ;<br />

22 private boolean minimize ;<br />

23 private XYDataItem tempPoint ;<br />

24 private XYSeries tempSeries ;<br />

25<br />

26 public Simulated_annealing ( double timeToRun , int maxRotation , Rules myRules ,<br />

RotationInt rotationInt , Schedule s, Type t, int rounds , boolean diagram ,<br />

boolean minimize ) {


Appendix A. Implementation 68<br />

27 super ( timeToRun , maxRotation , myRules , rotationInt , s, t, rounds );<br />

28 this . minimize = minimize ;<br />

29 this . temp = 1000;<br />

30 this . temp_end = 0.001;<br />

31 }<br />

32<br />

33 @Override<br />

34 public Void doInBackground () {<br />

35 XYDataItem point ;<br />

36 XYDataItem point2 ;<br />

37 XYDataItem point3 ;<br />

38 XYDataItem point4 ;<br />

39 try {<br />

40 seriesCol = new XYSeriesCollection ();<br />

41 series = new XYSeries (" Best vio ");<br />

42 series2 = new XYSeries (" Best score ");<br />

43 series3 = new XYSeries (" Working vio ");<br />

44 series4 = new XYSeries (" Working score ");<br />

45 tempSeries = new XYSeries (" Temperature ");<br />

46 seriesCol . addSeries ( series );<br />

47 seriesCol . addSeries ( series2 );<br />

48 seriesCol . addSeries ( series3 );<br />

49 seriesCol . addSeries ( series4 );<br />

50 startTime = System . currentTimeMillis ();<br />

51 int newLocalScore = 0;<br />

52 int oldScore ;<br />

53 boolean test = ( super . type . compareTo ( Type . Rounds ) == 0) ? (<br />

54<br />

loopCounter < maxRounds ) : ( System . currentTimeMillis () - startTime ) <<br />

getTimeToRun ();<br />

55 int progress = ( super . type . compareTo ( Type . Rounds ) == 0) ? (100 *<br />

loopCounter / maxRounds ) : ( int ) (100 * ( System . currentTimeMillis () -<br />

startTime ) / getTimeToRun ());<br />

56 setProgress ( progress );<br />

57 while ( test && temp > temp_end ) {<br />

58 oldScore = newLocalScore ;<br />

59 c = Math . random () * 1 > 0.5 ? n_rot . nextChange ( working ) : n_inv .<br />

nextChange ( working );<br />

60 working . performChange (c, false );<br />

61 Pair < Integer , Pair < HashMap < Shift , HashSet >>,<br />

HashMap < Shift , HashSet >>>> workingSol = working .<br />

getSolutionValue ( false , getRules ());<br />

62 newLocalScore = workingSol . getE ();<br />

63 newLocalVio = workingSol . getV (). getE (). size ();<br />

64 double solutionValue_increase = newLocalScore - oldScore ;<br />

65 double rand = Math . random ();<br />

66<br />

67 if ( newLocalVio < bestVio ) {<br />

68 setBestSchedule ( working );<br />

69 localImprovements ++;<br />

70 acceptedSolutions ++;<br />

71 } else if ( newLocalVio == bestVio ) {<br />

72 if (( solutionValue_increase > 0 && ! minimize ) || (<br />

solutionValue_increase < 0 && minimize )) {


Appendix A. Implementation 69<br />

73 if (( newLocalScore > bestScore && ! minimize ) || (<br />

newLocalScore < bestScore && minimize )) {<br />

74 setBestSchedule ( working );<br />

75 localImprovements ++;<br />

76 acceptedSolutions ++;<br />

77 }<br />

78 } else {<br />

79 if ( rand < ( Math . exp (( solutionValue_increase ) / temp ))) {<br />

80 acceptedSolutions ++;<br />

81 } else {<br />

82 working . performChange (c, true );<br />

83 rejectedSolutions ++;<br />

84 }<br />

85 }<br />

86 } else {<br />

87 rejectedSolutions ++;<br />

88 working . performChange (c, true );<br />

89 }<br />

90 progress = ( super . type . compareTo ( Type . Rounds ) == 0) ? (100 *<br />

loopCounter / maxRounds ) : ( int ) (100 * ( System . currentTimeMillis () -<br />

startTime ) / getTimeToRun ());<br />

91 setProgress ( progress );<br />

92 firePropertyChange (" score ", null , bestScore );<br />

93 firePropertyChange (" violations ", null , bestVio );<br />

94 test = ( super . type . compareTo ( Type . Rounds ) == 0) ? ( loopCounter <<br />

maxRounds ) : ( System . currentTimeMillis () - startTime ) < getTimeToRun ();<br />

95 temp = alpha * temp ;<br />

96 point = new XYDataItem ( super . type . compareTo ( Type . Rounds ) == 0 ?<br />

loopCounter : ( System . currentTimeMillis () - startTime ), bestVio );<br />

97 point2 = new XYDataItem ( super . type . compareTo ( Type . Rounds ) == 0 ?<br />

loopCounter : ( System . currentTimeMillis () - startTime ), bestScore );<br />

98 point3 = new XYDataItem ( super . type . compareTo ( Type . Rounds ) == 0 ?<br />

loopCounter : ( System . currentTimeMillis () - startTime ), newLocalVio );<br />

99 point4 = new XYDataItem ( super . type . compareTo ( Type . Rounds ) == 0 ?<br />

loopCounter : ( System . currentTimeMillis () - startTime ), newLocalScore );<br />

100 tempPoint = new XYDataItem ( loopCounter ++ , temp );<br />

101 series . add ( point );<br />

102 series2 . add ( point2 );<br />

103 series3 . add ( point3 );<br />

104 series4 . add ( point4 );<br />

105 tempSeries . add ( tempPoint );<br />

106 }<br />

107 printSAStatsToConsole ();<br />

108 printMetaStatsToConsole ();<br />

109 getBestSchedule (). setOptimizer ( this );<br />

110<br />

111 } catch ( Exception e) {<br />

112 System . out . println (" Caught exception : " + e. getCause ());<br />

113 e. printStackTrace ();<br />

114 }<br />

115 return null ;<br />

116 }<br />

117<br />

118 public void printSAStatsToConsole () {


Appendix A. Implementation 70<br />

119 Pair < Integer , Pair < HashMap < Shift , HashSet >>, HashMap<br />

< Shift , HashSet >>>> workingSol = working .<br />

getSolutionValue ( false , null );<br />

120 System . out . println (" -------------- SA STATS : --------------");<br />

121 System . out . println (" Alpha : " + alpha );<br />

122 System . out . println (" Working value : " + workingSol . getE ());<br />

123 System . out . println (" Violations : " + workingSol . getV (). getE (). size ());<br />

124 System . out . println (" Initial value : " + initialScore );<br />

125 System . out . println (" Stopped due to: " + (( System . currentTimeMillis () -<br />

startTime ) > getTimeToRun () ? " Running time "<br />

126 : ( loopCounter > maxRounds ? " Loops " : ( temp < temp_end ? "<br />

Temperature "<br />

127 : " Not running time , temp nor rounds "))));<br />

128 System . out . println (" -------------- --------------");<br />

129 }<br />

130<br />

131 @Override<br />

132 public void exceptionThrown ( Exception e) {<br />

133 System . out . println (" Exception was caught .. I think ... Here it is:" + e.<br />

getCause ());<br />

134 e. printStackTrace ();<br />

135 }<br />

136<br />

137 public XYSeries getTempSeries () {<br />

138 return tempSeries ;<br />

139 }<br />

140 }<br />

A.5 Choosing the assignment<br />

A.5.1 Shift assignments<br />

1 /* *<br />

2 * Returns the best doctor for a given shift on a given day .<br />

3 *<br />

4 * @param day<br />

5 * the day<br />

6 * @param RCLsize<br />

7 * the size of the RCL<br />

8 * @param shift<br />

9 * the shift<br />

10 * @return <strong>The</strong> best doctor for the shift<br />

11 */<br />

12 public <strong>Doctor</strong> getBest<strong>Doctor</strong> (<br />

13 Day day , Shift shift , RCLParameter RCLsize , boolean minimize , Rules<br />

14<br />

rules ) {<br />

15 if ( rules != null ) {<br />

16 this . myRules = rules ;<br />

17 }<br />

18


Appendix A. Implementation 71<br />

19 Vector >> bestDocs = new Vector > >();<br />

20 Pair < Integer , Pair < HashMap < Shift , HashSet >>, HashMap<br />

< Shift , HashSet >>>> sol ;<br />

21 int vio ;<br />

22<br />

23 myFore :<br />

24 for ( <strong>Doctor</strong> d : docs ) {<br />

25<br />

26 int score = 0;<br />

27 if ( this . isThis<strong>Doctor</strong>AroundThisShift (d, shift )) {<br />

28 continue myFore ;<br />

29 }<br />

30 sol = this . getShiftValue (d, day . getDayID () , shift . getShiftInt () ,<br />

false , false , true , true );<br />

31 score = sol . getE ();<br />

32 vio = sol . getV (). getE (). size ();<br />

33<br />

34 if ( bestDocs . size () == 0) {<br />

35 bestDocs . add ( new Pair < <strong>Doctor</strong> , Pair < Integer , Integer > >(d, new Pair<br />

< Integer , Integer >( score , vio )));<br />

36 } else {<br />

37 int size = bestDocs . size ();<br />

38 myFor :<br />

39 for ( int i = 0; i <<br />

40 size ; i ++) {<br />

41 Pair < <strong>Doctor</strong> , Pair < Integer , Integer >> docScore = bestDocs . get (<br />

i);<br />

42 if ( vio < docScore . getV (). getV ()) {<br />

43 bestDocs . add ( bestDocs . indexOf ( docScore ),<br />

44 new Pair < <strong>Doctor</strong> , Pair < Integer , Integer > >(d, new<br />

Pair < Integer , Integer >( score , vio )));<br />

45 break myFor ;<br />

46 } else if ( vio == docScore . getV (). getV () && ( docScore . getV ().<br />

getE () = score && minimize )<br />

)) {<br />

47 bestDocs . add ( bestDocs . indexOf ( docScore ),<br />

48 new Pair < <strong>Doctor</strong> , Pair < Integer , Integer > >(d, new<br />

Pair < Integer , Integer >( score , vio )));<br />

49 break myFor ;<br />

50 } else {<br />

51 bestDocs . add ( new Pair < <strong>Doctor</strong> , Pair < Integer , Integer > >(d,<br />

new Pair < Integer , Integer >( score , vio )));<br />

52 break myFor ;<br />

53 }<br />

54 }<br />

55 }<br />

56 }<br />

57<br />

58 switch ( RCLsize ) {<br />

59 case Best :<br />

60 bestDocs . setSize (1) ;<br />

61 break ;<br />

62 case Fifty :<br />

63 bestDocs . setSize (( int ) ( bestDocs . size () * 0.5) );


Appendix A. Implementation 72<br />

64 break ;<br />

65 case TwentyFive :<br />

66 bestDocs . setSize (( int ) ( bestDocs . size () * 0.25) );<br />

67 break ;<br />

68 case SeventyFive :<br />

69 bestDocs . setSize (( int ) ( bestDocs . size () * 0.75) );<br />

70 break ;<br />

71 default :<br />

72 break ;<br />

73 }<br />

74<br />

75 double randDoc = Math . random () * bestDocs . size ();<br />

76 <strong>Doctor</strong> bestDoc = bestDocs . get (( int ) randDoc ). getE ();<br />

77 return bestDoc ;<br />

78 }<br />

Listing A.1: Shift assignments<br />

A.5.2 Permutations of size k chosen from N elements<br />

1 package basic ;<br />

2<br />

3 import java . util . ArrayList ;<br />

4 import ds. <strong>Doctor</strong> ;<br />

5<br />

6 /* ******************************************************************************<br />

7 * Compilation : javac Perm . java Execution : java Permutations N k<br />

8 *<br />

9 * Enumerates all permutations of size k chosen from N elements . % java<br />

10 * Permutations 4 2 | sort ab ac ad ba bc bd ca cb cd da db dc<br />

11 *<br />

12 * Limitations ----------- * Assumes N > res ;<br />

18<br />

19 private ArrayList < ArrayList < <strong>Doctor</strong> >> enumerate2 ( ArrayList < <strong>Doctor</strong> > b, int n,<br />

20<br />

int r) {<br />

21 if (r == 0) {<br />

22 ArrayList < <strong>Doctor</strong> > subres = new ArrayList < <strong>Doctor</strong> >() ;<br />

23 for ( int i = n; i < b. size (); i ++) {<br />

24 subres . add (b. get (i));<br />

25 }<br />

26 res . add ( subres );<br />

27<br />

28 } else {<br />

29 for ( int i = 0; i < n; i ++) {<br />

30 swap2 (b, i, n - 1);<br />

31 enumerate2 (b, n - 1, r - 1);<br />

32 swap2 (b, i, n - 1);


Appendix A. Implementation 73<br />

33 }<br />

34 return res ;<br />

35 }<br />

36 return null ;<br />

37 }<br />

38<br />

39 public ArrayList < ArrayList < <strong>Doctor</strong> >> choose2 ( ArrayList < <strong>Doctor</strong> > b, int k) {<br />

40 res = new ArrayList < ArrayList < <strong>Doctor</strong> > >();<br />

41<br />

42 return enumerate2 (b, b. size () , k);<br />

43 }<br />

44<br />

45 private void swap2 ( ArrayList < <strong>Doctor</strong> > b, int i, int j) {<br />

46 <strong>Doctor</strong> temp = b. get (i);<br />

47 b. set (i, b. get (j));<br />

48 b. set (j, temp );<br />

49 }<br />

50<br />

51 public ArrayList < ArrayList < <strong>Doctor</strong> >> getRes () {<br />

52 return res ;<br />

53 }<br />

54 }<br />

A.5.3 Day assignments<br />

1 /* *<br />

2 * Returns the best doctor for a given shift on a given day .<br />

3 *<br />

4 * @param dayInt<br />

5 * the day<br />

6 * @param RCLsize<br />

7 * the size the RCL<br />

8 * @param minimizing<br />

9 * @return <strong>The</strong> best doctor for the shift<br />

10 */<br />

11 public Change getBestChange (<br />

12 int dayInt , RCLParameter RCLsize , boolean minimizing , Rules rules ) {<br />

13<br />

14 if ( rules != null ) {<br />

15 this . myRules = rules ;<br />

16 }<br />

17<br />

18 Vector >> bestChange = new Vector > >();<br />

20 Permutation t = new Permutation ();<br />

21<br />

22 ArrayList < <strong>Doctor</strong> > doc = new ArrayList < <strong>Doctor</strong> >() ;<br />

23 doc . addAll ( docs );<br />

24<br />

25 t. choose2 (doc , this . get ( dayInt ). getAllMiddayShifts (). size ());<br />

26<br />

27 ArrayList < ArrayList < <strong>Doctor</strong> >> set = t. getRes ();


Appendix A. Implementation 74<br />

28 Change c;<br />

29 for ( int i = 0; i < set . size (); i ++) {<br />

30 c = new Change ();<br />

31 ArrayList < <strong>Doctor</strong> > subset<strong>Doctor</strong>s = set . get (i);<br />

32 HashSet < Shift > shiftset = this . get ( dayInt ). getAllMiddayShifts ();<br />

33 ArrayList < Shift > sSet = new ArrayList < Shift >() ;<br />

34 sSet . addAll ( shiftset );<br />

35<br />

36 for ( int j = 0; j < shiftset . size (); j ++) {<br />

37 c. put ( sSet . get (j), subset<strong>Doctor</strong>s . get (j));<br />

38 }<br />

39<br />

40 Pair < Integer , Pair < HashMap < Shift , HashSet >>,<br />

HashMap < Shift , HashSet >>>> sol = this . getSolutionValue (<br />

false , null );<br />

41 int oldScore = sol . getE ();<br />

42 int oldVio = sol . getV (). getE (). size ();<br />

43<br />

44 this . performChange (c, false );<br />

45<br />

46 Pair < Integer , Pair < HashMap < Shift , HashSet >>,<br />

HashMap < Shift , HashSet >>>> newSol = this .<br />

getSolutionValue ( false , null );<br />

47 int newScore = newSol . getE ();<br />

48 int newvio = newSol . getV (). getE (). size ();<br />

49<br />

50<br />

51 double scoreInc = newScore - oldScore ;<br />

52 int vioInc = newvio - oldVio ;<br />

53 // Undo the change :<br />

54 this . performChange (c, true );<br />

55 // Sort by best change :<br />

56 if ( bestChange . size () == 0) {<br />

57 bestChange . add ( new Pair < Change , Pair < Double , Integer > >(c, new<br />

Pair < Double , Integer >( scoreInc , vioInc )));<br />

58 } else {<br />

59 myFor :<br />

60 for ( int k = 0; k < bestChange . size (); k ++) {<br />

61 Pair < Change , Pair < Double , Integer >> changeScore = bestChange .<br />

get (k);<br />

62 if ( changeScore . getV (). getV () > vioInc ) {<br />

63 bestChange . add ( bestChange . indexOf ( changeScore ),<br />

64 new Pair < Change , Pair < Double , Integer > >(c, new<br />

Pair < Double , Integer >( scoreInc , vioInc )));<br />

65 break myFor ;<br />

66 }<br />

67 if ( changeScore . getV (). getV () == vioInc ) {<br />

68 if (( changeScore . getV (). getE () < scoreInc && ! minimizing )<br />

|| ( changeScore . getV (). getE () > scoreInc && minimizing )) {<br />

69 bestChange . add ( bestChange . indexOf ( changeScore ),<br />

70 new Pair < Change , Pair < Double , Integer > >(c,<br />

new Pair < Double , Integer >( scoreInc , vioInc )));<br />

71 break myFor ;<br />

72 }<br />

73


Appendix A. Implementation 75<br />

74 if ( bestChange . indexOf ( changeScore ) == bestChange . size ()<br />

- 1) {<br />

75 bestChange . add ( new Pair < Change , Pair < Double , Integer<br />

> >(c, new Pair < Double , Integer >( scoreInc , vioInc )));<br />

76 break myFor ;<br />

77 }<br />

78 }<br />

79 }<br />

80 }<br />

81 }<br />

82<br />

83 switch ( RCLsize ) {<br />

84 case Best :<br />

85 bestChange . setSize (1) ;<br />

86 break ;<br />

87 case Fifty :<br />

88 bestChange . setSize (( int ) ( bestChange . size () * 0.5) );<br />

89 break ;<br />

90 case TwentyFive :<br />

91 bestChange . setSize (( int ) ( bestChange . size () * 0.25) );<br />

92 break ;<br />

93 case SeventyFive :<br />

94 bestChange . setSize (( int ) ( bestChange . size () * 0.75) );<br />

95 break ;<br />

96 default :<br />

97 break ;<br />

98 }<br />

99 double randDoc = Math . random () * bestChange . size ();<br />

100 Change out = bestChange . get (( int ) randDoc ). getE ();<br />

101<br />

102 return out ;<br />

103 }<br />

Listing A.2: Day assignments


Appendix B<br />

GAMS Model<br />

This chapter contains the GAMS model for the DRP subproblem described in chapter<br />

5. <strong>The</strong> model is included in the report that is produced by GAMS. A solution found by<br />

the greedy approach and GRASP is included respectively for comparison.<br />

B.1 <strong>The</strong> night, evening and wishes<br />

JST PZH HP SDA HMM OSJ<br />

08-09-08 FRI2 02-09-08 V15 15-09-08 V12 20-09-08 V7 01-09-08 V11 01-09-08 FERIE<br />

09-09-08 FRI2 08-09-08 Ss 19-09-08 Ss 21-09-08 V15 06-09-08 K15 02-09-08 FERIE<br />

16-09-08 FRI2 09-09-08 FRI2 01-09-08 FRI2 01-09-08 FRI2 07-09-08 V1 03-09-08 FERIE<br />

04-09-08 V14 19-09-08 FRI2 04-09-08 FRI2 09-09-08 FRI2 11-09-08 V12 04-09-08 FERIE<br />

13-09-08 V8 09-09-08 FRI2 12-09-08 FRI2 16-09-08 Ss 05-09-08 FERIE<br />

14-09-08 V2 18-09-08 FRI2 15-09-08 FERIE 20-09-08 K14 06-09-08 FERIE<br />

B.2 <strong>The</strong> GAMS model and report<br />

GAMS Rev 140 Sun Sparc / SOLAR<br />

23-09-08 FRI2 26-09-08 FERIE 21-09-08 V3 07-09-08 FERIE<br />

10/28/08 18:25:02 Page 1<br />

25-09-08 K16<br />

08-09-08 FERIE<br />

09-09-08 FERIE<br />

10-09-08 FERIE<br />

11-09-08 FERIE<br />

12-09-08 FERIE<br />

13-09-08 FERIE<br />

14-09-08 FERIE<br />

G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m<br />

C o m p i l a t i o n<br />

76


Appendix B. GAMS Model 77<br />

2<br />

3 option iterlim =999999999; // avoid limit on iterations<br />

4 option reslim =50000; // timelimit for solver<br />

5 option optcr =0.0; // gap tolerance<br />

6 option solprint = OFF ; // include solution print in . lst file<br />

7 option limrow =0; // limit number of rows in . lst file<br />

8 option limcol =0; // limit number of columns in . lst file<br />

9<br />

//------------------------------------------------------------------------------<br />

10 SETS<br />

11 day days / 1 * 28 /<br />

12 mondays ( day ) mondays / 1, 8,<br />

15 , 22 /<br />

13 fridays ( day ) fridays / 5, 12 ,<br />

19 , 26 /<br />

14 weekend ( day ) weekends / 6, 7,<br />

13 , 14 , 20 , 21 , 27 , 28 /<br />

15 workingdays ( day )<br />

16 shift shifts / 1 * 4 /<br />

17 nightshift ( shift ) night shifts / 1 /<br />

18 noonshift ( shift ) noon shift / 2 /<br />

19 afternoonshift ( shift ) afternoon shift / 3 /<br />

20 eveningshift ( shift ) evening shift / 4 /<br />

21 assignmentshifts ( shift )<br />

22 nonshifts ( shift )<br />

23 doctor doctors / jst , pzh<br />

, hp , sda , hmm , osj /<br />

24 index counting vars for the b-eq ’s / 0 * 7 /<br />

25 index0 ( index ) / 0 /<br />

26 index1 ( index ) / 1 /<br />

27 index2 ( index ) / 2 /<br />

28 index3 ( index ) / 3 /<br />

29 index4 ( index ) / 4 /<br />

30 index6a ( index ) / 6 /<br />

31 index6b ( index ) / 7 /;<br />

32 nonshifts ( shift ) = nightshift ( shift ) + eveningshift<br />

( shift );<br />

33 assignmentshifts ( shift ) = noonshift ( shift ) +<br />

afternoonshift ( shift );<br />

34 workingdays ( day ) = day ( day ) - weekend ( day );<br />

35<br />

36 display workingdays ;<br />

37<br />

38 PARAMETERS<br />

39 b(day , shift , doctor ) define evening and night shifts<br />

40 /(4.4. jst ) 1, (13.2. jst ) 1, (13.3. jst ) 1, (14.2. jst ) 1,<br />

41 (2.4. pzh ) 1, (8.2. pzh ) 1, (8.3. pzh ) 1,<br />

42 (15.4. hp) 1, (19.2. hp) 1, (19.3. hp) 1,<br />

43 (20.2. sda ) 1, (20.3. sda ) 1, (21.4. sda ) 1,<br />

44 (1.4. hmm ) 1, (6.2. hmm ) 1, (6.3. hmm ) 1, (7.2. hmm ) 1, (11.4. hmm ) 1,<br />

(16.2. hmm ) 1, (16.3. hmm ) 1, (20.2. hmm ) 1,<br />

(20.3. hmm ) 1, (21.2. hmm ) 1,<br />

45 (25.4. hmm ) 1/


Appendix B. GAMS Model 78<br />

46 c(day , shift , doctor ) define requests for days off or shifts off<br />

( meaning you can have a shift up to or af<br />

ter a shift off )<br />

47 /(8.3. jst ) 1, (9.3. jst ) 1, (16.3. jst ) 1,<br />

48 (9.3. pzh ) 1, (19.3. pzh ) 1,<br />

49 (1.3. hp) 1, (4.3. hp) 1, (9.3. hp) 1, (18.3. hp) 1, (23.3. hp) 1,<br />

50 (1.3. sda ) 1, (9.3. sda ) 1, (12.3. sda ) 1, (15.2. sda ) 1, (15.3. sda )<br />

1, (26.2. sda ) 1, (26.3. sda ) 1,<br />

51 (8.2. hmm ) 1, (8.3. hmm ) 1, (9.2. hmm ) 1, (9.3. hmm ) 1, (10.2. hmm ) 1,<br />

(10.3. hmm ) 1, (11.2. hmm ) 1, (11.3. hmm ) 1,<br />

(12.2. hmm ) 1, (12.3. hmm ) 1,<br />

GAMS Rev 140 Sun Sparc / SOLAR<br />

10/28/08 18:25:02 Page 2<br />

G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m<br />

C o m p i l a t i o n<br />

52 (13.2. hmm ) 1, (13.3. hmm ) 1, (14.2. hmm ) 1, (14.3. hmm ) 1,<br />

53 (1.2. osj ) 1, (1.3. osj ) 1, (2.2. osj ) 1, (2.3. osj ) 1, (3.2. osj ) 1,<br />

(3.3. osj ) 1, (4.2. osj ) 1, (4.3. osj ) 1, (5.<br />

2. osj ) 1, (5.3. osj ) 1, (6.2. osj ) 1,<br />

54 (6.3. osj ) 1, (7.2. osj ) 1, (7.3. osj ) 1<br />

55 /<br />

56 s(day , shift ) define extra doctor demands<br />

57 /(1.2) 1, (8.2) 1, (15.2) 1, (22.2) 1/<br />

58<br />

59 VARIABLES<br />

60 x(day , shift , doctor ) doctors on shifts<br />

61 y(day , shift , doctor , index ) counting var<br />

62 z solution value<br />

63 k(day , shift , doctor , index ) counter the the y- vars<br />

64 dmax doctor max<br />

65 dmin doctor min ;<br />

66<br />

67<br />

68 BINARY VARIABLE x(day , shift , doctor ), y(day , shift , doctor , index ), k(day , shift<br />

, doctor , index );<br />

69 POSITIVE VARIABLE dmax , dmin ;<br />

70<br />

71 EQUATIONS<br />

72 VALUE define objective function<br />

73<br />

74 H0a no two assignment shifts in a row<br />

75 H0b no eveningshift after an afternoonshift<br />

76 H0c no nightshift before a noonshift<br />

77 H1 doctor cannot have a noon shift after an evening<br />

shift<br />

78 H2 doctor cannot have a noon shift nor an afternoon<br />

shift after a night shift<br />

79 H3a no shifts must be granted that has been blocked<br />

80 H3b no shifts must be granted that has requested off<br />

81 H4 doctor demands<br />

82 H5 no other assignments<br />

83


Appendix B. GAMS Model 79<br />

84 B0 no doctor should have both monday noon shifts and<br />

friday afternoon shifts in the same week<br />

85 B1 no doctor should have both friday afternoon shift<br />

and the following monday noon shift<br />

86 B2a shifts should be divided equally - the max var<br />

87 B2b shifts should be divided equally - the min var<br />

88 B3 no doctor should have a noon nor afternoon shifts<br />

two days in a row<br />

89 B4 no doctor should have the afternoon shift the day<br />

after an evening shift<br />

90 B5 no doctor should have the noon shift the same day<br />

as an evening shift<br />

91 B6a no doctor should have the noon shift the day after<br />

an afternoon shift<br />

92 B6b no doctor should have the afternoon shift the day<br />

93<br />

after a noon shift ;<br />

94 VALUE .. z =e= sum (( workingdays ( day ),assignmentshifts ( shift<br />

95<br />

),doctor , index ),y(day , shift , doctor , index ))<br />

+ dmax - dmin ;<br />

96 H0a (day , shift , doctor ) .. x(day , shift , doctor<br />

) + x(day , shift +1 , doctor ) =l= 1;<br />

97 H0b (day , eveningshift ( shift ),doctor ).. x(day , shift -1 ,<br />

doctor ) + b(day , shift , doctor ) =l= 1;<br />

98 H0c (day , nightshift ( shift ),doctor ).. x(day , shift +1 ,<br />

doctor ) + b(day , shift , doctor ) =l= 1;<br />

99 H1(day , noonshift ( shift ),doctor ) .. b(day , shift +2 ,<br />

doctor ) + x( day +1 , shift , doctor ) =l= 1;<br />

100 H2(day , nightshift ( shift ),doctor ) .. b(day , shift , doctor<br />

) + x(day , shift +1 , doctor ) + x(day , shift +2 ,<br />

doctor ) =l= 1;<br />

101 H3a (day , shift , doctor ) .. x(day , shift , doctor<br />

) + b(day , shift , doctor ) =l= 1;<br />

GAMS Rev 140 Sun Sparc / SOLAR<br />

10/28/08 18:25:02 Page 3<br />

G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m<br />

C o m p i l a t i o n<br />

102 H3b (day , shift , doctor ) .. x(day , shift , doctor<br />

) + c(day , shift , doctor ) =l= 1;<br />

103 H4( workingdays ( day ),assignmentshifts ( shift )) .. sum ( doctor ,x(day ,<br />

shift , doctor )) =e= 1 + s(day , shift );<br />

104 H5(day , nonshifts ( shift ),doctor ) .. x(<br />

105<br />

106<br />

day , shift , doctor ) =e= 0;<br />

107 B0( mondays ( day ),noonshift ( shift ),doctor , index0 ( index )) ..x(day , shift , doctor<br />

) + x( day +4 , shift +1 , doctor ) =e=<br />

108 1 + y(day ,<br />

shift , doctor , index ) - k(day , shift , doctor ,in<br />

dex );


Appendix B. GAMS Model 80<br />

109 B1( fridays ( day ),noonshift ( shift ),doctor , index1 ( index )) ..x( day +3 , shift ,<br />

doctor ) + x(day , shift +1 , doctor ) =e=<br />

110 1 + y(day ,<br />

shift , doctor , index ) - k(day , shift , doctor ,in<br />

dex );<br />

111 B2a ( doctor ).. sum (( workingdays (<br />

day ),assignmentshifts ( shift )),x(day , shift ,d<br />

octor )) =l= dmax ;<br />

112 B2b ( doctor ).. sum (( workingdays (<br />

day ),assignmentshifts ( shift )),x(day , shift ,d<br />

octor )) =g= dmin ;<br />

113 B3( workingdays ( day ),assignmentshifts ( shift ),doctor , index4 ( index )).. x(day<br />

, shift , doctor ) + x( day +1 , shift , doctor ) =e=<br />

114 1 + y(day ,<br />

shift , doctor , index ) - k(day , shift , doctor ,in<br />

dex );<br />

115 B4(day , afternoonshift ( shift ),doctor , index2 ( index )) .. x(day , shift , doctor<br />

) + b(day -1 , shift +1 , doctor ) =e=<br />

116 1 + y(day ,<br />

shift , doctor , index ) - k(day , shift , doctor ,in<br />

dex );<br />

117 B5(day , noonshift ( shift ),doctor , index3 ( index )) .. b(day , shift +2 ,<br />

doctor ) + x(day , shift , doctor ) =e=<br />

118 1 + y(day ,<br />

shift , doctor , index ) - k(day , shift , doctor ,in<br />

dex );<br />

119 B6a (day , noonshift ( shift ),doctor , index6a ( index )) .. x(day , shift +1 ,<br />

doctor ) + x( day +1 , shift , doctor ) =e=<br />

120 1 + y(day ,<br />

shift , doctor , index ) - k(day , shift , doctor ,in<br />

dex );<br />

121 B6b (day , noonshift ( shift ),doctor , index6b ( index )) .. x(day , shift , doctor<br />

) + x( day +1 , shift +1 , doctor ) =e=<br />

122 1 + y(day ,<br />

123<br />

shift , doctor , index ) - k(day , shift , doctor ,in<br />

dex );<br />

124 MODEL ASSIGNMENT / VALUE ,H0a ,H0b ,H0c ,H1 ,H2 ,H3a ,H3b ,H4 ,H5 ,B0 ,B1 ,B2a ,B2b ,B3 ,B4<br />

125<br />

,B5 ,B6a , B6b /;<br />

126 SOLVE ASSIGNMENT USING MIP MINIMIZING z;<br />

127<br />

128 display x.l;<br />

COMPILATION TIME = 0.010 SECONDS 3.2 Mb SOL215 -140 Nov 11 , 2004<br />

GAMS Rev 140 Sun Sparc / SOLAR<br />

10/28/08 18:25:02 Page 4<br />

G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m<br />

E x e c u t i o n<br />

---- 36 SET workingdays


Appendix B. GAMS Model 81<br />

1 , 2 , 3 , 4 , 5 , 8 , 9 , 10 , 11 , 12 , 15 , 16 ,<br />

25 , 26<br />

17 , 18 , 19 , 22 , 23 , 24<br />

GAMS Rev 140 Sun Sparc / SOLAR<br />

10/28/08 18:25:02 Page 5<br />

G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m<br />

Model Statistics SOLVE ASSIGNMENT Using MIP From line 126<br />

MODEL STATISTICS<br />

BLOCKS OF EQUATIONS 19 SINGLE EQUATIONS 4031<br />

BLOCKS OF VARIABLES 6 SINGLE VARIABLES 3747<br />

NON ZERO ELEMENTS 9831 DISCRETE VARIABLES 3744<br />

GENERATION TIME = 0.148 SECONDS 4.5 Mb SOL215 -140 Nov 11 , 2004<br />

EXECUTION TIME = 0.162 SECONDS 4.5 Mb SOL215 -140 Nov 11 , 2004<br />

GAMS Rev 140 Sun Sparc / SOLAR<br />

10/28/08 18:25:02 Page 6<br />

G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m<br />

Solution Report SOLVE ASSIGNMENT Using MIP From line 126<br />

S O L V E S U M M A R Y<br />

MODEL ASSIGNMENT OBJECTIVE z<br />

TYPE MIP DIRECTION MINIMIZE<br />

SOLVER CPLEX FROM LINE 126<br />

**** SOLVER STATUS 1 NORMAL COMPLETION<br />

**** MODEL STATUS 1 OPTIMAL<br />

**** OBJECTIVE VALUE 2.0000<br />

RESOURCE USAGE , LIMIT 2.570 50000.000<br />

ITERATION COUNT , LIMIT 603 999999999<br />

GAMS / Cplex Nov 11 , 2004 SOL .CP.CL 21.5 026.029.041. SOL For Cplex 9.0<br />

Cplex 9.0.2 , GAMS Link 26<br />

Using environment variable ILOG_LICENSE_FILE to look for a Cplex license .<br />

Proven optimal solution .<br />

MIP Solution : 2.000000 (603 iterations , 16 nodes )<br />

Final Solve : 2.000000 (0 iterations )<br />

Best possible : 2.000000<br />

Absolute gap : 0.000000<br />

Relative gap : 0.000000


Appendix B. GAMS Model 82<br />

**** REPORT SUMMARY : 0 NONOPT<br />

GAMS Rev 140 Sun Sparc / SOLAR<br />

0 INFEASIBLE<br />

0 UNBOUNDED<br />

10/28/08 18:25:02 Page 7<br />

G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m<br />

E x e c u t i o n<br />

---- 128 VARIABLE x.L doctors on shifts<br />

jst pzh hp sda hmm osj<br />

1 .2 1.000 1.000<br />

1 .3 1.000<br />

2 .2 1.000<br />

2 .3 1.000<br />

3 .2 1.000<br />

3 .3 1.000<br />

4 .2 1.000<br />

4 .3 1.000<br />

5 .2 1.000<br />

5 .3 1.000<br />

8 .2 1.000 1.000<br />

8 .3 1.000<br />

9 .2 1.000<br />

9 .3 1.000<br />

10.2 1.000<br />

10.3 1.000<br />

11.2 1.000<br />

11.3 1.000<br />

12.2 1.000<br />

12.3 1.000<br />

15.2 1.000 1.000<br />

15.3 1.000<br />

16.2 1.000<br />

16.3 1.000<br />

17.2 1.000<br />

17.3 1.000<br />

18.2 1.000<br />

18.3 1.000<br />

19.2 1.000<br />

19.3 1.000<br />

22.2 1.000 1.000<br />

22.3 1.000<br />

23.2 1.000<br />

23.3 1.000<br />

24.2 1.000<br />

24.3 1.000<br />

25.2 1.000<br />

25.3 1.000<br />

26.2 1.000<br />

26.3 1.000


Appendix B. GAMS Model 83<br />

EXECUTION TIME = 0.020 SECONDS 3.4 Mb SOL215 -140 Nov 11 , 2004<br />

GAMS Rev 140 Sun Sparc / SOLAR<br />

10/28/08 18:25:02 Page 8<br />

G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m<br />

E x e c u t i o n<br />

USER : Informatics and Mathematical Modelling A041202 :1254 AP - SOL<br />

Technical University of Denmark DC2412<br />

License for teaching and research at degree granting institutions<br />

**** FILE SUMMARY<br />

Input / xbar / nas2 / home1 / s03 / s032651 / GAMS / Assignment . gms<br />

Output / xbar / nas2 / home1 / s03 / s032651 / GAMS / Assignment . lst


Appendix B. GAMS Model 84<br />

B.3 <strong>The</strong> solved model<br />

This section contains the solutions to the subproblem of the DRP.<br />

B.3.1 GAMS solution<br />

Table B.1: Solution found by GAMS<br />

Day JST HMM OSJ SDA PZH HP<br />

01-09-2008 S2, V11, S1, S1,<br />

02-09-2008 S1, S2, V15,<br />

03-09-2008 S2, S1,<br />

04-09-2008 V14, S2, S1,<br />

05-09-2008 S2, S1,<br />

06-09-2008<br />

07-09-2008<br />

08-09-2008 S1, S1, S2,<br />

09-09-2008 S2, S1,<br />

10-09-2008 S2, S1,<br />

11-09-2008 V12, S1, S2,<br />

12-09-2008 S1, S2,<br />

13-09-2008<br />

14-09-2008<br />

15-09-2008 S1, S1, S2, V12,<br />

16-09-2008 S2, S1,<br />

17-09-2008 S2, S1,<br />

18-09-2008 S2, S1,<br />

19-09-2008 S1, S2,<br />

20-09-2008<br />

21-09-2008 V15,<br />

22-09-2008 S1, S2, S1,<br />

23-09-2008 S2, S1,<br />

24-09-2008 S2, S1,<br />

25-09-2008 S1, K16, S2,<br />

26-09-2008 S1, S2,<br />

27-09-2008<br />

28-09-2008


Appendix B. GAMS Model 85<br />

B.3.2 <strong>The</strong> best greedy solution<br />

Table B.2: Best greedy, RCL 1<br />

Day SDA HMM PZH HP OSJ JST<br />

09-01-08 S1, V11, S2, S1,<br />

09-02-08 S2, V15, S1,<br />

09-03-08 S1, S2,<br />

09-04-08 S2, S1, V14,<br />

09-05-08 S1, S2,<br />

09-06-08<br />

09-07-08<br />

09-08-08 S1, S2, S1,<br />

09-09-08 S1, S2,<br />

09-10-08 S2, S1,<br />

09-11-08 V12, S1, S2,<br />

09-12-08 S2, S1,<br />

09-13-08<br />

09-14-08<br />

09-15-08 S1, S2, V12, S1,<br />

09-16-08 S2, S1,<br />

09-17-08 S1, S2,<br />

09-18-08 S1, S2,<br />

09-19-08 S1, S2,<br />

09-20-08<br />

09-21-08 V15,<br />

09-22-08 S1, S2, S1,<br />

09-23-08 S2, S1,<br />

09-24-08 S1, S2,<br />

09-25-08 K16, S1, S2,<br />

09-26-08 S1, S2,<br />

09-27-08<br />

09-28-08


Appendix B. GAMS Model 86<br />

B.3.3 <strong>The</strong> best GRASP solution<br />

Table B.3: Best GRASP, RCL 1<br />

Day SDA HMM PZH HP OSJ JST<br />

09-01-08 V11, S1, S1, S2,<br />

09-02-08 S2, V15, S1,<br />

09-03-08 S1, S2,<br />

09-04-08 S2, S1, V14,<br />

09-05-08 S2, S1,<br />

09-06-08<br />

09-07-08<br />

09-08-08 S1, S2, S1,<br />

09-09-08 S1, S2,<br />

09-10-08 S2, S1,<br />

09-11-08 V12, S1, S2,<br />

09-12-08 S1, S2,<br />

09-13-08<br />

09-14-08<br />

09-15-08 S1, V12, S1, S2,<br />

09-16-08 S1, S2,<br />

09-17-08 S2, S1,<br />

09-18-08 S1, S2,<br />

09-19-08 S2, S1,<br />

09-20-08<br />

09-21-08 V15,<br />

09-22-08 S2, S1, S1,<br />

09-23-08 S1, S2,<br />

09-24-08 S2, S1,<br />

09-25-08 K16, S2, S1,<br />

09-26-08 S1, S2,<br />

09-27-08<br />

09-28-08


Appendix C<br />

Tests<br />

This appendix contains the test instances and a summary for each metaheuristic param-<br />

eter that was tested.<br />

C.1 Test instances<br />

<strong>The</strong> following subsections contains the test instances described by the night and evening<br />

shifts and the doctors wishes.<br />

87


Appendix C. Tests 88<br />

C.1.1 Instance 0<br />

JST PZH HP SDA HMM OSJ<br />

09-04-08 V14 09-02-08 V15 09-15-08 V12 09-20-08 V7 09-01-08 V11 09-01-08 FERIE<br />

09-13-08 V8 09-08-08 Ss 09-19-08 Ss 09-21-08 V15 09-06-08 K15 09-02-08 FERIE<br />

09-14-08 V2 09-29-08 V14 11-01-08 V7 10-10-08 V15 09-07-08 V1 09-03-08 FERIE<br />

10-09-08 Ss 10-25-08 V6 11-09-08 V15 10-11-08 Ss 09-11-08 V12 09-04-08 FERIE<br />

10-13-08 V13 10-26-08 V2 12-01-08 V14 10-16-08 V12 09-16-08 Ss 09-05-08 FERIE<br />

10-25-08 V3 11-05-08 V13 12-22-08 V15 12-16-08 V13 09-20-08 K14 09-06-08 FERIE<br />

10-26-08 V13 11-21-08 V11 10-05-08 V13 12-24-08 V3 09-21-08 V3 09-07-08 FERIE<br />

11-13-08 V11 11-29-08 V4 10-09-08 V13 09-01-08 FRI2 09-25-08 K16 10-13-08 FERIE<br />

11-20-08 V15 11-30-08 V9 09-01-08 FRI2 09-09-08 FRI2 10-04-08 K6 10-14-08 FERIE<br />

12-06-08 V8 12-16-08 V11 09-04-08 FRI2 09-12-08 FRI2 10-05-08 V13 10-15-08 FERIE<br />

12-07-08 V10 12-27-08 V2 09-09-08 FRI2 09-15-08 FERIE 10-09-08 V13<br />

12-22-08 V12 12-28-08 V6 09-18-08 FRI2 09-26-08 FERIE 10-17-08 K16<br />

09-08-08 FRI2 12-31-08 V14 09-23-08 FRI2 09-29-08 FERIE 10-18-08 K19<br />

09-09-08 FRI2 09-09-08 FRI2 09-30-08 FRI2 09-04-08 FERIE 10-19-08 K19<br />

09-16-08 FRI2 09-19-08 FRI2 09-26-08 FERIE 10-02-08 FRI1 10-31-08 K6<br />

09-29-08 FERIE 10-13-08 FERIE 10-07-08 FRI2 10-17-08 FERIE 11-01-08 V3<br />

09-30-08 FERIE 10-14-08 FERIE 10-20-08 FRI2 10-20-08 FERIE 11-02-08 K6<br />

10-01-08 FERIE 10-15-08 FERIE 10-23-08 FRI2 11-06-08 V13<br />

10-02-08 FERIE 10-16-08 FERIE 10-27-08 FRI2 11-10-08 K16<br />

10-03-08 FERIE 10-17-08 FERIE 10-15-08 FERIE 11-18-08 K16<br />

10-04-08 FERIE 10-18-08 FERIE 10-16-08 FERIE 11-29-08 K4<br />

10-05-08 FERIE 10-19-08 FERIE 10-17-08 FERIE 11-30-08 V12<br />

10-06-08 FERIE 11-07-08 FRI1 11-06-08 FRI2 12-04-08 K6<br />

10-07-08 FERIE 11-17-08 FRI1 11-11-08 FRI2 12-13-08 V9<br />

10-22-08 FRI2 12-05-08 FRI2 11-17-08 FRI2 12-14-08 K5<br />

10-23-08 FRI2 12-23-08 FERIE 11-18-08 FRI2 12-18-08 K16<br />

10-31-08 FERIE 12-30-08 FERIE 11-20-08 FRI2 12-25-08 K16<br />

11-05-08 FRI2 11-10-08 FERIE 12-27-08 K14<br />

11-07-08 FRI2 12-05-08 FRI2 12-28-08 K15<br />

11-12-08 FRI2 12-08-08 FRI2 09-08-08 FERIE<br />

11-27-08 FRI2 12-11-08 FRI2 09-09-08 FERIE<br />

12-03-08 FRI2 09-10-08 FERIE<br />

12-04-08 FRI2 09-11-08 FERIE<br />

12-05-08 FRI2 09-12-08 FERIE<br />

12-16-08 FRI2 09-13-08 FERIE<br />

12-17-08 FRI2 09-14-08 FERIE<br />

12-30-08 FERIE


Appendix C. Tests 89


Appendix C. Tests 90<br />

C.1.2 Instance 1<br />

JST PZH HP SDA HMM OSJ<br />

09-04-08 V14 09-02-08 V15 09-15-08 V12 09-20-08 V7 09-01-08 V11 09-01-08 FERIE<br />

09-07-08 V4 09-04-08 V1 09-19-08 Ss 09-21-08 V15 09-06-08 K15 09-02-08 FERIE<br />

09-13-08 V8 09-08-08 Ss 11-01-08 V7 10-10-08 V15 09-07-08 V1 09-03-08 FERIE<br />

09-14-08 V2 09-15-08 V2 11-09-08 V15 10-11-08 Ss 09-11-08 V12 09-04-08 FERIE<br />

09-20-08 V6 09-29-08 V14 12-01-08 V14 10-16-08 V12 09-16-08 Ss 09-05-08 FERIE<br />

09-25-08 V12 09-14-08 V6 12-22-08 V15 12-16-08 V13 09-20-08 K14 09-06-08 FERIE<br />

10-09-08 Ss 10-25-08 V6 10-05-08 V13 12-24-08 V3 09-21-08 V3 09-07-08 FERIE<br />

09-11-08 V1 10-26-08 V2 10-09-08 V13 09-01-08 FRI2 09-25-08 K16 10-13-08 FERIE<br />

10-13-08 V13 11-01-08 V16 09-01-08 FRI2 09-09-08 FRI2 10-04-08 K6 10-14-08 FERIE<br />

10-18-08 V2 11-05-08 V13 09-04-08 FRI2 09-12-08 FRI2 10-05-08 V13 10-15-08 FERIE<br />

10-25-08 V3 11-12-08 V1 09-09-08 FRI2 09-15-08 FERIE 10-09-08 V13 09-20-08 V2<br />

10-26-08 V13 11-21-08 V11 09-18-08 FRI2 09-26-08 FERIE 10-17-08 K16 09-25-08 V1<br />

10-30-08 V7 11-26-08 V12 09-23-08 FRI2 09-29-08 FERIE 10-18-08 K19 10-20-08 V1<br />

10-05-08 V2 11-29-08 V4 09-30-08 FRI2 09-04-08 FERIE 10-19-08 K19 10-27-08 FRI1<br />

11-13-08 V11 11-30-08 V9 09-26-08 FERIE 10-02-08 FRI1 10-31-08 K6 11-05-08 FRI2<br />

11-17-08 V1 12-10-08 V2 10-07-08 FRI2 10-17-08 FERIE 11-01-08 V3 11-12-08 FERIE<br />

11-20-08 V15 12-16-08 V11 10-20-08 FRI2 10-20-08 FERIE 11-02-08 K6 11-17-08 FERIE<br />

11-25-08 V5 12-20-08 V3 10-23-08 FRI2 08-05-08 V1 11-06-08 V13 11-28-08 V2<br />

12-06-08 V8 12-27-08 V2 10-27-08 FRI2 09-27-08 V13 11-10-08 K16 12-06-08 V3<br />

12-07-08 V10 12-28-08 V6 10-15-08 FERIE 10-05-08 V2 11-18-08 K16<br />

12-13-08 V5 12-31-08 V14 10-16-08 FERIE 10-23-08 Ss 11-29-08 K4<br />

12-20-08 V1 09-04-08 V12 10-17-08 FERIE 11-10-08 V9 11-30-08 V12<br />

12-22-08 V12 09-09-08 FRI2 11-06-08 FRI2 11-25-08 FRI1 12-04-08 K6<br />

12-30-08 FRI1 09-13-08 FRI1 11-11-08 FRI2 12-04-08 FRI2 12-13-08 V9<br />

09-08-08 FRI2 09-19-08 FRI2 11-17-08 FRI2 12-14-08 K5<br />

09-09-08 FRI2 10-04-08 FRI1 11-18-08 FRI2 12-18-08 K16<br />

09-13-08 FRI1 10-13-08 FERIE 11-20-08 FRI2 12-25-08 K16<br />

09-16-08 FRI2 10-14-08 FERIE 11-10-08 FERIE 12-27-08 K14<br />

09-23-08 FRI1 10-15-08 FERIE 12-05-08 FRI2 12-28-08 K15<br />

09-29-08 FERIE 10-16-08 FERIE 12-08-08 FRI2 09-08-08 FERIE<br />

09-30-08 FERIE 10-17-08 FERIE 12-11-08 FRI2 09-09-08 FERIE<br />

10-01-08 FERIE 10-18-08 FERIE 09-17-08 V1 09-10-08 FERIE<br />

10-02-08 FERIE 10-19-08 FERIE 09-25-08 V2 09-11-08 FERIE<br />

10-03-08 FERIE 11-02-08 FERIE 10-03-08 V4 09-12-08 FERIE<br />

10-04-08 FERIE 11-07-08 FRI1 10-16-08 V13 09-13-08 FERIE<br />

10-05-08 FERIE 11-14-08 FRI2 11-05-08 V2 09-14-08 FERIE<br />

10-06-08 FERIE 11-17-08 FRI1 11-20-08 Ss<br />

10-07-08 FERIE 11-25-08 FRI1 12-05-08 FERIE<br />

10-15-08 FERIE 12-05-08 FRI2 09-08-08 FRI1<br />

10-22-08 FRI2 12-16-08 FRI2 09-16-08 FRI2<br />

10-23-08 FRI2 12-23-08 FERIE 11-08-08 FRI1<br />

10-26-08 FRI1 12-30-08 FERIE<br />

10-31-08 FERIE<br />

11-02-08 FRI1<br />

11-05-08 FRI2<br />

11-07-08 FRI2<br />

11-12-08 FRI2<br />

11-18-08 FRI2<br />

11-27-08 FRI2<br />

12-03-08 FRI2<br />

12-04-08 FRI2<br />

12-05-08 FRI2<br />

12-10-08 FRI1<br />

12-16-08 FRI2<br />

12-17-08 FRI2<br />

12-30-08 FERIE


Appendix C. Tests 91<br />

C.1.3 Instance 2<br />

JST PZH HP SDA HMM OSJ TEST1<br />

09-04-08 V14 09-02-08 V15 09-15-08 V12 09-20-08 V7 09-01-08 V11 09-01-08 FERIE 09-03-08 V15<br />

09-13-08 V8 09-08-08 Ss 09-19-08 Ss 09-21-08 V15 09-06-08 K15 09-02-08 FERIE 09-07-08 Ss<br />

09-14-08 V2 09-29-08 V14 11-01-08 V7 10-10-08 V15 09-07-08 V1 09-03-08 FERIE 09-30-08 V14<br />

10-09-08 Ss 10-25-08 V6 11-09-08 V15 10-11-08 Ss 09-11-08 V12 09-04-08 FERIE 10-24-08 V6<br />

10-13-08 V13 10-26-08 V2 12-01-08 V14 10-16-08 V12 09-16-08 Ss 09-05-08 FERIE 10-25-08 V2<br />

10-25-08 V3 11-05-08 V13 12-22-08 V15 12-16-08 V13 09-20-08 K14 09-06-08 FERIE 11-02-08 V13<br />

10-26-08 V13 11-21-08 V11 10-05-08 V13 12-24-08 V3 09-21-08 V3 09-07-08 FERIE 11-15-08 V11<br />

11-13-08 V11 11-29-08 V4 10-09-08 V13 09-01-08 FRI2 09-25-08 K16 10-13-08 FERIE 11-29-08 V4<br />

11-20-08 V15 11-30-08 V9 09-01-08 FRI2 09-09-08 FRI2 10-04-08 K6 10-14-08 FERIE 11-30-08 V9<br />

12-06-08 V8 12-16-08 V11 09-04-08 FRI2 09-12-08 FRI2 10-05-08 V13 10-15-08 FERIE 12-03-08 V11<br />

12-07-08 V10 12-27-08 V2 09-09-08 FRI2 09-15-08 FERIE 10-09-08 V13 12-20-08 V2<br />

12-22-08 V12 12-28-08 V6 09-18-08 FRI2 09-26-08 FERIE 10-17-08 K16 12-25-08 V6<br />

09-08-08 FRI2 12-31-08 V14 09-23-08 FRI2 09-29-08 FERIE 10-18-08 K19 12-28-08 V14<br />

09-09-08 FRI2 09-09-08 FRI2 09-30-08 FRI2 09-04-08 FERIE 10-19-08 K19 09-04-08 FRI2<br />

09-16-08 FRI2 09-19-08 FRI2 09-26-08 FERIE 10-02-08 FRI1 10-31-08 K6 09-14-08 FRI2<br />

09-29-08 FERIE 10-13-08 FERIE 10-07-08 FRI2 10-17-08 FERIE 11-01-08 V3 10-12-08 FERIE<br />

09-30-08 FERIE 10-14-08 FERIE 10-20-08 FRI2 10-20-08 FERIE 11-02-08 K6 10-13-08 FERIE<br />

10-01-08 FERIE 10-15-08 FERIE 10-23-08 FRI2 11-06-08 V13 10-16-08 FERIE<br />

10-02-08 FERIE 10-16-08 FERIE 10-27-08 FRI2 11-10-08 K16 10-17-08 FERIE<br />

10-03-08 FERIE 10-17-08 FERIE 10-15-08 FERIE 11-18-08 K16 10-18-08 FERIE<br />

10-04-08 FERIE 10-18-08 FERIE 10-16-08 FERIE 11-29-08 K4 10-19-08 FERIE<br />

10-05-08 FERIE 10-19-08 FERIE 10-17-08 FERIE 11-30-08 V12 10-26-08 FERIE<br />

10-06-08 FERIE 11-07-08 FRI1 11-06-08 FRI2 12-04-08 K6 11-04-08 FRI1<br />

10-07-08 FERIE 11-17-08 FRI1 11-11-08 FRI2 12-13-08 V9 11-23-08 FRI1<br />

10-22-08 FRI2 12-05-08 FRI2 11-17-08 FRI2 12-14-08 K5 12-01-08 FRI2<br />

10-23-08 FRI2 12-23-08 FERIE 11-18-08 FRI2 12-18-08 K16 12-10-08 FERIE<br />

10-31-08 FERIE 12-30-08 FERIE 11-20-08 FRI2 12-25-08 K16 12-28-08 FERIE<br />

11-05-08 FRI2 11-10-08 FERIE 12-27-08 K14<br />

11-07-08 FRI2 12-05-08 FRI2 12-28-08 K15<br />

11-12-08 FRI2 12-08-08 FRI2 09-08-08 FERIE<br />

11-27-08 FRI2 12-11-08 FRI2 09-09-08 FERIE<br />

12-03-08 FRI2 09-10-08 FERIE<br />

12-04-08 FRI2 09-11-08 FERIE<br />

12-05-08 FRI2 09-12-08 FERIE<br />

12-16-08 FRI2 09-13-08 FERIE<br />

12-17-08 FRI2 09-14-08 FERIE<br />

12-30-08 FERIE


Appendix C. Tests 92<br />

C.1.4 Instance 3<br />

JST PZH HP SDA HMM<br />

09-04-08 V14 09-02-08 V15 09-15-08 V12 09-20-08 V7 09-01-08 V11<br />

09-13-08 V8 09-08-08 Ss 09-19-08 Ss 09-21-08 V15 09-06-08 K15<br />

09-14-08 V2 09-29-08 V14 11-01-08 V7 10-10-08 V15 09-07-08 V1<br />

10-09-08 Ss 10-25-08 V6 11-09-08 V15 10-11-08 Ss 09-11-08 V12<br />

10-13-08 V13 10-26-08 V2 12-01-08 V14 10-16-08 V12 09-16-08 Ss<br />

10-25-08 V3 11-05-08 V13 12-22-08 V15 12-16-08 V13 09-20-08 K14<br />

10-26-08 V13 11-21-08 V11 10-05-08 V13 12-24-08 V3 09-21-08 V3<br />

11-13-08 V11 11-29-08 V4 10-09-08 V13 09-01-08 FRI2 09-25-08 K16<br />

11-20-08 V15 11-30-08 V9 09-01-08 FRI2 09-09-08 FRI2 10-04-08 K6<br />

12-06-08 V8 12-16-08 V11 09-04-08 FRI2 09-12-08 FRI2 10-05-08 V13<br />

12-07-08 V10 12-27-08 V2 09-09-08 FRI2 09-15-08 FERIE 10-09-08 V13<br />

12-22-08 V12 12-28-08 V6 09-18-08 FRI2 09-26-08 FERIE 10-17-08 K16<br />

09-08-08 FRI2 12-31-08 V14 09-23-08 FRI2 09-29-08 FERIE 10-18-08 K19<br />

09-09-08 FRI2 09-09-08 FRI2 09-30-08 FRI2 09-04-08 FERIE 10-19-08 K19<br />

09-16-08 FRI2 09-19-08 FRI2 09-26-08 FERIE 10-02-08 FRI1 10-31-08 K6<br />

09-29-08 FERIE 10-13-08 FERIE 10-07-08 FRI2 10-17-08 FERIE 11-01-08 V3<br />

09-30-08 FERIE 10-14-08 FERIE 10-20-08 FRI2 10-20-08 FERIE 11-02-08 K6<br />

10-01-08 FERIE 10-15-08 FERIE 10-23-08 FRI2 11-06-08 V13<br />

10-02-08 FERIE 10-16-08 FERIE 10-27-08 FRI2 11-10-08 K16<br />

10-03-08 FERIE 10-17-08 FERIE 10-15-08 FERIE 11-18-08 K16<br />

10-04-08 FERIE 10-18-08 FERIE 10-16-08 FERIE 11-29-08 K4<br />

10-05-08 FERIE 10-19-08 FERIE 10-17-08 FERIE 11-30-08 V12<br />

10-06-08 FERIE 11-07-08 FRI1 11-06-08 FRI2 12-04-08 K6<br />

10-07-08 FERIE 11-17-08 FRI1 11-11-08 FRI2 12-13-08 V9<br />

10-22-08 FRI2 12-05-08 FRI2 11-17-08 FRI2 12-14-08 K5<br />

10-23-08 FRI2 12-23-08 FERIE 11-18-08 FRI2 12-18-08 K16<br />

10-31-08 FERIE 12-30-08 FERIE 11-20-08 FRI2 12-25-08 K16<br />

11-05-08 FRI2 11-10-08 FERIE 12-27-08 K14<br />

11-07-08 FRI2 12-05-08 FRI2 12-28-08 K15<br />

11-12-08 FRI2 12-08-08 FRI2 09-08-08 FERIE<br />

11-27-08 FRI2 12-11-08 FRI2 09-09-08 FERIE<br />

12-03-08 FRI2 09-10-08 FERIE<br />

12-04-08 FRI2 09-11-08 FERIE<br />

12-05-08 FRI2 09-12-08 FERIE<br />

12-16-08 FRI2 09-13-08 FERIE<br />

12-17-08 FRI2 09-14-08 FERIE<br />

12-30-08 FERIE


Appendix C. Tests 93<br />

C.1.5 Instance 4<br />

JST PZH HP SDA HMM OSJ<br />

09-04-08 V14 09-02-08 V15 09-15-08 V12 09-20-08 V7 09-01-08 V11 09-01-08 FERIE<br />

09-13-08 V8 09-08-08 Ss 09-19-08 Ss 09-21-08 V15 09-06-08 K15 09-02-08 FERIE<br />

09-14-08 V2 09-29-08 V14 11-01-08 V7 10-10-08 V15 09-07-08 V1 09-03-08 FERIE<br />

10-09-08 Ss 10-25-08 V6 11-09-08 V15 10-11-08 Ss 09-11-08 V12 09-04-08 FERIE<br />

10-13-08 V13 10-26-08 V2 12-01-08 V14 10-16-08 V12 09-16-08 Ss 09-05-08 FERIE<br />

10-25-08 V3 11-05-08 V13 12-22-08 V15 12-16-08 V13 09-20-08 K14 09-06-08 FERIE<br />

10-26-08 V13 11-21-08 V11 10-05-08 V13 12-24-08 V3 09-21-08 V3 09-07-08 FERIE<br />

11-13-08 V11 11-29-08 V4 10-09-08 V13 09-01-08 FRI2 09-25-08 K16 10-13-08 FERIE<br />

11-20-08 V15 11-30-08 V9 09-01-08 FRI2 09-09-08 FRI2 10-04-08 K6 10-14-08 FERIE<br />

12-06-08 V8 12-16-08 V11 09-04-08 FRI2 09-12-08 FRI2 10-05-08 V13 10-15-08 FERIE<br />

12-07-08 V10 12-27-08 V2 09-09-08 FRI2 09-15-08 FERIE 10-09-08 V13 01-02-09 K14<br />

12-22-08 V12 12-28-08 V6 09-18-08 FRI2 09-26-08 FERIE 10-17-08 K16 01-07-09 K5<br />

09-08-08 FRI2 12-31-08 V14 09-23-08 FRI2 09-29-08 FERIE 10-18-08 K19 01-10-09 V2<br />

09-09-08 FRI2 09-09-08 FRI2 09-30-08 FRI2 09-04-08 FERIE 10-19-08 K19 01-18-09 V1<br />

09-16-08 FRI2 09-19-08 FRI2 09-26-08 FERIE 10-02-08 FRI1 10-31-08 K6 02-02-09 V15<br />

09-29-08 FERIE 10-13-08 FERIE 10-07-08 FRI2 10-17-08 FERIE 11-01-08 V3 02-04-09 V11<br />

09-30-08 FERIE 10-14-08 FERIE 10-20-08 FRI2 10-20-08 FERIE 11-02-08 K6 02-12-09 V8<br />

10-01-08 FERIE 10-15-08 FERIE 10-23-08 FRI2 01-02-09 V2 11-06-08 V13 02-26-09 V4<br />

10-02-08 FERIE 10-16-08 FERIE 10-27-08 FRI2 01-08-09 V2 11-10-08 K16 03-01-09 K4<br />

10-03-08 FERIE 10-17-08 FERIE 10-15-08 FERIE 01-18-09 V6 11-18-08 K16 03-07-09 K16<br />

10-04-08 FERIE 10-18-08 FERIE 10-16-08 FERIE 01-27-09 V10 11-29-08 K4 03-15-09 V3<br />

10-05-08 FERIE 10-19-08 FERIE 10-17-08 FERIE 02-05-09 V8 11-30-08 V12 03-21-09 V8<br />

10-06-08 FERIE 11-07-08 FRI1 11-06-08 FRI2 02-09-09 V1 12-04-08 K6 04-02-09 Ss<br />

10-07-08 FERIE 11-17-08 FRI1 11-11-08 FRI2 02-19-09 V12 12-13-08 V9 04-15-09 V1<br />

10-22-08 FRI2 12-05-08 FRI2 11-17-08 FRI2 02-24-09 Ss 12-14-08 K5 04-24-09 V12<br />

10-23-08 FRI2 12-23-08 FERIE 11-18-08 FRI2 03-04-09 V3 12-18-08 K16 01-12-09 FERIE<br />

10-31-08 FERIE 12-30-08 FERIE 11-20-08 FRI2 03-08-09 V15 12-25-08 K16 01-13-09 FERIE<br />

11-05-08 FRI2 01-02-09 V5 11-10-08 FERIE 03-23-09 V15 12-27-08 K14 01-14-09 FERIE<br />

11-07-08 FRI2 01-12-09 V10 12-05-08 FRI2 03-29-09 V7 12-28-08 K15 01-15-09 FERIE<br />

11-12-08 FRI2 01-15-09 V3 12-08-08 FRI2 04-03-09 V8 09-08-08 FERIE 01-16-09 FERIE<br />

11-27-08 FRI2 01-27-09 V2 12-11-08 FRI2 04-17-09 V2 09-09-08 FERIE 03-02-09 FERIE


Appendix C. Tests 94<br />

JST PZH HP SDA HMM OSJ<br />

12-03-08 FRI2 02-04-09 V8 01-01-09 V1 04-25-09 V3 09-10-08 FERIE 03-03-09 FERIE<br />

12-04-08 FRI2 02-09-09 V11 01-09-09 V10 04-18-09 FERIE 09-11-08 FERIE 03-12-09 FRI1<br />

12-05-08 FRI2 02-13-09 V13 01-11-09 V8 04-19-09 FERIE 09-12-08 FERIE 03-26-09 FRI1<br />

12-16-08 FRI2 02-23-09 V2 01-19-09 V2 04-20-09 FERIE 09-13-08 FERIE 04-01-09 FRI1<br />

12-17-08 FRI2 03-01-09 V6 01-25-09 V13 04-21-09 FERIE 09-14-08 FERIE 04-10-09 FRI2<br />

12-30-08 FERIE 03-16-09 V14 02-02-09 V13 04-22-09 FERIE 01-04-09 V5 04-22-09 FRI2<br />

01-03-09 V8 03-20-09 Ss 02-10-09 V7 04-23-09 FERIE 01-11-09 V2<br />

01-10-09 V2 03-29-09 V15 02-28-09 V4 01-19-09 V3<br />

01-13-09 V3 04-01-09 V2 03-03-09 V2 01-26-09 V10<br />

01-20-09 V13 04-25-09 V5 03-06-09 V4 02-01-09 V1<br />

02-01-09 V11 04-27-09 V16 03-15-09 V3 02-05-09 V12<br />

02-07-09 V8 01-20-09 FERIE 03-30-09 Ss 02-19-09 K14<br />

02-16-09 V14 01-21-09 FERIE 04-05-09 V12 02-28-09 K19<br />

02-25-09 V15 01-22-09 FERIE 04-20-09 V11 03-02-09 V12<br />

03-03-09 Ss 03-05-09 FERIE 04-28-09 V2 03-09-09 K5<br />

03-10-09 V2 03-06-09 FERIE 04-30-09 V5 03-15-09 K16<br />

03-17-09 V8 01-23-09 FRI1 02-12-09 FERIE 03-22-09 V3<br />

03-24-09 V12 02-16-09 FRI1 02-13-09 FERIE 04-09-09 V2<br />

04-05-09 V16 02-26-09 FRI1 02-14-09 FERIE 04-23-09 K4<br />

04-18-09 V1 03-23-09 FRI1 02-15-09 FERIE 04-29-09 V11<br />

04-29-09 V9 04-10-09 FRI2 02-16-09 FERIE 02-20-09 FERIE<br />

03-11-09 FERIE 02-21-09 FERIE<br />

03-12-09 FERIE 02-22-09 FERIE<br />

03-13-09 FERIE 02-02-09 FERIE<br />

03-14-09 FERIE 02-03-09 FERIE<br />

01-06-09 FRI1 02-04-09 FERIE<br />

02-10-09 FRI1<br />

04-06-09 FRI2<br />

04-23-09 FRI2


Appendix C. Tests 95<br />

C.1.6 Instance 5<br />

JST PZH HP SDA HMM OSJ<br />

09-04-08 V14 09-02-08 V15 09-02-08 V15 09-02-08 FRI1 09-01-08 V11 09-01-08 FERIE<br />

09-07-08 V4 09-04-08 V1 09-04-08 V1 09-09-08 V1 09-06-08 K15 09-02-08 FERIE<br />

09-13-08 V8 09-08-08 Ss 09-08-08 Ss 09-13-08 V2 09-07-08 V1 09-03-08 FERIE<br />

09-14-08 V2 09-15-08 V2 09-14-08 FRI1 09-18-08 FRI2 09-11-08 V12 09-04-08 FERIE<br />

09-15-08 V1 09-18-08 FRI1 09-15-08 V2 09-20-08 V7 09-16-08 Ss 09-05-08 FERIE<br />

09-20-08 V6 09-23-08 FRI2 09-29-08 V14 09-21-08 V15 09-20-08 K14 09-06-08 FERIE<br />

09-25-08 V12 09-29-08 V14 09-14-08 V6 09-25-08 V12 09-21-08 V3 09-07-08 FERIE<br />

09-28-08 V2 09-14-08 V6 09-17-08 FRI1 10-03-08 V8 09-25-08 K16 10-13-08 FERIE<br />

10-03-08 V1 09-19-08 V1 10-25-08 V6 10-10-08 V15 09-30-08 V1 10-14-08 FERIE<br />

10-09-08 Ss 10-25-08 V6 10-26-08 V2 10-11-08 Ss 10-04-08 K6 10-15-08 FERIE<br />

09-11-08 V1 10-26-08 V2 11-01-08 V16 10-16-08 V12 10-05-08 V13 09-20-08 V2<br />

10-13-08 V13 11-01-08 V16 11-05-08 V13 12-16-08 V13 10-09-08 V13 09-25-08 V1<br />

10-18-08 V2 11-05-08 V13 11-12-08 V1 12-24-08 V3 10-14-08 FRI2 10-20-08 V1<br />

10-25-08 V3 11-08-08 FRI2 11-15-08 FRI2 12-29-08 V2 10-17-08 K16 10-27-08 FRI1<br />

10-26-08 V13 11-12-08 V1 11-21-08 V11 09-01-08 FRI2 10-18-08 K19 11-05-08 FRI2<br />

10-30-08 V7 11-21-08 V11 11-26-08 V12 09-09-08 FRI2 10-19-08 K19 11-12-08 FERIE<br />

11-02-08 V1 11-26-08 V12 11-29-08 V4 09-12-08 FRI2 10-26-08 V6 11-17-08 FERIE<br />

10-05-08 V2 11-29-08 V4 11-30-08 V9 09-15-08 FERIE 10-31-08 K6 11-28-08 V2<br />

11-13-08 V11 11-30-08 V9 12-04-08 FRI2 09-26-08 FERIE 11-01-08 V3 12-06-08 V3<br />

11-17-08 V1 12-10-08 V2 12-10-08 V2 09-29-08 FERIE 11-02-08 K6 12-13-08 V1<br />

11-20-08 V15 12-13-08 FRI1 12-16-08 V11 09-04-08 FERIE 11-06-08 V13 12-18-08 K2<br />

11-25-08 V5 12-16-08 V11 12-20-08 V3 10-02-08 FRI1 11-10-08 K16 12-27-08 V5<br />

12-06-08 V8 12-20-08 V3 12-27-08 V2 10-17-08 FERIE 11-15-08 K3<br />

12-07-08 V10 12-27-08 V2 12-28-08 V6 10-20-08 FERIE 11-18-08 K16<br />

12-13-08 V5 12-28-08 V6 12-31-08 V14 08-05-08 V1 11-29-08 K4<br />

12-20-08 V1 12-31-08 V14 09-04-08 V12 09-27-08 V13 11-30-08 V12<br />

12-22-08 V12 09-04-08 V12 09-09-08 FRI2 10-05-08 V2 12-04-08 K6<br />

12-30-08 FRI1 09-09-08 FRI2 09-13-08 FRI1 10-23-08 Ss 12-13-08 V9<br />

09-08-08 FRI2 09-13-08 FRI1 09-19-08 FRI2 11-10-08 V9 12-14-08 K5<br />

09-09-08 FRI2 09-19-08 FRI2 10-04-08 FRI1 11-25-08 FRI1 12-18-08 K16<br />

09-13-08 FRI1 10-04-08 FRI1 10-13-08 FERIE 12-04-08 FRI2 12-25-08 K16


Appendix C. Tests 96<br />

JST PZH HP SDA HMM OSJ<br />

09-16-08 FRI2 10-13-08 FERIE 10-14-08 FERIE 12-27-08 K14<br />

09-23-08 FRI1 10-14-08 FERIE 10-15-08 FERIE 12-28-08 K15<br />

09-29-08 FERIE 10-15-08 FERIE 10-16-08 FERIE 09-08-08 FERIE<br />

09-30-08 FERIE 10-16-08 FERIE 10-17-08 FERIE 09-09-08 FERIE<br />

10-01-08 FERIE 10-17-08 FERIE 10-18-08 FERIE 09-10-08 FERIE<br />

10-02-08 FERIE 10-18-08 FERIE 10-19-08 FERIE 09-11-08 FERIE<br />

10-03-08 FERIE 10-19-08 FERIE 11-02-08 FERIE 09-12-08 FERIE<br />

10-04-08 FERIE 11-02-08 FERIE 11-07-08 FRI1 09-13-08 FERIE<br />

10-05-08 FERIE 11-07-08 FRI1 11-14-08 FRI2 09-14-08 FERIE<br />

10-06-08 FERIE 11-14-08 FRI2 11-17-08 FRI1<br />

10-07-08 FERIE 11-17-08 FRI1 11-25-08 FRI1<br />

10-15-08 FERIE 11-25-08 FRI1 12-05-08 FRI2<br />

10-22-08 FRI2 12-05-08 FRI2 12-16-08 FRI2<br />

10-23-08 FRI2 12-16-08 FRI2 12-23-08 FERIE<br />

10-26-08 FRI1 12-23-08 FERIE 12-30-08 FERIE<br />

10-31-08 FERIE 12-30-08 FERIE<br />

11-02-08 FRI1<br />

11-05-08 FRI2<br />

11-07-08 FRI2<br />

11-12-08 FRI2<br />

11-18-08 FRI2<br />

11-27-08 FRI2<br />

12-03-08 FRI2<br />

12-04-08 FRI2<br />

12-05-08 FRI2<br />

12-10-08 FRI1<br />

12-16-08 FRI2<br />

12-17-08 FRI2<br />

12-30-08 FERIE


Appendix C. Tests 97<br />

C.1.7 Instance 6<br />

JST PZH HP SDA HMM OSJ TEST1<br />

09-04-08 V14 09-02-08 V15 09-15-08 V12 09-20-08 V7 09-01-08 V11 09-01-08 FERIE 09-03-08 V15<br />

09-13-08 V8 09-08-08 Ss 09-19-08 Ss 09-21-08 V15 09-06-08 K15 09-02-08 FERIE 09-07-08 Ss<br />

09-14-08 V2 09-29-08 V14 10-05-08 V13 10-10-08 V15 09-07-08 V1 09-03-08 FERIE 09-30-08 V14<br />

10-09-08 Ss 10-25-08 V6 10-09-08 V13 10-11-08 Ss 09-11-08 V12 09-04-08 FERIE 10-24-08 V6<br />

10-13-08 V13 10-26-08 V2 09-01-08 FRI2 10-16-08 V12 09-16-08 Ss 09-05-08 FERIE 10-25-08 V2<br />

10-25-08 V3 09-09-08 FRI2 09-04-08 FRI2 09-01-08 FRI2 09-20-08 K14 09-06-08 FERIE 09-04-08 FRI2<br />

10-26-08 V13 09-19-08 FRI2 09-09-08 FRI2 09-09-08 FRI2 09-21-08 V3 09-07-08 FERIE 09-14-08 FRI2<br />

09-08-08 FRI2 10-13-08 FERIE 09-18-08 FRI2 09-12-08 FRI2 09-25-08 K16 10-13-08 FERIE 10-12-08 FERIE<br />

09-09-08 FRI2 10-14-08 FERIE 09-23-08 FRI2 09-15-08 FERIE 10-04-08 K6 10-14-08 FERIE 10-13-08 FERIE<br />

09-16-08 FRI2 10-15-08 FERIE 09-30-08 FRI2 09-26-08 FERIE 10-05-08 V13 10-15-08 FERIE 10-16-08 FERIE<br />

09-29-08 FERIE 10-16-08 FERIE 09-26-08 FERIE 09-29-08 FERIE 10-09-08 V13 10-17-08 FERIE<br />

09-30-08 FERIE 10-17-08 FERIE 10-07-08 FRI2 09-04-08 FERIE 10-17-08 K16 10-18-08 FERIE<br />

10-01-08 FERIE 10-18-08 FERIE 10-20-08 FRI2 10-02-08 FRI1 10-18-08 K19 10-19-08 FERIE<br />

10-02-08 FERIE 10-19-08 FERIE 10-23-08 FRI2 10-17-08 FERIE 10-19-08 K19 10-26-08 FERIE<br />

10-03-08 FERIE 10-27-08 FRI2 10-20-08 FERIE 10-31-08 K6<br />

10-04-08 FERIE 10-15-08 FERIE 09-08-08 FERIE<br />

10-05-08 FERIE 10-16-08 FERIE 09-09-08 FERIE<br />

10-06-08 FERIE 10-17-08 FERIE 09-10-08 FERIE<br />

10-07-08 FERIE 09-11-08 FERIE<br />

10-22-08 FRI2 09-12-08 FERIE<br />

10-23-08 FRI2 09-13-08 FERIE<br />

10-31-08 FERIE 09-14-08 FERIE


Appendix C. Tests 98<br />

C.1.8 Instance 7<br />

JST PZH HP SDA HMM OSJ TEST1 TEST2<br />

09-04-08 V14 09-02-08 V15 09-15-08 V12 09-20-08 V7 09-01-08 V11 09-01-08 FERIE 09-04-08 V14 09-20-08 V7<br />

09-13-08 V8 09-08-08 Ss 09-19-08 Ss 09-21-08 V15 09-06-08 K15 09-02-08 FERIE 09-13-08 V8 09-21-08 V15<br />

09-14-08 V2 09-29-08 V14 11-01-08 V7 10-10-08 V15 09-07-08 V1 09-03-08 FERIE 09-14-08 V2 10-10-08 V15<br />

10-09-08 Ss 10-25-08 V6 11-09-08 V15 10-11-08 Ss 09-11-08 V12 09-04-08 FERIE 10-09-08 Ss 10-11-08 Ss<br />

10-13-08 V13 10-26-08 V2 12-01-08 V14 10-16-08 V12 09-16-08 Ss 09-05-08 FERIE 10-13-08 V13 10-16-08 V12<br />

10-25-08 V3 11-05-08 V13 12-22-08 V15 12-16-08 V13 09-20-08 K14 09-06-08 FERIE 10-25-08 V3 09-01-08 FRI2<br />

10-26-08 V13 11-21-08 V11 10-05-08 V13 12-24-08 V3 09-21-08 V3 09-07-08 FERIE 10-26-08 V13 09-09-08 FRI2<br />

11-13-08 V11 11-29-08 V4 10-09-08 V13 09-01-08 FRI2 09-25-08 K16 10-13-08 FERIE 09-08-08 FRI2 09-12-08 FRI2<br />

11-20-08 V15 11-30-08 V9 09-01-08 FRI2 09-09-08 FRI2 10-04-08 K6 10-14-08 FERIE 09-09-08 FRI2 09-15-08 FERIE<br />

12-06-08 V8 12-16-08 V11 09-04-08 FRI2 09-12-08 FRI2 10-05-08 V13 10-15-08 FERIE 09-16-08 FRI2 09-26-08 FERIE<br />

12-07-08 V10 12-27-08 V2 09-09-08 FRI2 09-15-08 FERIE 10-09-08 V13 01-02-09 K14 09-29-08 FERIE 09-29-08 FERIE<br />

12-22-08 V12 12-28-08 V6 09-18-08 FRI2 09-26-08 FERIE 10-17-08 K16 01-07-09 K5 09-30-08 FERIE 09-04-08 FERIE<br />

09-08-08 FRI2 12-31-08 V14 09-23-08 FRI2 09-29-08 FERIE 10-18-08 K19 01-10-09 V2 10-01-08 FERIE 10-02-08 FRI1<br />

09-09-08 FRI2 09-09-08 FRI2 09-30-08 FRI2 09-04-08 FERIE 10-19-08 K19 01-18-09 V1 10-02-08 FERIE 10-17-08 FERIE<br />

09-16-08 FRI2 09-19-08 FRI2 09-26-08 FERIE 10-02-08 FRI1 10-31-08 K6 02-02-09 V15 10-03-08 FERIE 10-20-08 FERIE<br />

09-29-08 FERIE 10-13-08 FERIE 10-07-08 FRI2 10-17-08 FERIE 11-01-08 V3 02-04-09 V11 10-04-08 FERIE 11-01-08 V3<br />

09-30-08 FERIE 10-14-08 FERIE 10-20-08 FRI2 10-20-08 FERIE 11-02-08 K6 02-12-09 V8 10-05-08 FERIE 11-02-08 K6<br />

10-01-08 FERIE 10-15-08 FERIE 10-23-08 FRI2 01-02-09 V2 11-06-08 V13 02-26-09 V4 10-06-08 FERIE 11-06-08 V13<br />

10-02-08 FERIE 10-16-08 FERIE 10-27-08 FRI2 01-08-09 V2 11-10-08 K16 01-12-09 FERIE 10-07-08 FERIE 11-10-08 K16<br />

10-03-08 FERIE 10-17-08 FERIE 10-15-08 FERIE 01-18-09 V6 11-18-08 K16 01-13-09 FERIE 10-22-08 FRI2 11-18-08 K16<br />

10-04-08 FERIE 10-18-08 FERIE 10-16-08 FERIE 01-27-09 V10 11-29-08 K4 01-14-09 FERIE 10-23-08 FRI2 11-29-08 K4<br />

10-05-08 FERIE 10-19-08 FERIE 10-17-08 FERIE 02-05-09 V8 11-30-08 V12 01-15-09 FERIE 10-31-08 FERIE 11-30-08 V12<br />

10-06-08 FERIE 11-07-08 FRI1 11-06-08 FRI2 02-09-09 V1 12-04-08 K6 01-16-09 FERIE 11-05-08 V13 12-04-08 K6<br />

10-07-08 FERIE 11-17-08 FRI1 11-11-08 FRI2 02-19-09 V12 12-13-08 V9 11-21-08 V11 12-13-08 V9<br />

10-22-08 FRI2 12-05-08 FRI2 11-17-08 FRI2 02-24-09 Ss 12-14-08 K5 11-29-08 V4 12-14-08 K5<br />

10-23-08 FRI2 12-23-08 FERIE 11-18-08 FRI2 12-18-08 K16 11-30-08 V9 12-18-08 K16<br />

10-31-08 FERIE 12-30-08 FERIE 11-20-08 FRI2 12-25-08 K16 12-16-08 V11 12-25-08 K16<br />

11-05-08 FRI2 01-02-09 V5 11-10-08 FERIE 12-27-08 K14 12-27-08 V2 12-27-08 K14<br />

11-07-08 FRI2 01-12-09 V10 12-05-08 FRI2 12-28-08 K15 12-28-08 V6 12-28-08 K15<br />

11-12-08 FRI2 01-15-09 V3 12-08-08 FRI2 09-08-08 FERIE 12-31-08 V14 01-02-09 K14<br />

11-27-08 FRI2 01-27-09 V2 12-11-08 FRI2 09-09-08 FERIE 11-07-08 FRI1 01-07-09 K5<br />

12-03-08 FRI2 02-04-09 V8 01-01-09 V1 09-10-08 FERIE 11-17-08 FRI1 01-10-09 V2<br />

12-04-08 FRI2 02-09-09 V11 01-09-09 V10 09-11-08 FERIE 12-05-08 FRI2 01-18-09 V1<br />

12-05-08 FRI2 02-13-09 V13 01-11-09 V8 09-12-08 FERIE 12-23-08 FERIE 02-02-09 V15<br />

12-16-08 FRI2 02-23-09 V2 01-19-09 V2 09-13-08 FERIE 12-30-08 FERIE 02-04-09 V11<br />

12-17-08 FRI2 01-20-09 FERIE 01-25-09 V13 09-14-08 FERIE 02-12-09 V8<br />

12-30-08 FERIE 01-21-09 FERIE 02-02-09 V13 01-04-09 V5 02-26-09 V4<br />

01-03-09 V8 01-22-09 FERIE 02-10-09 V7 01-11-09 V2 01-12-09 FERIE<br />

01-10-09 V2 01-23-09 FRI1 02-28-09 V4 01-19-09 V3 01-13-09 FERIE<br />

01-13-09 V3 02-16-09 FRI1 02-12-09 FERIE 01-26-09 V10 01-14-09 FERIE<br />

01-20-09 V13 02-26-09 FRI1 02-13-09 FERIE 02-01-09 V1 01-15-09 FERIE<br />

02-01-09 V11 02-14-09 FERIE 02-05-09 V12 01-16-09 FERIE<br />

02-07-09 V8 02-15-09 FERIE 02-19-09 K14<br />

02-16-09 V14 02-16-09 FERIE 02-28-09 K19<br />

02-25-09 V15 02-20-09 FERIE<br />

01-06-09 FRI1 02-21-09 FERIE<br />

02-10-09 FRI1 02-22-09 FERIE<br />

02-02-09 FERIE<br />

02-03-09 FERIE<br />

02-04-09 FERIE


Appendix C. Tests 99<br />

C.1.9 Instance 8<br />

JST PZH HP SDA HMM OSJ<br />

09-04-08 V14 09-09-08 FRI2 09-15-08 V12 09-01-08 FRI2 09-11-08 FERIE 09-01-08 FERIE<br />

09-08-08 FRI2 09-19-08 FRI2 09-01-08 FRI2 09-04-08 FERIE 09-12-08 FERIE 09-02-08 FERIE<br />

09-09-08 FRI2 09-29-08 V14 09-23-08 FRI2 09-21-08 V15 09-13-08 FERIE 09-03-08 FERIE<br />

09-13-08 V8 10-17-08 FERIE 09-26-08 FERIE 09-26-08 FERIE 09-14-08 FERIE 09-04-08 FERIE<br />

10-01-08 FERIE 10-18-08 FERIE 09-30-08 FRI2 09-29-08 FERIE 09-16-08 Ss 10-13-08 FERIE<br />

10-02-08 FERIE 10-19-08 FERIE 10-05-08 V13 10-16-08 V12 09-20-08 K14 10-14-08 FERIE<br />

10-03-08 FERIE 10-25-08 V6 10-07-08 FRI2 10-17-08 FERIE 09-21-08 V3<br />

10-04-08 FERIE 10-26-08 V2 10-09-08 V13 10-20-08 FERIE 09-25-08 K16<br />

10-05-08 FERIE 11-21-08 V11 10-23-08 FRI2 12-16-08 V13 10-17-08 K16<br />

10-06-08 FERIE 11-29-08 V4 10-27-08 FRI2 12-24-08 V3 10-18-08 K19<br />

10-07-08 FERIE 11-30-08 V9 11-11-08 FRI2 10-19-08 K19<br />

11-05-08 FRI2 12-27-08 V2 11-17-08 FRI2 10-31-08 K6<br />

11-07-08 FRI2 12-28-08 V6 11-18-08 FRI2 11-01-08 V3<br />

11-12-08 FRI2 12-30-08 FERIE 11-20-08 FRI2 11-02-08 K6<br />

11-13-08 V11 12-31-08 V14 12-01-08 V14 11-29-08 K4<br />

11-20-08 V15 12-05-08 FRI2 11-30-08 V12<br />

11-27-08 FRI2 12-08-08 FRI2 12-04-08 K6<br />

12-07-08 V10 12-13-08 V9<br />

12-16-08 FRI2 12-14-08 K5<br />

12-17-08 FRI2 12-28-08 K15<br />

12-22-08 V12<br />

12-30-08 FERIE<br />

C.1.10 Instance 9<br />

It is the empty instance, with no night- or evening shifts given, nor any wishes.<br />

C.2 Summarized results<br />

C.2.1 RCL performance<br />

Cons 17 Imps Z(S) V(S) Cons 13 Imps Z(S) V(S) Cons 17 Imps Z(S) V(S)<br />

Test 1 GRASP 1 19,625 5 32 Test 3 GRASP 1 16,8125 3,5 30,4375 Test 6 GRASP 1 14,5 4,1875 12,6875<br />

GRASP 100 15,3125 363,6875 27,875 GRASP 100 17,0625 468,1875 23,25 GRASP 100 12,0625 176,8125 10,1875<br />

GRASP 50 13,625 6,125 27,5 GRASP 50 15,25 4,3125 25,4375 GRASP 50 15,25 8,5625 9,1875<br />

SA 1 62,35938 185,9844 8,9375 SA 1 59,65625 162,5156 9,171875 SA 1 41,65625 96,71875 2,1875<br />

SA 100 78,57813 624,9688 11,51563 SA 100 74,14063 689,8906 9,984375 SA 100 53,40625 276,7188 2,234375<br />

SA 50 72,51563 151,8125 9,6875 SA 50 67,34375 221,5625 9,9375 SA 50 39,09375 95,15625 1,9375<br />

Ave: 43,66927 222,9297 19,58594 Ave 41,71094 258,3281 18,03646 Ave 29,32813 109,6927 6,403646<br />

Cons 13 Imps Z(S) V(S) Cons 13 Imps Z(S) V(S) Cons 13 Imps Z(S) V(S)<br />

Test 0 GRASP 1 17,1875 3,5625 25,9375 Test 4 GRASP 1 19,1875 4,375 55,0625 Test 7 GRASP 1 20,875 3,4375 45,8125<br />

GRASP 100 14,625 392,75 19,3125 GRASP 100 17,4375 731,5 37,75 GRASP 100 16,9375 508,9375 27,3125<br />

GRASP 50 13,5 5,625 21,125 GRASP 50 15 4,6875 44,5 GRASP 50 16,5625 6,75 29,375<br />

SA 1 57,40625 111,2344 7,125 SA 1 74,29688 124,2656 20,46875 SA 1 62,84375 87,45313 14,20313<br />

SA 100 54,42188 520,7344 6,15625 SA 100 67,48438 1049,969 17,54688 SA 100 61,82813 761,1563 10,5<br />

SA 50 58,07813 142,6875 6,640625 SA 50 72,875 179,6563 19,1875 SA 50 63,53125 113,7969 10,57813<br />

Ave: 35,86979 196,099 14,38281 Ave 44,38021 349,0755 32,41927 Ave 40,42969 246,9219 22,96354


Appendix C. Tests 100<br />

Cons 12 Imps Z(S) V(S) Cons 18 Imps Z(S) V(S) Cons 7 Imps Z(S) V(S)<br />

Test 2 GRASP 1 17,4375 4,5 25,25 Test 5 GRASP 1 16,8125 4,375 31 Test 8 GRASP 1 15,5 4,9375 19<br />

GRASP 100 12,75 254 18 GRASP 100 13,9375 473,4375 29,125 GRASP 100 11,0625 185,0625 9,625<br />

GRASP 50 17,8125 6,1875 16,75 GRASP 50 13,8125 5,25 27,625 GRASP 50 14,625 4,625 14,9375<br />

SA 1 54,40625 151,4844 6,265625 SA 1 58 165,25 9,6875 SA 1 39,5 180,6719 3,8125<br />

SA 100 59 368,7188 5,375 SA 100 85,35938 686,1875 11,92188 SA 100 37,875 255,3281 2,625<br />

SA 50 44,20313 199,875 4,453125 SA 50 68,29688 171,9219 10,82813 SA 50 43,67188 133,8906 4,421875<br />

Ave: 34,26823 164,1276 12,68229 Ave 42,70313 251,0703 20,03125 Ave 27,03906 127,4193 9,070313<br />

Cons 0 Imps Z(S) V(S)<br />

Test 9 GRASP 1 7,6875 3,375 8,125<br />

GRASP 100 8,75 7,5 1<br />

GRASP 50 6,0625 2,875 3,375<br />

SA 1 7,40625 4 0,859375<br />

SA 100 3,53125 5,3125 0,09375<br />

SA 50 5,234375 3,125 0,28125<br />

Ave: 6,445313 4,364583 2,289063<br />

C.2.2 Enum effect<br />

Test 0 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

Day 2,125 0,375 6,75 4 329,125 12,5 112,6667 5,625<br />

Shift 5 51,5 4,5 38,25 456,375 26,125 155,2917 38,625<br />

Ave 3,5625 25,9375 5,625 21,125 392,75 19,3125 133,9792 22,125<br />

Median<br />

Day 2 0 6 4 410 12,5<br />

Shift 4,5 53,5 4 36 458,5 27<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

Day 94,09375 0,09375 109,0938 1,78125 522,2188 4,5 241,8021 2,125<br />

Shift 128,375 14,15625 176,2813 11,5 519,25 7,8125 274,6354 11,15625<br />

Ave 111,2344 7,125 142,6875 6,640625 520,7344 6,15625 258,2188 6,640625<br />

Median<br />

Day 69 0 85 2 505,5 4,5<br />

Shift 121,5 10 177,5 9,5 506 6,5


Appendix C. Tests 101<br />

Test 1 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

Day 1,875 0,375 7,5 7,75 328,5 20,25 112,625 9,458333<br />

Shift 8,125 63,625 4,75 47,25 398,875 35,5 137,25 48,79167<br />

Ave 5 32 6,125 27,5 363,6875 27,875 124,9375 29,125<br />

Median<br />

Day 2 0 7 7,5 352 20,5<br />

Shift 8 68 4 49 374 35<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

Day 138,375 0,09375 132,6875 4,34375 611 9,28125 294,0208 4,572917<br />

Shift 233,5938 17,78125 170,9375 15,03125 638,9375 13,75 347,8229 15,52083<br />

Ave 185,9844 8,9375 151,8125 9,6875 624,9688 11,51563 320,9219 10,04688<br />

Median<br />

Day 108 0 116 4 569 9<br />

Shift 245,5 16 159,5 12,5 650 14<br />

Test 2 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

Day 2,875 0,25 7,875 11,25 208,625 12,25 73,125 7,916667<br />

Shift 6,125 50,25 4,5 22,25 299,375 23,75 103,3333 32,08333<br />

Ave 4,5 25,25 6,1875 16,75 254 18 88,22917 20<br />

Median<br />

Day 3 0 6 3,5 233,5 11,5<br />

Shift 6 45,5 4 25 299,5 24<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

Day 121,25 0,125 137,5938 1,03125 373,7813 3,9375 210,875 1,697917<br />

Shift 181,7188 12,40625 262,1563 7,875 363,6563 6,8125 269,1771 9,03125<br />

Ave 151,4844 6,265625 199,875 4,453125 368,7188 5,375 240,026 5,364583<br />

Median<br />

Day 100,5 0 66 1 392 3<br />

Shift 180 8 277 6 362 5


Appendix C. Tests 102<br />

Test 3 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

Day 3,25 1,375 4,625 6,625 385,125 16,875 131 8,291667<br />

Shift 3,75 59,5 4 44,25 551,25 29,625 186,3333 44,45833<br />

Ave 3,5 30,4375 4,3125 25,4375 468,1875 23,25 158,6667 26,375<br />

Median<br />

Day 3 1 4 6,5 476 16,5<br />

Shift 3,5 61 4,5 45 555,5 30,5<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

Day 118,5625 1,125 180,8125 4,375 657,625 8,71875 319 4,739583<br />

Shift 206,4688 17,21875 262,3125 15,5 722,1563 11,25 396,9792 14,65625<br />

Ave 162,5156 9,171875 221,5625 9,9375 689,8906 9,984375 357,9896 9,697917<br />

Median<br />

Day 83 1 148,5 4 640 8<br />

Shift 224,5 13,5 252 12,5 723 8,5<br />

Test 4 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

Day 3 0,125 5,25 5,75 607,875 21,125 205,375 9<br />

Shift 5,75 110 4,125 83,25 855,125 54,375 288,3333 82,54167<br />

Ave 4,375 55,0625 4,6875 44,5 731,5 37,75 246,8542 45,77083<br />

Median<br />

Day 3 0 5,5 6 733,5 22<br />

Shift 5 111 4 83,5 860,5 54<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

Day 104,7813 0,0625 135,7813 3,78125 1026,156 11,1875 422,2396 5,010417<br />

Shift 143,75 40,875 223,5313 34,59375 1073,781 23,90625 480,3542 33,125<br />

Ave 124,2656 20,46875 179,6563 19,1875 1049,969 17,54688 451,2969 19,06771<br />

Median<br />

Day 82 0 95 4 1008 11,5<br />

Shift 154,5 36 232,5 30 1078,5 23


Appendix C. Tests 103<br />

Test 5 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

Day 3 0,125 5,5 9,625 391,375 22,5 133,2917 10,75<br />

Shift 5,75 61,875 5 45,625 555,5 35,75 188,75 47,75<br />

Ave 4,375 31 5,25 27,625 473,4375 29,125 161,0208 29,25<br />

Median<br />

Day 3 0 5 11 414,5 22<br />

Shift 6 63 4 46 571 36,5<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

Day 128,3125 0,09375 137,1563 5,6875 699,7813 10,6875 321,75 5,489583<br />

Shift 202,1875 19,28125 206,6875 15,96875 672,5938 13,15625 360,4896 16,13542<br />

Ave 165,25 9,6875 171,9219 10,82813 686,1875 11,92188 341,1198 10,8125<br />

Median<br />

Day 93,5 0 118,5 6 699,5 10,5<br />

Shift 209 14 199 14 666 13<br />

Test 6 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

Day 3,5 0,375 10,75 1,875 143,125 7,125 52,45833 3,125<br />

Shift 4,875 25 6,375 16,5 210,5 13,25 73,91667 18,25<br />

Ave 4,1875 12,6875 8,5625 9,1875 176,8125 10,1875 63,1875 10,6875<br />

Median<br />

Day 4 0 9,5 1,5 152 7<br />

Shift 3,5 25,5 6 16,5 215 11,5<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

Day 82,65625 0,0625 82,9375 0,6875 267,4063 1,78125 144,3333 0,84375<br />

Shift 110,7813 4,3125 107,375 3,1875 286,0313 2,6875 168,0625 3,395833<br />

Ave 96,71875 2,1875 95,15625 1,9375 276,7188 2,234375 156,1979 2,119792<br />

Median<br />

Day 55 0 84 1 242 1<br />

Shift 105 2 107 1,5 286,5 2


Appendix C. Tests 104<br />

Test 7 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

Day 2,375 0 7,875 5,375 413,625 16,25 141,2917 7,208333<br />

Shift 4,5 91,625 5,625 53,375 604,25 38,375 204,7917 61,125<br />

Ave 3,4375 45,8125 6,75 29,375 508,9375 27,3125 173,0417 34,16667<br />

Median<br />

Day 2,5 0 7,5 5 450 16,5<br />

Shift 3,5 92 5 56 590,5 35<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

Day 90,40625 0 94 3,21875 768,3125 7,125 317,5729 3,447917<br />

Shift 84,5 28,40625 133,5938 17,9375 754 13,875 324,0313 20,07292<br />

Ave 87,45313 14,20313 113,7969 10,57813 761,1563 10,5 320,8021 11,76042<br />

Median<br />

Day 81,5 0 102,5 3 749,5 8<br />

Shift 77 21 131,5 16 736,5 12,5<br />

Test 8 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

Day 2,875 0 3,625 1,375 151,5 5,5 52,66667 2,291667<br />

Shift 7 38 5,625 28,5 218,625 13,75 77,08333 26,75<br />

Ave 4,9375 19 4,625 14,9375 185,0625 9,625 64,875 14,52083<br />

Median<br />

Day 3,5 0 3,5 1,5 182,5 5<br />

Shift 6,5 33,5 5 27 221,5 14<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

Day 142,8438 0 116,875 0,46875 253,5 1,9375 171,0729 0,802083<br />

Shift 218,5 7,625 150,9063 8,375 257,1563 3,3125 208,8542 6,4375<br />

Ave 180,6719 3,8125 133,8906 4,421875 255,3281 2,625 189,9635 3,619792<br />

Median<br />

Day 128,5 0 94,5 0 243,5 1<br />

Shift 228 4,5 156 6,5 269,5 2


Appendix C. Tests 105<br />

Test 9 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

Day 1 0 1,25 0 5 0 2,416667 0<br />

Shift 5,75 16,25 4,5 6,75 10 2 6,75 8,333333<br />

Ave 3,375 8,125 2,875 3,375 7,5 1 4,583333 4,166667<br />

Median<br />

Day 1 0 1 0 4,5 0<br />

Shift 4,5 17 3,5 6 8,5 1<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

Day 0,96875 0 1,125 0 3,4375 0 1,84375 0<br />

Shift 7,03125 1,71875 5,125 0,5625 7,1875 0,1875 6,447917 0,822917<br />

Ave 4 0,859375 3,125 0,28125 5,3125 0,09375 4,145833 0,411458<br />

Day 1 0 1 0 3 0<br />

Shift 6,5 0 4 0 6 0<br />

C.2.3 Weights effect<br />

Test 0 RCL 1 RCL 50 RCL 100 Ave:<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

R1 3,625 26,375 6,5 22,5 359,875 18,75 123,3333 22,54167<br />

R2 3,5 25,5 4,75 19,75 425,625 19,875 144,625 21,70833<br />

Ave 3,5625 25,9375 5,625 21,125 392,75 19,3125 133,9792 22,125<br />

Median<br />

R1 3 20 6 18,5 418 18 142,3333 18,83333<br />

R2 2,5 16,5 4,5 18,5 457,5 19,5 154,8333 18,16667<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

R1 73,875 6,84375 109,9063 7,15625 494,375 6,40625 226,0521 6,802083<br />

R2 148,5938 7,40625 180,5806 6,258065 547,0938 5,90625 292,0894 6,523522<br />

Ave 111,2344 7,125 145,2434 6,707157 520,7344 6,15625 259,0707 6,662802<br />

Median<br />

R1 80,5 0 92 4 498 6 223,5 3,333333<br />

R2 157 0 200 2 543 4,5 300 2,166667


Appendix C. Tests 106<br />

Test 1 RCL 1 RCL 50 RCL 100 Ave:<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

R1 5,75 31,75 6,125 27,375 287,625 28,5 99,83333 29,20833<br />

R2 4,25 32,25 6,125 27,625 439,75 27,25 150,0417 29,04167<br />

Ave 5 32 6,125 27,5 363,6875 27,875 124,9375 29,125<br />

Median<br />

R1 4,5 23,5 6,5 25 330,5 28 113,8333 25,5<br />

R2 3 21 6 24,5 432,5 27,5 147,1667 24,33333<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

R1 128,4688 8,875 116,8438 9,84375 581,375 11,34375 275,5625 10,02083<br />

R2 243,5 9 186,7813 9,53125 668,5625 11,6875 366,2813 10,07292<br />

Ave 185,9844 8,9375 151,8125 9,6875 624,9688 11,51563 320,9219 10,04688<br />

Median<br />

R1 137,5 1 133 6,5 576 11 282,1667 6,166667<br />

R2 279 1 190 6 674,5 11 381,1667 6<br />

Test 2 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

R1 5,625 26 7,125 17,875 214,75 18 75,83333 20,625<br />

R2 3,375 24,5 5,25 15,625 293,25 18 100,625 19,375<br />

Ave 4,5 25,25 6,1875 16,75 254 18 88,22917 20<br />

Median<br />

R1 4 16 5,5 14 260,5 16 90 15,33333<br />

R2 3 14,5 4 12,5 293 15,5 100 14,16667<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

R1 123,6875 6,4375 136 4,5625 360,3125 5,53125 206,6667 5,510417<br />

R2 179,2813 6,09375 263,75 4,34375 377,125 5,21875 273,3854 5,21875<br />

Ave 151,4844 6,265625 199,875 4,453125 368,7188 5,375 240,026 5,364583<br />

Median<br />

R1 127,5 1 139 2 361,5 4 209,3333 2,333333<br />

R2 184 0 306 1,5 391,5 4 293,8333 1,833333


Appendix C. Tests 107<br />

Test 3 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

R1 3,25 31,375 4,125 26 415 23,25 140,7917 26,875<br />

R2 3,75 29,5 4,5 24,875 521,375 23,25 176,5417 25,875<br />

Ave 3,5 30,4375 4,3125 25,4375 468,1875 23,25 158,6667 26,375<br />

Median<br />

R1 3 20 4,5 23 496,5 22 168 21,66667<br />

R2 3,5 24 4 21,5 568,5 20,5 192 22<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

R1 119,3438 9 166 10,03125 662 10,46875 315,7813 9,833333<br />

R2 205,6875 9,34375 277,125 9,84375 717,7813 9,5 400,1979 9,5625<br />

Ave 162,5156 9,171875 221,5625 9,9375 689,8906 9,984375 357,9896 9,697917<br />

Median<br />

R1 98,5 2 186,5 6 654 9,5 313 5,833333<br />

R2 238,5 2 315,5 6 738,5 8 430,8333 5,333333<br />

Test 4 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

R1 5,125 54,75 5 47,25 634,5 37,375 214,875 46,45833<br />

R2 3,625 55,375 4,375 41,75 828,5 38,125 278,8333 45,08333<br />

Ave 4,375 55,0625 4,6875 44,5 731,5 37,75 246,8542 45,77083<br />

Median<br />

R1 4 38,5 5 41,5 780 34,5 263 38,16667<br />

R2 2,5 39,5 4 38,5 873 37 293,1667 38,33333<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

R1 85,65625 20,5625 141,4063 19,71875 1028,656 16,84375 418,5729 19,04167<br />

R2 162,875 20,375 217,9063 18,65625 1071,281 18,25 484,0208 19,09375<br />

Ave 124,2656 20,46875 179,6563 19,1875 1049,969 17,54688 451,2969 19,06771<br />

Median<br />

R1 91,5 2 145 6,5 1026 14,5 420,8333 7,666667<br />

R2 176,5 1,5 246 6,5 1084 17,5 502,1667 8,5


Appendix C. Tests 108<br />

Test 5 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

R1 4,25 31,75 5,75 27,75 395,875 29,5 135,2917 29,66667<br />

R2 4,5 30,25 4,75 27,5 551 28,75 186,75 28,83333<br />

Ave 4,375 31 5,25 27,625 473,4375 29,125 161,0208 29,25<br />

Median<br />

R1 3,5 21,5 5,5 23 461,5 30,5 156,8333 25<br />

R2 3,5 18 4 21 576,5 24,5 194,6667 21,16667<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

R1 118,3438 10 134,5 10,8125 673,4375 12,09375 308,7604 10,96875<br />

R2 212,1563 9,375 209,3438 10,84375 698,9375 11,75 373,4792 10,65625<br />

Ave 165,25 9,6875 171,9219 10,82813 686,1875 11,92188 341,1198 10,8125<br />

Median<br />

R1 118,5 1,5 160,5 7,5 662 12,5 313,6667 7,166667<br />

R2 239,5 1,5 242,5 8,5 693 10,5 391,6667 6,833333<br />

Test 6 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

R1 5,25 12,5 9,75 9,5 161,375 9,625 58,79167 10,54167<br />

R2 3,125 12,875 7,375 8,875 192,25 10,75 67,58333 10,83333<br />

Ave 4,1875 12,6875 8,5625 9,1875 176,8125 10,1875 63,1875 10,6875<br />

Median<br />

R1 4 6,5 8 7 172,5 10 61,5 7,833333<br />

R2 3 8,5 9 6 202,5 9 71,5 7,833333<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

R1 70,28125 2,25 80,3125 1,90625 247,125 2,03125 132,5729 2,0625<br />

R2 123,1563 2,125 110 1,96875 306,3125 2,4375 179,8229 2,177083<br />

Ave 96,71875 2,1875 95,15625 1,9375 276,7188 2,234375 156,1979 2,119792<br />

Median<br />

R1 77,5 0 94 0,5 243,5 1 138,3333 0,5<br />

R2 111,5 0 117 1 311 1,5 179,8333 0,833333


Appendix C. Tests 109<br />

Test 7 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

R1 3,625 45,25 7,75 31,25 418,125 28,5 143,1667 35<br />

R2 3,25 46,375 5,75 27,5 599,75 26,125 202,9167 33,33333<br />

Ave 3,4375 45,8125 6,75 29,375 508,9375 27,3125 173,0417 34,16667<br />

Median<br />

R1 3 28,5 7,5 23,5 486,5 24,5 165,6667 25,5<br />

R2 2,5 29 6 24 674,5 22 227,6667 25<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

R1 65,15625 14,1875 104,6563 10,75 736,7813 11,03125 302,1979 11,98958<br />

R2 109,75 14,21875 122,9375 10,40625 785,5313 9,96875 339,4063 11,53125<br />

Ave 87,45313 14,20313 113,7969 10,57813 761,1563 10,5 320,8021 11,76042<br />

Median<br />

R1 68 1 116,5 4,5 735,5 10 306,6667 5,166667<br />

R2 96 0,5 128 5,5 789,5 8,5 337,8333 4,833333<br />

Test 8 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

R1 4,5 19,75 3,75 15,75 184,125 9,5 64,125 15<br />

R2 5,375 18,25 5,5 14,125 186 9,75 65,625 14,04167<br />

Ave 4,9375 19 4,625 14,9375 185,0625 9,625 64,875 14,52083<br />

Median<br />

R1 4 11,5 3,5 12,5 210 8 72,5 10,66667<br />

R2 4,5 11,5 4,5 11,5 188 9,5 65,66667 10,83333<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

R1 148,9375 3,875 101,3125 4,4375 223,0313 2,96875 157,7604 3,760417<br />

R2 212,4063 3,75 166,4688 4,40625 287,625 2,28125 222,1667 3,479167<br />

Ave 180,6719 3,8125 133,8906 4,421875 255,3281 2,625 189,9635 3,619792<br />

Median<br />

R1 140,5 0 99,5 1 220,5 2 153,5 1<br />

R2 235 0 173,5 1 291,5 1,5 233,3333 0,833333


Appendix C. Tests 110<br />

Test 9 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

R1 4 7,25 3,125 3,5 7 1,25 4,708333 4<br />

R2 2,75 9 2,625 3,25 8 0,75 4,458333 4,333333<br />

Ave 3,375 8,125 2,875 3,375 7,5 1 4,583333 4,166667<br />

Median<br />

R1 1,5 1 2 1 5,5 0 3 0,666667<br />

R2 1,5 3 1 1 6,5 0 3 1,333333<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

R1 4,65625 0,71875 3,25 0,3125 5 0,0625 4,302083 0,364583<br />

R2 3,34375 1 3 0,25 5,625 0,125 3,989583 0,458333<br />

Ave 4 0,859375 3,125 0,28125 5,3125 0,09375 4,145833 0,411458<br />

Median<br />

R1 2 0 2 0 5 0 3 0<br />

R2 2 0 1,5 0 4 0 2,5 0<br />

C.2.4 Iterations effect<br />

Test 0 RCL 1 RCL 50 RCL 100 Ave:<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

5 4,125 31,875 5,5 24,625 329,125 21,625 112,9167 26,04167<br />

25 3 20 5,75 17,625 456,375 17 155,0417 18,20833<br />

Ave 3,5625 25,9375 5,625 21,125 392,75 19,3125 133,9792 22,125<br />

Median<br />

5 4 30 6 22,5 412 21,5 140,6667 24,66667<br />

25 2 16 4,5 17 461,5 16,5 156 16,5<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

500 102,5938 11,59375 133,2188 10,75 517,625 10,28125 251,1458 10,875<br />

2500 119,875 2,65625 156,5161 2,548387 523,8438 2,03125 266,745 2,411962<br />

Ave 111,2344 7,125 144,8674 6,649194 520,7344 6,15625 258,9454 6,643481<br />

Median<br />

500 94 5 152,5 6 504,5 9 250,3333 6,666667<br />

2500 100,5 0 174 1 507,5 2 260,6667 1


Appendix C. Tests 111<br />

Test 1 RCL 1 RCL 50 RCL 100 Ave:<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

5 5,75 39,25 6,75 30,625 278,625 30,375 142,6875 30,5<br />

25 4,25 24,75 5,5 24,375 448,75 25,375 153,3333 29,66667<br />

Ave 5 32 6,125 27,5 363,6875 27,875 124,6875 26,70833<br />

Median<br />

5 5 37,5 7 30,5 343 29,5 175 30<br />

25 2,5 20 4 23,5 413,5 25 140,8333 28,66667<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

500 174,1875 14,65625 143,5938 15,21875 617,9688 17,3125 311,9167 15,72917<br />

2500 197,7813 3,21875 160,0313 4,15625 631,9688 5,71875 329,9271 4,364583<br />

Ave 185,9844 8,9375 151,8125 9,6875 624,9688 11,51563 320,9219 10,04688<br />

Median<br />

500 163 8,5 144,5 9,5 584 16 297,1667 11,33333<br />

2500 209,5 0,5 153,5 3 606,5 4 323,1667 2,5<br />

Test 2 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

5 5,75 33,625 8 20,125 203 21,375 72,25 25,04167<br />

25 3,25 16,875 4,375 13,375 305 14,625 104,2083 14,95833<br />

Ave 4,5 25,25 6,1875 16,75 254 18 88,22917 20<br />

Median<br />

5 5 26,5 7 19,5 273,5 21 95,16667 22,33333<br />

25 2,5 14 4 11,5 303 13 103,1667 12,83333<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

500 143,3438 10,71875 187,4375 7,625 369,8125 8,9375 233,5313 9,09375<br />

2500 159,625 1,8125 212,3125 1,28125 367,625 1,8125 246,5208 1,635417<br />

Ave 151,4844 6,265625 199,875 4,453125 368,7188 5,375 240,026 5,364583<br />

Median<br />

500 169,5 4 178,5 4,5 367,5 8 238,5 5,5<br />

2500 177 0 229 0 362,5 1,5 256,1667 0,5


Appendix C. Tests 112<br />

Test 3 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

5 4 37,25 4,625 28,625 385,375 26,875 131,3333 30,91667<br />

25 3 23,625 4 22,25 551 19,625 186 21,83333<br />

Ave 3,5 30,4375 4,3125 25,4375 468,1875 23,25 158,6667 26,375<br />

Median<br />

5 3,5 34,5 4,5 28,5 492,5 27 166,8333 30<br />

25 2,5 19 4 21 557,5 18 188 19,33333<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

500 154,3125 14,0625 209,3125 14,40625 684,625 14,4375 349,4167 14,30208<br />

2500 170,7188 4,28125 233,8125 5,46875 695,1563 5,53125 366,5625 5,09375<br />

Ave 162,5156 9,171875 221,5625 9,9375 689,8906 9,984375 357,9896 9,697917<br />

Median<br />

500 170,5 7 211,5 11 697 13,5 359,6667 10,5<br />

2500 179 1,5 221,5 4,5 711,5 5 370,6667 3,666667<br />

Test 4 RCL RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

5 3,375 65,125 4 48,5 613,125 42,375 206,8333 52<br />

25 5,375 45 5,375 40,5 849,875 33,125 286,875 39,54167<br />

Ave 4,375 55,0625 4,6875 44,5 731,5 37,75 246,8542 45,77083<br />

Median<br />

5 3,5 60 2,5 43 831 41 279 48<br />

25 4,5 38 5,5 38 847 31,5 285,6667 35,83333<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

500 117,3125 30,1875 169,6563 28,03125 1044,375 25,21875 443,7813 27,8125<br />

2500 131,2188 10,75 189,6563 10,34375 1055,563 9,875 458,8125 10,32292<br />

Ave 124,2656 20,46875 179,6563 19,1875 1049,969 17,54688 451,2969 19,06771<br />

Median<br />

500 101,5 15,5 192 18,5 1056,5 21,5 450 18,5<br />

2500 108,5 1,5 221 5 1070 7 466,5 4,5


Appendix C. Tests 113<br />

Test 5 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

5 4,375 38,75 5,25 32,625 378,625 32 129,4167 34,45833<br />

25 4,375 23,25 5,25 22,625 568,25 26,25 192,625 24,04167<br />

Ave 4,375 31 5,25 27,625 473,4375 29,125 161,0208 29,25<br />

Median<br />

5 3 36,5 5 30,5 460,5 32 156,1667 33<br />

25 4 18 4 21 580,5 23 196,1667 20,66667<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

500 154,5 15,1875 163,3438 16,53125 687,75 17,5 335,1979 16,40625<br />

2500 176 4,1875 180,5 5,125 684,625 6,34375 347,0417 5,21875<br />

Ave 165,25 9,6875 171,9219 10,82813 686,1875 11,92188 341,1198 10,8125<br />

Median<br />

500 138,5 7 173,5 12,5 673,5 16 328,5 11,83333<br />

2500 186 1,5 179 4 670,5 6 345,1667 3,833333<br />

Test 6 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

5 4,625 16,75 10,25 12 147,125 12,625 54 13,79167<br />

25 3,75 8,625 6,875 6,375 206,5 7,75 72,375 7,583333<br />

Ave 4,1875 12,6875 8,5625 9,1875 176,8125 10,1875 63,1875 10,6875<br />

Median<br />

5 3,5 14,5 9,5 11,5 172 10,5 61,66667 12,16667<br />

25 4 6 6 5,5 220 7,5 76,66667 6,333333<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

500 89,5 4 89,65625 3,5 271,9688 4,15625 150,375 3,885417<br />

2500 103,9375 0,375 100,6563 0,375 281,4688 0,3125 162,0208 0,354167<br />

Ave 96,71875 2,1875 95,15625 1,9375 276,7188 2,234375 156,1979 2,119792<br />

Median<br />

500 96 2 102 2 254 3,5 150,6667 2,5<br />

2500 101 0 106 0 261,5 0 156,1667 0


Appendix C. Tests 114<br />

Test 7 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

5 3,375 55,5 5,875 33,75 406,875 31,375 138,7083 40,20833<br />

25 3,5 36,125 7,625 25 611 23,25 207,375 28,125<br />

Ave 3,4375 45,8125 6,75 29,375 508,9375 27,3125 173,0417 34,16667<br />

Median<br />

5 3 48 6 31 484,5 27 164,5 35,33333<br />

25 3 28,5 7 21,5 635 21 215 23,66667<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

500 80,65625 22,53125 108,8438 16,15625 756,625 15,8125 315,375 18,16667<br />

2500 94,25 5,875 118,75 5 765,6875 5,1875 326,2292 5,354167<br />

Ave 87,45313 14,20313 113,7969 10,57813 761,1563 10,5 320,8021 11,76042<br />

Median<br />

500 77 8,5 123 10 742 13 314 10,5<br />

2500 81 0,5 125,5 2 749,5 4 318,6667 2,166667<br />

Test 8 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

5 5,75 24,625 5,625 18,375 164,375 11,625 58,58333 18,20833<br />

25 4,125 13,375 3,625 11,5 205,75 7,625 71,16667 10,83333<br />

Ave 4,9375 19 4,625 14,9375 185,0625 9,625 64,875 14,52083<br />

Median<br />

5 5,5 17,5 6,5 16 196 11,5 69,33333 15<br />

25 3,5 11,5 3 11 197 7 67,83333 9,833333<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

500 172,4688 6,6875 126,875 6,96875 252,7813 4,40625 184,0417 6,020833<br />

2500 188,875 0,9375 140,9063 1,875 257,875 0,84375 195,8854 1,21875<br />

Ave 180,6719 3,8125 133,8906 4,421875 255,3281 2,625 189,9635 3,619792<br />

Median<br />

500 197 1,5 121 3,5 243,5 4 187,1667 3<br />

2500 211 0 134,5 0 255,5 0 200,3333 0


Appendix C. Tests 115<br />

Test 9 RCL 1 RCL 50 RCL 100 Ave<br />

GRASP Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

5 3,375 12,75 2,125 5,25 8,375 2 4,625 6,666667<br />

25 3,375 3,5 3,625 1,5 6,625 0 4,541667 1,666667<br />

Ave 3,375 8,125 2,875 3,375 7,5 1 4,583333 4,166667<br />

Median<br />

5 2 10 1,5 4 8,5 1 4 5<br />

25 1,5 1 1 1 4,5 0 2,333333 0,666667<br />

SA Z(S) V(S) Z(S) V(S) Z(S) V(S)<br />

500 4,625 1,71875 4,0625 0,5625 6,15625 0,1875 4,947917 0,822917<br />

2500 3,375 0 2,1875 0 4,46875 0 3,34375 0<br />

Ave 4 0,859375 3,125 0,28125 5,3125 0,09375 4,145833 0,411458<br />

Median<br />

500 2 0 2 0 5 0 3 0<br />

2500 2 0 1,5 0 3,5 0 2,333333 0<br />

C.2.5 Highlighted results<br />

12<br />

10<br />

8<br />

6<br />

4<br />

2<br />

0<br />

GRASP-Day-1-2-R2-13%<br />

0 500 1.000 1.500 2.000 2.500 3.000<br />

Iterations<br />

GRASP-Day-1-2-R2-13%-vio GRASP-Day-1-2-R2-13%-value<br />

Working vio Working score<br />

Figure C.1: Optimal solution for test 0


Appendix C. Tests 116<br />

160<br />

140<br />

120<br />

100<br />

80<br />

60<br />

40<br />

20<br />

0<br />

SA-Shift-Fifty-2-R2-13%<br />

0 500 1.000 1.500 2.000 2.500<br />

Iterations<br />

SA-Shift-Fifty-2-R2-13%-vio SA-Shift-Fifty-2-R2-13%-value<br />

Working vio Working score Temperature<br />

Figure C.2: Example of the decreasing temperature<br />

1.000<br />

900<br />

800<br />

700<br />

600<br />

500<br />

400<br />

300<br />

200<br />

100<br />

Temperature


Bibliography<br />

[1] Emile Aarts, Jan Korst, and Wil Michiels. Search Methodologies - Introductory Tu-<br />

torials in Optimization and Decision Support Techniques, pages 187–210. Springer,<br />

2005.<br />

[2] Jonathan F. Bard and Hadi W. Purnomo. Short-term nurse scheduling in response<br />

to daily fluctuations in supply and demand. Health Care Management Sciences, 8:<br />

315–324, 2005.<br />

[3] Edmund Burke, Patrick De Causmaecker, and Greet Vanden Berghe. A Hybrid Tabu<br />

Search for the Nurse <strong>Rostering</strong> <strong>Problem</strong>, pages 187–194. Springer, 1999. Lecture<br />

Notes in Artificial Intelligence, vol. 1585.<br />

[4] Edmund K. Burke and Graham Kendall. Search Methodologies - Introductory Tu-<br />

torials in Optimization and Decision Support Techniques, pages 5–18. Springer,<br />

2005.<br />

[5] Edmund K. Burke, Patrick De Causmaecker, Greet Vanden Berghe, and Hen-<br />

drik Van Landeghem. <strong>The</strong> state of the art of nurse rostering. Journal of Scheduling,<br />

7:441–499, 2004.<br />

[6] Stephen Cook, editor. <strong>The</strong> Complexity of <strong>The</strong>orem Proving Procedures, 1971. Pro-<br />

ceedings of the third annual ACM symposium on <strong>The</strong>ory of computing.<br />

[7] Tiago M. Dias, Daniel F. Ferber, Cid C. de Souza, and Arnaldo V. Moura. Con-<br />

structing nurse schedules at large hospitals. International Transactions In Opera-<br />

tional Research, 10:245–265, 2003.<br />

[8] Kathryn A. Dowsland. Nurse scheduling with tabu search and strategic oscillation.<br />

European Journal of Operational Research, 106(2):393–407, 1998.<br />

[9] S. Even, A. Itai, and A. Shamir. On the complexity of timetable and multicom-<br />

modity flow problems. SIAM J. Comput, 5:691–703, 1976.<br />

117


Bibliography 118<br />

[10] Michael R. Garey and David S. Johnson. Computers and Intractability: A Guide<br />

to the <strong>The</strong>ory of NP-Completeness. W. H. Freeman & Co. New York, NY, USA,<br />

1979.<br />

[11] F. Glover. Future paths for integer programming and links to artificial intelligence.<br />

Comput. Oper. Res., (13):533–549, 1986.<br />

[12] Fred Glover and Fred Laguna. Tabu Search. Kluwer Academic Publishers, 1997.<br />

[13] John E. Hopcroft, Rajeev Motwani, and Jeffrey D. Ullman. Introduction to Au-<br />

tomata <strong>The</strong>ory, Languages, and Computation. Addison-Wesley, 2001.<br />

[14] Rudy Hung. Improving productivity and quality through workforce scheduling.<br />

Industrial Management, 34(6):4–6, 1992.<br />

[15] Richard M. Karp. Complexity of Computer Computations, pages 85–103. R. E.<br />

Miller and J. W. Thatcher (editors). New York: Plenum, 1972. Chapter: Re-<br />

ducibility Among Combinatorial <strong>Problem</strong>s.<br />

[16] Amnon Meisels and Andrea Schaerf. Solving employee timetabling problems by<br />

generalized local search. In Proceedings of the 6th Congress of the Italian Associa-<br />

tion for Artificial Intelligence on Advances in Artificial Intelligence, pages 380–389,<br />

1999.<br />

[17] Henrik Berg Nielsen. Algoritmer til vagtplanlægning for sygeplejersker. Master’s<br />

thesis, Syddansk Universitet Odense, Juni 2006.<br />

[18] Koji Nonobe and Toshihide Ibaraki. An improved tabu search method for the<br />

weighted constraint satisfaction problem. INFOR, 39(1):131–151, 2001.<br />

[19] Mauricio G. C. Resende and Thomas A. Feo. Greedy randomized adaptive search<br />

procedures. Technical report, <strong>The</strong> University of Texas, Austin, TX 78712 USA and<br />

AT&T Bell Laboratories, Murray Hill, NJ 07974 UAS, February 1994.<br />

[20] Mauricio G. C. Resende and Celso C. Ribeiro. Greedy randomized adaptive search<br />

procedures. Technical Report TD-53RSJY, AT&T Labs Research, August 2002.<br />

Version 2. To appear in State of the Art Handbook in Metaheuristics, F. Glover and<br />

G. Kochenberger, eds., Kluwer, 2002.<br />

[21] Robert Sedgewick and Kevin Wayne. Perm.java, 2006–2007. URL http://www.<br />

cs.princeton.edu/introcs/23recursion/Perm.java.html.<br />

[22] Rhian Silvestro and Claudio Silvestro. An evaluation of nurse rostering practices<br />

in the national health service. Journal of Advanced Nursing, 32(3):525–535, 2000.


Bibliography 119<br />

[23] Kai Toedter. Jcalendar, 2008. URL http://www.toedter.com/en/jcalendar/<br />

index.html.<br />

[24] M. Warner, B. Keller, and S. Martel. Automated nurse scheduling. Journal of the<br />

Society for Health Systems, 2(2):66–80, 1991.<br />

[25] Darrell Whitley and Jean Paul Watson. Search Methodologies - Introductory Tuto-<br />

rials in Optimization and Decision Support Techniques, pages 317–339. Springer,<br />

2005.<br />

[26] David H. Wolpert and William G. Macready. No free lunch theorems for search.<br />

Technical report, Santa Fe Institute, 1995.<br />

[27] David H. Wolpert and William G. Macready. No free lunch theorems for opti-<br />

mization. IEEE Transactions on Evolutionary Computation, 1(67), 1997. URL<br />

http://ic.arc.nasa.gov/people/dhw/papers/78.pdf.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!