Solving the Multi-activity Shift Scheduling Problem using Variable
Neighbourhood Search
Yi Qu
1a
and Timothy Curtois
2b
1
Newcastle Business School, Northumbria University, Newcastle-upon-Tyne, NE1 8ST, U.K.
2
Staff Roster Solutions, Sir Colin Campbell Building, Nottingham, NG7 2TU, U.K.
Keywords: Multi-activity Shift Scheduling, Variable Neighbourhood Search, Benchmarks.
Abstract: This paper presents a set of benchmarks instances for the multi-activity shift scheduling problem and the
results produced using a variable neighbourhood search method. The data set is intended as a resource to
generate and verify novel research on an important and practical but challenging problem. The variable
neighbourhood search uses four different neighbourhood operators and can produce feasible solutions within
short computation times.
1 INTRODUCTION
The multi-activity shift scheduling problem is a
widely occurring, difficult optimisation problem. It is
commonly found in retail environments for example.
At shops and stores staff are required to work
different activities at different times throughout a day.
Each shop could have a different number of activities.
Staff may be required to operate tills, or assist
customers on shop floors, or manage stock in a
warehouse, or supervise other staff etc. The demand
for each activity may also fluctuate throughout the
day as busy periods arise for that activity. For
example, there could be times when more staff are
required in the warehouse when deliveries arrive. The
demand will also vary per day as some days are busier
than others. There are also constraints on the
employee’s individual schedule. They will have a
maximum number of contracted hours. They may
also have a minimum number of hours work they
must be assigned. There are constraints on their shift
lengths and when they can start. There are often
working directives on how much rest they must have
between shifts and so on. The objective of the
scheduler is often to minimise costs from overstaffing
whilst satisfying all other constraints.
One of the earliest attempts to solve the problem
is (Loucks & Jacobs, 1991). Until recently it was a
a
https://orcid.org/0000-0002-7773-8949
b
https://orcid.org/0000-0002-4743-416X
relatively under-studied problem. Possibly due to its
size and complexity most papers have focussed on
solving a single stage of the decomposed problem,
such as day off scheduling, shift scheduling or tour
scheduling. More recently mathematical
programming-based approaches have been used on
different variations of the problem (Gérard,
Clautiaux, & Sadykov, 2016; Restrepo, Gendron, &
Rousseau, 2016, 2018; Restrepo, Lozano, &
Medaglia, 2012; Salvagnin & Walsh, 2012) and also
neighbourhood search methods (Dahmen & Rekik,
2015; S Pan, Akplogan, Létocart, Touati, & Calvo,
2016; Stefania Pan et al., 2018; Quimper & Rousseau,
2010).
The benchmark data set captures the core features
of the problem. Instances of varying planning length,
numbers of staff and numbers of activities have been
produced. There are instances of length 7, 14 and 28
days. The number of staff varies from 10 to 150 and
the numbers of different activities varies from 1 up to
19 in the largest instances. There are 225 instances in
total. The instances and their characteristics are listed
in Table 1. Due to the way that the solutions were
created it is known that every instance does have a
feasible solution. When creating the instances, it was
also observed that at least three of the instances have
zero cost solutions (that means their total penalty
score is zero). The instances are available for
download from www.schedulingbenchmarks.org.
Qu, Y. and Curtois, T.
Solving the Multi-activity Shift Scheduling Problem using Variable Neighbourhood Search.
DOI: 10.5220/0009118102270232
In Proceedings of the 9th International Conference on Operations Research and Enterprise Systems (ICORES 2020), pages 227-232
ISBN: 978-989-758-396-4; ISSN: 2184-4372
Copyright
c
2022 by SCITEPRESS Science and Technology Publications, Lda. All rights reserved
227
2 PROBLEM DESCRIPTION
The problem requires the assignment of shifts to
employees and the assignment of activities within the
shifts.
The planning horizon is divided into 15 minute
intervals and shifts must start and finish at the
beginning of a 15 minute interval. For example,
09:00-17:15 would be a valid shift but 09:08-17:15
would not be, nor would 09:00-17:04.
Shifts consist of one or more activities. For
example, Figure 1. shows a representation of a shift
which starts at 09:00 and finishes at 17:00. Within
this shift an employee starts on Activity 1 (green) for
3.5 hours and then transfers to Activity 2 (grey) for
the remaining 4.5 hours of the shift.
Figure 1: Example shift with one transfer.
Figure 2 shows another 8 hour shift but in this
example there are two activity changes. The
employee starts with Activity 1 and then switches to
Activity 2 after 3.5 hours and then transfers back to
Activity 1 for the final hour of the shift.
Figure 2: Example shift with two transfers.
There are no limits on the number of different
activities that a shift can contain or how many activity
changes can occur. However, every activity duration
must be at least one hour before the employee
changes to a different activity or the shift ends.
Activity changes must also occur at the beginning of
a 15 minute interval. For example, an activity change
could occur at 12:00 or 12:15 but not at any time
between 12:00-12:15.
Staff demand requirements (also called cover) are
provided for each activity for every 15-minute time
interval in the planning horizon e.g. 00:00-00:15,
00:15-00:30 … 23:30-23:45, 23:45-00:00.
In all the instances the planning horizon starts at
06:00 on the first day and finishes at 06:00 on the last
day. Therefore if the planning horizon is 7 days then
it runs from 06:00 on day 1 to 06:00 on day 8.
Shifts must be designed and then assigned such
that a minimum demand for each activity is satisfied
as well as the employees’ constraints and the
organisation’s work regulations. The other
constraints are as follows:
2.1 Constraints
C1: Maximum one shift per day - Employees cannot
start more than one shift on a day (where a day is
considered as starting at midnight and finishing 24
hours later).
C2: Maximum Five Consecutive Working Days -
The maximum number of consecutive working days
that can be assigned to an employee is 5. A day is
considered as a working day if a shift is started on that
day (where the day is considered as starting at
midnight and finishing 24 hours later). This constraint
always assumes that the last day of the previous
planning period was a day off and the first day of the
next planning period is a day off.
C3: Minimum Total Minutes - Each employee has
a minimum total time in minutes that must be assigned
over the whole planning horizon. This is specified in
the data file for each employee. The duration of each
shift is from the start time to the end time.
C4: Maximum Total Minutes – Each employee has
a maximum total time in minutes that can be assigned
over the whole planning horizon. This is specified in
the data file for each employee. The duration of each
shift is from the start time to the end time.
C5: Minimum Rest Time between Shifts - There
must be a minimum of 14 hours rest after every shift.
This means that after a shift finishes the employee
cannot start another shift until at least 14 hours later.
C6: Minimum Activity Duration - A shift can
contain any number of different activities, but each
activity duration must be at least 1 hour. This means
that a shift cannot contain an activity duration that is
less than one hour. For example, a shift which starts
at 09:00 and has the first 45 minutes assigned to
Activity 1 and then switches to Activity 2 at 09:45 is
not valid, but if the shift switches to Activity 2 at
10:00 then it would be valid.
C7: Minimum Shift Length - The minimum shift
duration is 6 hours.
C8: Maximum Shift Length - The maximum shift
duration is 10 hours.
C9: Valid Shift Start Times - Shifts can only start
between the following times each day: 06:00-10:00,
14:00-18:00 and 20:00-00:00. A shift cannot start
outside one of these intervals. For example, a shift
could start at 10:00 but not 10:15.
ICORES 2020 - 9th International Conference on Operations Research and Enterprise Systems
228
C10: Minimum Cover Requirements - The
minimum number of required staff for every time
interval and every activity must be satisfied. These
requirements are specified in the instance data files.
2.2 Objective Function
The objective is to minimise assigning more staff that
is required for each activity for every interval. It is
modelled as a quadratic function to ensure that over-
assignment is spread out over the planning horizon
rather than occurring in a small number of intervals,
which could happen with a linear function.
A maximum cover requirement is given for every
activity and every interval. If more than the maximum
required number of staff at the specified time interval
for the specified activity is assigned then a penalty
cost is added to the objective function value: If the
number assigned (x) is more than the maximum
required number then the penalty for that activity and
time interval is:
(x - max) * (x - max) * weight
The weight for all instances is 1.
The solution's total penalty is the sum of all the
penalties for every time interval and activity
requirement.
Figure 3: Screenshot of verifier.
2.3 Solution Verification
To ensure the accuracy of new computational results
a verifier has been made available (screenshot in
Figure 3). The solutions can be saved in a defined
XML format. These XML files can be read by and
opened using the verifier. The verifier will display the
objective function as well as displaying any errors or
constraint violations that may have been accidentally
introduced. This will help researchers to verify their
solutions and identify any errors if their solution does
not match the verifier’s calculated objective function.
The solution visualisation may also be useful in
designing and testing new algorithms. The verifier is
available at www.schedulingbenchmarks.org.
3 VARIABLE NEIGHBOURHOOD
SEARCH
The variable neighbourhood search (VNS) uses four
different neighbourhood operators. Each operator is
applied to the solution in an iterative process until the
solution is a local optimum with respect to all four
operators. Once the local optimum is reached, all
shifts are un-assigned and the process is repeated.
When the time limit is reached the solution with the
best local optimum is returned.
To make the search space more connected and to
assist the neighbourhood search to reach better local
optima, all constraints except C1, C5 and C9 are
relaxed and made soft constraints but with very high
weights. The search neighbourhood operators are as
follows:
N1: For each shift, try replacing it with a new
shift. When creating the new shift, every possible
start time and shift length is tried and each
combination of three different activities within the
shift is tried.
N2: For each shift, test making it up to 30 minutes
longer or shorter and up to 30 minutes earlier or later
and simultaneously making another shift for the same
employee on a different day up to 30 minutes longer
or shorter and up to 30 minutes earlier or later.
Similarly to neighbourhood 1, it will also test each
combination of three different activities within the
shift
N3: For each day, for each pair of employees, try
swapping the shifts assigned between the two
employees on that day. This is repeated for that day
but also simultaneously swapping over the next x
consecutive days where x is 1..4.
N4: For each shift, try moving it up to one hour
earlier or later and up to 15 minutes shorter or longer
and simultaneously moving another shift for another
employee on the same day up to one hour earlier or
later and up to 15 minutes shorter or longer. When
moving the first shift, it will also test different
combinations of activities within the shift. For the
second shift it will keep the activities within them the
same and the absolute times of the activity changes.
Solving the Multi-activity Shift Scheduling Problem using Variable Neighbourhood Search
229
4 RESULTS
The algorithm was run for 10 minutes on each
instance. The best solution found after 5 minutes and
10 minutes on each instance is listed in Table 1. If no
feasible solution was found in the time allowed, then
the row contains ‘-’. The experiments were conducted
on an Intel Core i5-4690K CPU 3.50GHz.
The VNS method can find feasible solutions for
most of the smaller instances within 5 minutes. An
extra five minutes further improves the solutions on
some instances and results in solutions for some other
instances that could not be solved within 5 minutes.
The larger instances with more staff, more activities
or longer planning horizons appear to be more
difficult to solve and often a feasible solution could
not be found within the time provided.
5 CONCLUSIONS
New benchmark instances have been introduced for
the multi-activity shift scheduling problem. They are
publicly available for download from
www.schedulingbenchmarks.org. A verifier with a
graphical user interface is also available to validate
new results and assist with development. A Variable
Neighbourhood Search that uses four different
neighbourhoods has also been presented. It can find
feasible solutions to the smaller and medium sized
instances in relatively short computation times.
Future research should focus on methods for solving
the larger instances. Data sets which also consider
break scheduling and task scheduling within the shifts
may also be introduced in the future.
REFERENCES
Dahmen, S., & Rekik, M. (2015). Solving multi-activity
multi-day shift scheduling problems with a hybrid
heuristic. Journal of Scheduling, 18(2), 207–223.
Gérard, M., Clautiaux, F., & Sadykov, R. (2016). Column
generation based approaches for a tour scheduling
problem with a multi-skill heterogeneous workforce.
European Journal of Operational Research, 252(3),
1019–1030.
Loucks, J. S., & Jacobs, F. R. (1991). Tour scheduling and
task assignment of a heterogeneous work force: A
heuristic approach. Decision Sciences, 22(4), 719–738.
Pan, S, Akplogan, M., Létocart, L., Touati, N., & Calvo, R.
W. (2016). Solving a Multi-Activity Shift Scheduling
Problem with a Tabu Search Heuristic. PATAT 2016:
Proceedings of the 11th International Conference of the
Practice and Theory of Automated Timetabling, 317–
326.
Pan, Stefania, Akplogan, M., Touati, N., Létocart, L.,
Calvo, R. W., & Rousseau, L.-M. (2018). A hybrid
heuristic for the multi-activity tour scheduling problem.
Electronic Notes in Discrete Mathematics, 69, 333–
340.
Quimper, C.-G., & Rousseau, L.-M. (2010). A large
neighbourhood search approach to the multi-activity
shift scheduling problem. Journal of Heuristics, 16(3),
373–392.
Restrepo, M. I., Gendron, B., & Rousseau, L.-M. (2016).
Branch-and-price for personalized multiactivity tour
scheduling. INFORMS Journal on Computing, 28(2),
334–350.
Restrepo, M. I., Gendron, B., & Rousseau, L.-M. (2018).
Combining Benders decomposition and column
generation for multi-activity tour scheduling.
Computers & Operations Research, 93, 151–165.
Restrepo, M. I., Lozano, L., & Medaglia, A. L. (2012).
Constrained network-based column generation for the
multi-activity shift scheduling problem. International
Journal of Production Economics, 140(1), 466–472.
Salvagnin, D., & Walsh, T. (2012). A hybrid MIP/CP
approach for multi-activity shift scheduling.
International Conference on Principles and Practice of
Constraint Programming, 633–646. Springer.
APPENDIX
Table 1: Results.
Instance Days Staff Tasks 5 mins 10 mins
1 7 10 1 387 387
2 7 10 1 192 176
3 7 10 1 317 317
4 7 10 1 330 328
5 7 10 2 115 115
6 7 20 1 900 900
7 7 20 1 879 818
8 7 20 2 884 884
9 7 20 2 513 500
10 7 20 3 274 268
11 7 30 1 909 844
12 7 30 2 1541 1541
13 7 30 2 1440 1440
14 7 30 3 1476 1469
15 7 30 4 553 553
16 7 40 2 1946 1883
17 7 40 2 1831 1831
18 7 40 3 1737 1737
19 7 40 4 1437 1437
20 7 40 5 990 955
21 7 50 2 1740 1740
22 7 50 3 2646 2646
ICORES 2020 - 9th International Conference on Operations Research and Enterprise Systems
230
Table 1: Results (continue).
23 7 50 4 2446 2446
24 7 50 5 1795 1795
25 7 50 7 - 1344
26 7 60 2 1734 1734
27 7 60 3 2904 2904
28 7 60 4 3276 3248
29 7 60 6 2463 2463
30 7 60 8 - -
31 7 70 3 2574 2574
32 7 70 4 3288 3288
33 7 70 5 3170 3170
34 7 70 7 - -
35 7 70 9 - -
36 7 80 3 2858 2709
37 7 80 4 3335 3335
38 7 80 6 3894 3894
39 7 80 8 - -
40 7 80 10 - -
41 7 90 3 2575 2575
42 7 90 5 4317 4317
43 7 90 6 4971 4877
44 7 90 9 - -
45 7 90 12 - -
46 7 100 4 3471 3471
47 7 100 5 5139 4837
48 7 100 7 5492 5302
49 7 100 10 - -
50 7 100 13 - -
51 7 110 4 3338 3338
52 7 110 6 5084 5084
53 7 110 8 6291 6237
54 7 110 11 - -
55 7 110 14 - -
56 7 120 4 3486 3486
57 7 120 6 5991 5991
58 7 120 8 - 6749
59 7 120 12 - -
60 7 120 15 - -
61 7 130 5 4932 4932
62 7 130 7 - 6720
63 7 130 9 - 7086
64 7 130 13 - -
65 7 130 17 - -
66 7 140 5 4057 4057
67 7 140 7 6009 6009
68 7 140 10 - -
69 7 140 14 - -
70 7 140 18 - -
71 7 150 5 4063 4063
72 7 150 8 - 7590
73 7 150 10 - -
74 7 150 15 - -
75 7 150 19 - -
76 14 10 1 604 598
77 14 10 1 814 814
78 14 10 1 634 634
79 14 10 1 607 607
80 14 10 2 292 292
81 14 20 1 1659 1659
82 14 20 1 1643 1643
83 14 20 2 1387 1387
84 14 20 2 1279 1168
85 14 20 3 520 520
86 14 30 1 1738 1738
87 14 30 2 2672 2672
88 14 30 2 2780 2780
89 14 30 3 2551 2551
90 14 30 4 - -
91 14 40 2 3514 3514
92 14 40 2 3767 3767
93 14 40 3 3942 3820
94 14 40 4 - 3980
95 14 40 5 - -
96 14 50 2 3666 3666
97 14 50 3 4921 4921
98 14 50 4 4802 4802
99 14 50 5 - -
100 14 50 7 - -
101 14 60 2 3419 3419
102 14 60 3 5473 5473
103 14 60 4 5942 5942
104 14 60 6 - 5620
105 14 60 8 - -
106 14 70 3 5137 5137
107 14 70 4 7208 6892
108 14 70 5 - -
109 14 70 7 - -
110 14 70 9 - -
111 14 80 3 - 5510
112 14 80 4 6748 6748
113 14 80 6 - 8124
114 14 80 8 - -
115 14 80 10 - -
116 14 90 3 5715 5598
117 14 90 5 - 8818
118 14 90 6 - -
119 14 90 9 - -
120 14 90 12 - -
121 14 100 4 - -
122 14 100 5 - -
123 14 100 7 - -
124 14 100 10 - -
125 14 100 13 - -
Solving the Multi-activity Shift Scheduling Problem using Variable Neighbourhood Search
231
Table 1: Results (continue).
126 14 110 4 - 7573
127 14 110 6 - -
128 14 110 8 - -
129 14 110 11 - -
130 14 110 14 - -
131 14 120 4 - 7475
132 14 120 6 - -
133 14 120 8 - -
134 14 120 12 - -
135 14 120 15 - -
136 14 130 5 - -
137 14 130 7 - -
138 14 130 9 - -
139 14 130 13 - -
140 14 130 17 - -
141 14 140 5 - 8013
142 14 140 7 - -
143 14 140 10 - -
144 14 140 14 - -
145 14 140 18 - -
146 14 150 5 - -
147 14 150 8 - -
148 14 150 10 - -
149 14 150 15 - -
150 14 150 19 - -
151 28 10 1 1677 1677
152 28 10 1 1509 1509
153 28 10 1 1729 1729
154 28 10 1 1535 1535
155 28 10 2 - -
156 28 20 1 3766 3766
157 28 20 1 3541 3523
158 28 20 2 3327 3327
159 28 20 2 2989 2989
160 28 20 3 - 1803
161 28 30 1 3513 3505
162 28 30 2 - 6551
163 28 30 2 6209 6209
164 28 30 3 - -
165 28 30 4 - -
166 28 40 2 - 7613
167 28 40 2 7317 7317
168 28 40 3 - 8270
169 28 40 4 - -
170 28 40 5 - -
171 28 50 2 7000 6843
172 28 50 3 - -
173 28 50 4 - -
174 28 50 5 - -
175 28 50 7 - -
176 28 60 2 7179 7179
177 28 60 3 - -
178 28 60 4 - -
179 28 60 6 - -
180 28 60 8 - -
181 28 70 3 - -
182 28 70 4 - -
183 28 70 5 - -
184 28 70 7 - -
185 28 70 9 - -
186 28 80 3 - 11181
187 28 80 4 - -
188 28 80 6 - -
189 28 80 8 - -
190 28 80 10 - -
191 28 90 3 - -
192 28 90 5 - -
193 28 90 6 - -
194 28 90 9 - -
195 28 90 12 - -
196 28 100 4 - -
197 28 100 5 - -
198 28 100 7 - -
199 28 100 10 - -
200 28 100 13 - -
201 28 110 4 - -
202 28 110 6 - -
203 28 110 8 - -
204 28 110 11 - -
205 28 110 14 - -
206 28 120 4 - -
207 28 120 6 - -
208 28 120 8 - -
209 28 120 12 - -
210 28 120 15 - -
211 28 130 5 - -
212 28 130 7 - -
213 28 130 9 - -
214 28 130 13 - -
215 28 130 17 - -
216 28 140 5 - -
217 28 140 7 - -
218 28 140 10 - -
219 28 140 14 - -
220 28 140 18 - -
221 28 150 5 - -
222 28 150 8 - -
223 28 150 10 - -
224 28 150 15 - -
225 28 150 19 - -
ICORES 2020 - 9th International Conference on Operations Research and Enterprise Systems
232