• No results found

Rostering from staffing levels:

N/A
N/A
Protected

Academic year: 2021

Share "Rostering from staffing levels:"

Copied!
103
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

Rostering from staffing levels:

a Branch-and-Price approach

Egbert van der Veen

Master thesis in Business Mathematics

May 2009

First supervisor: Prof. dr. S. de Vries

(2)
(3)

Abstract

In this thesis a method to solve personnel rostering problems is outlined. The method discussed creates rosters directly from staffing levels and employee pref-erences. This opposed to lots of other rostering methods that first create shifts based on the staffing levels and after that create rosters from the set of created shifts. Via an example it is stressed that this ‘two-step’ approach is suboptimal and sometimes even unable to find a solution. To create rosters directly from staffing levels and employee preferences we modelled the rostering problem as a Branch-and-Price problem.

(4)
(5)

Acknowledgements

I wish to thank the many people that made this thesis possible.

First, I wish to thank Sven de Vries for his role as first supervisor, his guidance and very useful support. He provided me with very useful insights in Branch-and-Price models. Without these, the Branch-and-Price model de-scribed in this thesis would not have been there.

Furthermore, I like to thank Arjan van der Schaft for his role as second supervisor, and for being always available at the moments I needed him.

Next, I wish to thank Bart Veltman and my other colleagues at ORTEC for making this project possible. Bart’s enthousiasm and support, and the open culture of ORTEC were a great support in this project.

I wish to thank Tobias Achterberg and the SCIP team for developing this wonderful piece of software. Without it I would not have been able to test and implement the method developed in this thesis.

I also wish to thank my fellow Business Mathematics students for the won-derful time we had studying together.

Last, but certainly not least, I like to thank my parents and my girlfriend Sanne for their unconditioned support.

Enjoy the reading.

Egbert van der Veen Gouda, May 2009

(6)
(7)

Contents

1 Introduction 1 1.1 ORTEC . . . 2 1.2 Harmony . . . 2 1.3 Thesis outline . . . 2 2 Problem description 3 3 Literature survey 7 3.1 Overview articles . . . 7 3.2 Shift rostering . . . 7

3.3 Staffing and shift scheduling . . . 8

3.4 Conclusions . . . 9

4 Solution methods 11 4.1 Classic method . . . 11

4.2 Integer linear programming . . . 12

4.3 Shift templates . . . 12

4.4 Column generation . . . 13

4.4.1 Linear programming theory . . . 14

4.4.2 Pricing problem . . . 15

4.4.3 Branch-and-Price . . . 18

4.5 Conclusions . . . 19

5 Problem definition and theoretical analysis 21 5.1 Modelling assumptions . . . 21

5.2 Mathematical problem definition . . . 22

5.3 Complexity . . . 23

5.3.1 Consecutive working periods, single skill . . . 24

5.3.2 Consecutive working periods, multi-skill . . . 26

5.3.3 Multi-shift rostering . . . 28

5.4 Conclusions . . . 29

6 Modelling 31 6.1 Integer linear programming model . . . 32

6.1.1 Modelling rest periods . . . 35

6.2 Branch-and-Price . . . 36

6.2.1 Example . . . 37

6.2.2 Solution approach . . . 39

(8)

vi CONTENTS

6.2.3 Initialisation of the master problem . . . 41

6.2.4 Pricing problem . . . 42

6.2.5 Branching . . . 46

6.3 Comparison of both methods . . . 49

6.3.1 Theoretical comparison of the formulations . . . 50

6.4 Conclusions . . . 53

7 Software implementation 55 8 Results 59 8.1 Random demand . . . 60

8.2 Number of experiments . . . 62

8.3 Comparing SCIP and CPLEX . . . 63

8.3.1 Shift length and skills . . . 63

8.3.2 Number of periods . . . 65

8.3.3 Number of employees . . . 67

8.4 Some SCIP results . . . 68

8.5 Conclusions . . . 70

9 Conclusions and recommendations 73 10 Bibliography 75 A Nomenclature 77 B Graph theory and total unimodularity 79 C Branching 81 D Computational results 83 D.1 Shift length and skills . . . 83

D.1.1 CPLEX results . . . 83

D.1.2 SCIP results . . . 84

D.1.3 Comparison of CPLEX and SCIP . . . 86

D.2 Time horizon . . . 88

D.2.1 CPLEX results . . . 88

D.2.2 SCIP results . . . 88

D.2.3 Comparison of CPLEX and SCIP . . . 88

D.3 Number of employees . . . 90

D.3.1 CPLEX results . . . 90

D.3.2 SCIP results . . . 90

D.3.3 Comparison of CPLEX and SCIP . . . 90

(9)

Chapter 1

Introduction

All companies, whether they are large or small, have to deal with the problem of rostering their personnel. For example, railway companies need to roster train drivers, ticket inspectors, train-traffic-controllers, technicians and cleaning per-sonnel. Other examples are hospitals, where nurses, anaesthetists, surgeons, and specialists need to be rostered; and supermarkets that need to roster cashiers, re-stockers of shelves, and ‘specialists’ for dairy products, vegetables and meat products.

For some companies the rostering of their personnel is relatively easy. For instance for a small shop with only a couple of employees, or for an office where employees are working from 9 AM until 5 PM. But for many companies, even when the number of employees is rather small, it often is not an easy task to create a roster, let alone to create a good one.

Let us look at an example, concerning the rostering of personnel at super-markets. Even though the number of employees at a supermarket is relatively small, in comparison with e.g. a hospital or a large manufacturing company, the rostering is already quite complex. First of all, there should be sufficient emplo-yees available at any moment in time. Next to this, emploemplo-yees with certain skills need to be available at specific moments in time. For instance for dairy products, vegetables and meat products certain skills/certificates are required. Not every employee will possess skills for one or more of these tasks, and this has to be accounted for when creating the roster. Making sure that there are enough employees with the right skills available is, of course, very important, but while doing this, one also has to deal with employee preferences and un-availabilities. For example, preferences for days or hours at which an employee likes to work and days at which an employee is strictly unavailable, for example when the employee has a holiday. Furthermore, working time regulations have to be taken into account, and probably employees do not like to work ‘broken’ shifts, i.e. shifts where the working periods on one day are separated by one or multiple long breaks.

From the above example it is easy to imagine that creating a roster that meets demand, and also accounts for employee preferences is for most companies not at all an easy task.

In the past decades a lot of research has been done on how to create good

(10)

2 1. Introduction

rosters, both from a practical as well as from a mathematical point of view. For instance, good spreadsheets and software packages have become available to ease the rostering process. Although a lot can be said on the practical side of rostering, the focus of this thesis is on the mathematical point of view.

Before a general problem description is discussed, a brief description of ORTEC is given, the company that came up with the problem studied in this thesis. Next to this, a brief description of the workforce planning software ap-plication ORTEC Harmony is given.

1.1

ORTEC

ORTEC is one of world’s largest providers of advanced planning and optimisa-tion soluoptimisa-tions. ORTEC concentrates mainly on the following four areas: Work-force Scheduling, Verhicle Routing & Dispatch, Pallet & Load Building and Fi-nancial Planning. Founded in 1981, ORTEC currently has over 700 employees and offices in Europe and North America. By combining Operations Research with modern IT techniques, ORTEC helps customers solving different types of planning problems. ORTEC works for a very diverse group of customers. For ex-ample, ORTEC works for hospitals, oil refineries, airline companies, transporta-tion companies, insurance companies, pension funds and governments. The major part of ORTEC’s work can be divided into, on the one hand, offering off-the-shelf software for, for example, crew rostering, transportation planning and load space optimisation. On the other hand, ORTEC also delivers tailor-made solutions to customer specific problems.

1.2

Harmony

For dealing with and solving of rostering problems, ORTEC offers the advanced workforce planning software called Harmony. The personnel rostering func-tionality of Harmony supports the creation of tasks and shifts, the generation of rosters, the assignment of workstations, vacation planning and determining cyclical rosters. While doing this, Harmony takes employee preferences, em-ployee qualifications and labour legislation into account. All of this can be done with the aid of advanced optimisation engines.

1.3

Thesis outline

(11)

Chapter 2

Problem description

Commonly, a roster is created as follows. In the first step, the ‘Staffing’ step, staffing levels c.q. tasks are derived from the predicted workload. Staffing levels represent the number of employees that needs to be present per skill per unit of time (e.g. 15 minutes). Tasks are specific operations that need to be performed by an employee, but for which the time interval is not necessarily fixed. From the staffing levels/tasks shifts are determined in the ‘Shift scheduling’ step. This set of shifts has to cover the work that has to be done, and that of course, preferably, as efficient as possible. Furthermore, the created shifts have to meet working time regulations. When the set of shifts has been generated, rosters are created from this in the so-called ‘Shift rostering’ step. In this step, shifts are assigned to personnel, considering all kinds of constraints on working time regulations, and employee preferences. Examples of employee preferences include preferences for days off, preferences for shift types (morning, afternoon, evening, night), but also include employees unavailabilities. This ‘classic’ rostering method is schematically depicted in Figure 2.1.

Workload prediction

Staffing

levels/tasks Rosters

Working time

regulations Employee preferences

Staffing Shift rostering Shift scheduling Shifts

Figure 2.1: ‘Classic’ rostering

As can be observed from Figure 2.1, and is also described above, working time regulations play a role both when creating shifts and when creating rosters, but employee preferences only come in when creating rosters. This last point is one of the greatest downsides of the ‘classic’ rostering method. Let us look at an example to illustrate this.

(12)

4 2. Problem description

Suppose the staffing levels, employee characteristics and employee prefe-rences are as follows:

Staffing levels: between 7 AM and 7 PM, at any moment one employee has to be on duty

Employees: 1 fulltimer (F), working 8 hours a day 1 parttimer (P), working 4 hours a day Employee preferences: F: likes to be off duty after 3 PM on Tuesdays

P: likes to be off on Monday and Wednesday af-ternoons

If employee preferences are not taken into account when creating the shifts, then it is quite possible that the following shifts are created:

Day: starts at 7 AM finishes at 3 PM

Late afternoon: starts at 3 PM finishes at 7 PM

However, with these shifts no roster can be created that takes the employee preferences into account, because the parttimer has to work monday and wednes-day afternoon, when he likes to be off. If rosters are created directly from staffing levels and employee preferences then the following roster can be created:

Fulltimer: Mondays and Wednesdays from 11 AM until 7 PM Tuesdays, Thursdays and Fridays from 7 AM until 3 PM Parttimer: Mondays and Wednesdays from 7 AM until 11 AM

Tuesdays, Thursdays and Fridays from 3 PM until 7 PM Now, a roster is obtained where employee preferences are taken into account. Hence, in the example it is illustrated that when creating ‘bad’ shifts in the shift scheduling step, no roster can be created in the shift rostering step that takes employee preferences into account. However, when a roster is created directly from staffing levels and employee preferences we can get a roster that meets both the staffing levels and employee preferences. This way of rostering is illustrated by Figure 2.2. Workload prediction Staffing levels/tasks Rosters Working time

regulations Employee preferences

Staffing Shift rostering Shift scheduling Shifts

Figure 2.2: ‘New’ rostering

(13)

Problem description 5

The main objective of this thesis, for which the need is illustrated by the above exampe, is formulated as follows:

Develop a method that creates rosters directly from staffing levels, i.e. without the intermediate step of shift scheduling, while keeping working time regulations and employee preferences into account.

It is important to note that only creating rosters from staffing levels is con-sidered in this thesis, because creating rosters from tasks is a different problem. The major difference is that tasks are indivisible, i.e. the whole task has to be covered by one person. For instance, when a task has to be done between 8 AM and 10 AM, it is, usually, not allowed to have one employee on it working from 8 AM to 9 AM and another employee working on it from 9 AM to 10 AM. On the contrary, in the case of staffing levels, when need an employee needs to be present between 8 AM and 10 AM it is allowed that there are two (or more) employees covering this time slot. Another difference is that tasks are not always fixed in time. Hence, the exact time windows in which work has to be done are not always fixed when rostering tasks. However, when creating rosters from staffing levels the amount of employees needed at any moment in time is exactly known.

(14)
(15)

Chapter 3

Literature survey

This chapter gives an overview of relevant literature on rostering. First, an interesting overview article is discussed. Next, some literature on the shift rostering subproblem is surveyed. After that, a couple of interesting articles on staffing and on shift scheduling are discussed. Both these topics have received significantly less attention in the literature than shift rostering has. The chapter is concluded with some general remarks and conclusions.

3.1

Overview articles

Burke, De Causmaecker and Vanden Berghe (2004) survey many papers written on the personnel rostering problem in healthcare. First, they give a general de-scription of the nurse rostering problem. After this, they look at some subjects that play an important role in the nurse rostering problem, for example the staffing of nurses and cyclical rostering. However, the major part of their article is about articles that discuss solutions methods to (parts of) the nurse rostering problem. The main conclusion the authors draw from these articles is that “ex-act solution methods are not an option in pr“ex-actise for nurse rostering, because they cannot cope with the enormous search space for real life instances”. Never-theless, exact solution methods do create a good starting point for creating and improving heuristic methods. As Burke et al. state, “The current state of the art in nurse rostering is represented by interactive approaches which incorporate problem specific methods and heuristics, together with powerful metaheuristics, constraint based approaches, and other search methods”.

3.2

Shift rostering

The fundamentals of the mathematical approach to the rostering of personnel lie with G.B. Dantzig in his famous ‘A Comment on Eddie’s “Traffic Delays at Toll Booths”’, Dantzig (1954). In this article Dantzig comes up with a generalised set covering method as a mathematical solution method to the shift rostering problem. Dantzig assumes a number of shift patterns are given. A shift pattern is a sequence of zeros and ones, where a one indicates a working period and a zero indicates an off period. The problem to be solved is then how many employees to assign to each pattern such that the demand for work is met.

(16)

8 3. Literature survey

This paper by Dantzig was the first of numerous other articles written on shift rostering. The articles in the remainder of this section are just a few interesting ones.

One of the first papers on implementing shift rostering methods for the ros-tering of nurses, which also copes with employee preferences, is written by Smith and Wiggins (1977). They use a number of predefined shift patterns and give each pattern an employee specific weight to cope with employee preferences. However, due to their strong practical point of view (and their 1977 hardware), they chose a relatively simple heuristic solution method to keep it computation-ally tractable.

Another early article is written by Henderson and Berry (1976) that discusses both shift scheduling and shift rostering. The shift scheduling part of the article is discussed in Section 3.3. For shift rostering, Henderson and Berry describe a couple of heuristics. Their first heuristic solves a linear programming relaxation of the problem first, after which all fractional variables are rounded up. In this way, a feasible solution for the shift rostering problem is obtained. After this, they reduce each variable at a positive level, one by one, by one unit. If no constraints are violated they keep this solution, otherwise the variable value is set to its previous value. This is continued until all variables are checked. A second, local search, heuristic starts with the solution of the first heuristic and tries to improve the solution by exchanging operators between shifts. If some kind of theoretical minimum (derived from the linear programming formulation) is met, the heuristic terminates.

A nice method for dealing with constraints in a hierarchical way is described by Meyer auf ’m Hofe (1997). Constraints are assigned a priority and a weight. Constraints of higher priority are always more important than all constraints of lower priority together, i.e. the method rather violates all constraints of lower priority than a single constraint of higher priority, even if the total weight of the lower priority constraints is far larger than the weight of the single higher priority constraint. Within a priority class a constraint has a weight and the cumulative weight of the violated constraints in a priority class is to be minimised. Note that for our method it is also important to make sure that staffing levels and employee unavailabilities are dealt with first and employee preferences are dealt with afterwards.

The solution method described by Meyer auf ’m Hofe (1997) consists of a global optimisation method that is applied first and a local search method, which attemps to make local improvements. From a practical point of view it is good to note that this method is applied in various real life settings.

3.3

Staffing and shift scheduling

As already mentioned, literature devotes much less attention to staffing and shift scheduling than to shift rostering. This section discusses three interesting articles on the subject of staffing and shift scheduling.

(17)

Conclusions 9

this article is devoted to shift scheduling. In this article, the authors assume that one has a master set of shifts. From this a small working subset of shifts is selected that is used to create a roster. Henderson and Berry (1976) describe two different heuristic methods for creating this subset. The first heuristic, the so-called Maximum Difference Heuristic, starts with selecting an arbitrary shift from the master set. After this, the subsequent shifts are selected, in such a way that the difference between the covered time periods between this shift and the already selected shifts is maximised. The second heuristic, the so-called Random Selection Heuristic, selects shifts at random from the master set. Remarkable to note is that, when the working subset becomes larger (in Henderson and Berry’s case larger than 40), the Random Selection Heuristic does not perform significantly worse in solution quality than the Maximum Difference Heuristic. Of course, the amount of time required for the selection of the working subset for the Random Selection Heuristic was far less than for the Maximum Difference Heuristic. This is something to keep in mind when creating shifts.

Another interesting method is outlined by Pot (2006) in Chapter 9 of his Ph.D. thesis. Pot describes an integrated method for solving staffing and shift scheduling. According to Pot the objective functions for staffing and shift scheduling often conflict with each other. Meeting the service level can eas-ily be reached by rostering (lots) of personnel. However, this leads to high personnel costs. Having less employees on duty leads to lower personnel cost, but may compromise the service-level constraints. Pot claimes that in literature this problem is usually circumvented by minimising the personnel costs under constraints on capacity. To overcome this problem, Pot comes up with two methods that integrate staffing and shift scheduling.

The first integrated method Pot describes and solves is the staffing and shift scheduling question for the case where no desctinction between shifts is made. For this problem he formulates an ILP model, where a constraint makes sure that the average number of customers that has to wait less than the Average Waiting Time (he applies his model to a call-center) is greater than or equal to a user-defined fraction of the arrival rate. The to be used shifts are selected from a master set of shifts.

Next to this integrated method for single skill rostering, Pot also describes one of the few (as Pot claims) methods for solving multi-skill shift scheduling by means of a network flow formulation. Furthermore, Pot creates a simpli-fied assignment model that approximately solves the multi-skill shift scheduling problem.

3.4

Conclusions

This chapter discussed some literature on rostering and on some important subclasses of the general rostering problem. Especially the shift rostering sub-problem received a lot of attention in literature, and several articles outline useful methods to solve it, both from a practical and from a theoretical point of view.

(18)

10 3. Literature survey

(19)

Chapter 4

Solution methods

This chapter describes several methods that can be used to solve the problem of “directly creating rosters from staffing levels”. This chapter starts with the classic two-step method that was already discussed in Chapter 2. After that, a linear programming approach is discussed. Furthermore, rostering from shift templates and rostering via column generation is discussed.

4.1

Classic method

Chapter 2 described the classic method for solving personnel rostering problems. A major downside of this method is illustrated by an example in Chapter 2. Although a roster can be created, which satisfies staffing levels and employee preferences, the classic method is unable to find it. However, the classic method has of course also some positive aspects. For instance, this method splits one larger problem into two smaller subproblems: the shift scheduling and shift rostering method. Solving these smaller subproblems is easier. In the shift scheduling step, employee preferences are not taken into account. This allows the model to ‘focus’ on finding the cheapest set of shifts that meets the staffing levels, without having to consider employee preferences. Furthermore, in the shift rostering step ‘only’ the shifts created in the shift scheduling step have to be rostered. Of course, working time regulations have to be met strictly and employee preferences as good as possible. However, in this case no selection of shifts (that meets staffing levels) from a master set has to be done, which reduces the problem dimensions considerably.

Caprara, Monaci and Toth (2001) describes a method for iteratively solving the shift scheduling and shift rostering step for the rostering of train personnel. Note that this is a task rostering method, where tasks have to be rostered instead of staffing levels that have to be met. So, the shift scheduling and shift rostering method are called pairing1 optimisation and roster optimisation respectively.

In short, the method in Caprara et al. (2001) works as follows. Initially each pairing is assigned a certain cost cj. For pairings j that includes an external rest

cj = 2 and for pairings that do not cj is set to 1. Next, a set covering problem

is solved to select the to be rostered pairings. After this, an adjustment to the

1A pairing is a combination of trips, which can be compared to a combination of tasks into

a shift.

(20)

12 4. Solution methods

cj’s is made with the aid of optimal values (or, actually, theoretical bounds)

from the roster optimisation phase. By increasing the cj’s of bad pairings, these

pairings will be forced out of the solution. Then, with the ‘new’ cj’s again the

pairing optimisation is solved, and after that again the roster optimisation is solved, and so on. This is repeated, until a certain time limit has been reached or the solution is less than a certain percentage away from some theoretical bound.

Although the method in Caprara et al. (2001) seems nice, it cannot easily be used to solve our problem. Since the roster optimisation phase of Caprara et al. (2001) minimises the number of days (or weeks) the crew needs to work all pairings generated in the pairing optimisation phase, the roster optimisation phase always has a solution. In our case, however, all shifts have to be rostered in a given time period (e.g. a week or a month). Therefore, it may happen that the shifts generated in the shift scheduling step cannot be rostered into a roster. Because the shift rostering problem is NP-hard2, it is, in general, provable hard

to find a single solution. Therefore, in general, we cannot be sure that the infeasibility of the shift rostering step is due to the fact that the shift scheduling step came up with ‘bad’ shifts, or that the rostering problem is infeasible.

Of course, the observant reader notices that the roster optimisation phase of the problem of Caprara et al. (2001) is also NP-hard (it is not too hard to reduce 3-PARTITION to it3). However, Caprara et al. (2001) discovered a nice method (for their problem) to iteratively solve the different problems. For the shift scheduling and shift rostering problems such a method is not readily available, at least none that we know of, and possibly it does not even exist. Therefore, we are not going to spent effort on this.

4.2

Integer linear programming

Of course, it is worthwile to just model the problem as a (huge) integer linear programming (ILP) model. Probably this is a (very) large model and solving it might not be numerically tractable anymore for reasonable problem dimensions. However, modelling the problem this way might give insight in how heuristics or approximate methods could be applied. An ILP formulation of the rostering problem is described in Section 6.1.

4.3

Shift templates

A nice method for rostering from requirements and prefences, both from theo-retical and practical point of view, is rostering via shift templates. With this method, only shifts from a predefined set of ‘template’ shifts may be used to create a roster. Hence, the shifts that can be used for creating the rosters can be predefined. Furthermore, the computation time is also reduced, because not all possible shifts have to be considered.

To create rosters from shift templates, Keith (1979) discusses the basic model

2For a definition of NP-hardness and NP-completeness the reader is referred to Garey and

Johnson (1979).

3For a description of 3-PARTITION the reader is referred to, e.g., Lenstra and Rinnooy

(21)

Column generation 13 min X j cjxj s.t X j ajtxj ≥ dt ∀t (4.1) xj ≥ 0, integer ∀j

In this model xj represents the number of employees working shift template

j, cj denotes the cost costs of one employee working shift template j and ajt

indicates wether period t is a working period for template j (ajt = 1) or not

(ajt= 0). Finally, dtdenotes the number of employees that should be working

during period t. Solving model (4.1) creates a roster via shift templates.4

However, the method of Keith (1979) does not cope with employee prefer-ences. Via a straightforward extension, as is done by Dowsland and Thompson (2000), this can be accomplished. Dowsland and Thompson introduce employee specific cost for each shift template, i.e. the objective function of model (4.1) is replaced by minX i X j cijxij

Where xij = 1 if employee i works shift template j and xij = 0 otherwise.

The parameter cij denotes the cost of employee i working shift template j. Next

to this, Dowsland and Thompson also introduce a nice method that calculates, via solving a knapsack problem, whether there are enough employees to cover the workload. After this, rosters are created via a rostering method as described in Dowsland (1998).

The method presented by Dowsland (1998) is a tabu search method that creates nurse rosters. In short, tabu search is a local search method that jumps from a given solution to neighbouring solutions, while remembering the best solution found so far. Next to this, already visited solutions are declared as being ‘tabu’. The method of Dowsland (1998) assigns shift patterns (i.e. a sequence of day and/or night shifts). During this assignment the method assures that all shifts are covered and there are enough nurses of a certain ‘grade-band’ available at any moment in time. Nurse preferences are dealt with by assigning costs to each nurse-template pair5, like we described above.

A lot more can be said on rostering via shift templates, but the above de-scription will be sufficient for now. We do however like to make the reader once more aware of the nice practical and theoretical properties of rostering via shift templates, as already mentioned at the beginning of this section.

4.4

Column generation

Before the column generation technique is described, first some linear program-ming theory is discussed. It is assumed the reader is familiar with basic linear algebra.

4Note that model (4.1) is a generalised set covering problem.

(22)

14 4. Solution methods

4.4.1

Linear programming theory

From standard linear programming theory, see Chv´atal (1983), it is known that if the primal model (P) is given by

min cTx

s.t. Ax ≥ b (P)

x ≥ 0 the dual model (D) is given by

max bTy s.t. ATy ≤ c (D) y ≥ 0 where c ∈ Rn , x ∈ Rn , A ∈ Rm×n , b ∈ Rm and y ∈ Rm.

If the primal problem has an optimal solution, then the dual problem has one and the values of the objective functions are equal. This holds because

min{cTx : Ax ≥ b, x ≥ 0} ≥ max{bTy : ATy ≤ c, y ≥ 0} (4.2) if there exists a pair x, y satisfying the constraints of (P) and (D) respectively. This follows from the fact that for any pair x, y satisfying the constraints in the above models it holds that

cTx ≥ (ATy)Tx = yTAx ≥ yTb = bTy

Next to the solution of the primal and/or the dual problem, one is often in-terested in so-called shadow prices and shadow costs. The rate at which the objective value would change for sufficiently small perturbations of the right hand side of the constraints, which is represented by b in the primal model and by c in the dual model, is called the shadow price of the constraint. Further-more, shadow costs are defined as the rate at which the objective value changes for sufficiently small pertubations of the right hand side of the nonnegativities. In literature, shadow costs are often called reduced costs.

From duality theory a couple of beautiful relations between shadow prices in the primal model (c.q. reduced costs) and variables in the dual model can be shown, see e.g. Sierksma (2002), Chapter 4. First, when the primal problem has a nondegenerate optimal solution, the shadow price of any constraint exists and equals the optimal value of the dual variable corresponding to the constraint. Secondly, when the primal problem has a nondegenerate optimal solution, the reduced cost of any nonnegativity exists and is related to the optimal value of the dual slack variable corresponding to this constraint. Where ‘related’ means that the reduced cost either equals the actual optimal value or the negation of the optimal value of the dual slack variable. This depends on the way the slack variables are defined. Normally, slack variables are defined as the nonnegative difference between the right hand side and the left hand side of a constraint. When including slack variables in the primal model (P) we get

min cTx

s.t. Ax − Imxs= b (P’)

(23)

Column generation 15

where Im denotes the m × m identity matrix and xs denotes the m-vector of

primal slack variables. When including slack variables in the dual model (D) we get

max bTy

s.t. ATy + Inys= c (D’)

y, ys≥ 0

where In denotes the n × n identity matrix and ysdenotes the n-vector of dual

slack variables.

The negative sign of the slack variables in model (P’) causes that the re-duced costs of the nonnegativities in model (D) correspond to the negation of the optimal values of the slack variables in (P’). The reduced costs of the non-negativities in model (P) correspond to the actual value of the slack variables in (D’), because in (D’) the slack variables have a positive sign.

The above rehearsal is sufficient in order to explain the column generation method, which is the main topic of the next section.

4.4.2

Pricing problem

In general, solving linear programs is an easy task. Interior point methods are polynomial time methods and therefore solve linear programs, at least in theory, efficiently. However, one can come up with examples where the technology matrix A is very huge (in dimension). In these cases solving the linear program directly might take too long or might even be impossible. A popular method to deal with such cases is the column generation method. It was first applied by Gilmore and Gomory (1961) to the cutting stock problem. We will illustrate the column generation method by applying it to an example of the cutting stock problem.

Suppose we have a company producing rolls of paper. These rolls are pro-duced with a standard width of, say, 100 centimetres (cm). These rolls have to be cut into subrolls of smaller width, according to customer demand. The question is how to do this efficiently, i.e. how to do this in such a way that the total waste is as small as possible. For example, when there is demand for one roll of 40 cm width and one roll of 55 cm width, this can be cut out of one roll and the waste is only 5 cm. However, when it is done inefficiently these two rolls are cut out of two standard rolls. In this case the waste is 105 cm. For large cutting stock problems it is easy to imagine that the number of cutting patterns can be very large and that it is important to select ‘good’ patterns.

For solving general cutting stock problems the following mixed integer linear programming formulation is used, where the products (paper rolls of different widths) are labelled by i = 1, . . . , m and the cutting patterns by j = 1, . . . , n.

(24)

16 4. Solution methods

In this model xj denotes the number of rolls that are cut according to pattern

j, Aij the number of widths i in cutting pattern j and dithe demand for width

i.

When m is relatively small it is possible to enumerate all possible cutting patterns. However, for more extensive orders, the number of different cutting patters could increase to millions (and more). Enumerating all cutting patterns in such a case would be a lot of work. Therefore, Gilmore and Gomory (1961) came up with the column generation method. In short, this method only gen-erates those columns (cutting patterns) that are used in the optimal solution.

Now, the column generation method starts with an initial set of columns. If we denote the standard width by W and the width of product i by wi then a

good starting point would be to define pattern j to cut  W

wi



times product i out of a roll. In this notation bxc denotes the floor function, which returns the largest integer smaller than or equal to x. Because all products can be cut with these patterns, model (4.3) can be solved. Now, take the linear relaxation of model (4.3), i.e. drop the integrality constraint, and solve the dual problem. From the solution of the dual problem we can derive the reduced costs, which are in this case defined by

δj = cj− ATjy

= 1 − ATjy

where y denotes the vector of dual variables corresponding to the constraints in model (4.3). Because we have a minimisation model, only when δj < 0

it is profitable to increase the right hand side of the nonnegativity xj ≥ 0.

This means it is profitable to add column j/cutting pattern j to the set of columns/cutting patterns. Mere logic dictates that we first add the column with the most negative reduced cost to the set of columns we already have. This column can be found by solving an unbounded knapsack problem6, which

is formulated as follows min 1 − n X i=1 yizi s.t. n X i=1 wizi ≤ W (4.4) zi≥ 0, integer i = 1, . . . , n

This ‘column generation’ problem (4.4) is commonly called the subproblem or pricing problem7, and problem (4.3) the master problem. To solve unbounded

knapsack problems there exist good, pseudo-polynomial time, dynamic pro-gramming methods. We will describe such a method for the following knapsack problem

6In an unbounded knapsack problem there is no restriction on the number of selected items

of any type. For a description of the knapsack problem we refer the reader to, e.g., Chv´atal (1983).

(25)

Column generation 17 max n X i=1 pixi s.t. n X i=1 cixi≤ C (4.5) xi≥ 0, integer i = 1, . . . , n

where pi is the profit of putting item i in the knapsack, ci (> 0) the integral

capacity item i takes and C the integral capacity of the knapsack. Note that the objective functions of (4.4) and (4.5) are equivalent.

Now, we create a recursive formulation that solves the unbounded knapsack problem. Let f (m) denote the optimal objective function value for a knapsack with capacity m. Logically, f (m) is undefined for m < 0 and f (0) = 0. Now, we can recursively calculate f (m) for m > 0 as follows

f (m) = max

i=1,...,n{pi+ f (m − ci)} (4.6)

It is not too hard to see that this method determines an optimal solution. For a knapsack with capacity 1 it is clearly optimal. Next to that, assume for all l < m, the values of f (l) obtained via (4.6) are optimal. Now, if we want to add item i to a knapsack of capacity m, we should use the optimal knapsack of capacity m − ci found already extended with item i. By taking the maximum

as in (4.6) we add the item to the knapsask that could be added best. Hence, the recursive formulation in (4.6) solves the unbounded knapsack problem to optimality. Via (4.6) we obtain f (C), which is the optimal solution to our problem.

The quality of an algorithm is commonly examined by determining the total number of arithmic steps it needs to take before producing the final (and opti-mal) solution. One arithmic step can for example be an addition, a substraction or a comparison. However, please note that formally determining the quality of an algorithm takes much more than just looking at the total number of arithmic steps. The field of science that is concerned with this is the so-called Complexity Theory.

Now, in each step of the recursive formulation of (4.6) n subtractions, n additions and n comparisons are done, so in total 3n arithmic operations per step. Furthermore, we have C such steps. Hence, for the total number of steps, f (n, C), we have

f (n, C) = O(nC)

where f (n) = O(g(n)) if and only if there exist positive constants c and n0such

that f (n) ≤ cg(n) for n ≥ n0.

(26)

18 4. Solution methods

algorithm for the knapsack problem is not polynomial, because it needs to be bounded in the problem dimension for it to be polynomial, whereas it is only polynomial in n and the value of C. Algorithms that are polynomial in the values of the input are called pseudo-polynomial algorithms. In general these algorithms can be implemented somewhat efficiently for moderate C.

Now, when the column produced by the pricing problem is added to the master problem, the dual of the master problem is solved again. After this, we check whether there are other columns that could be added to the master problem by again solving the pricing problem. This process is repeated until no more profitable columns can be found. When the initial problem does not con-strain any of the variables to be integral, this method determines the optimum. However, this method need not be optimal if we do have integrality constraints on the variables. Moreover, it is quite possible there is not even a feasible inte-ger solution among the columns found. For solving inteinte-ger linear programs the Branch-and-Price method can be applied. This method is discussed in the next section.

4.4.3

Branch-and-Price

A popular, and well-known, method for solving integer linear programs is the Branch-and-Bound method. This method first solves the linear programming relaxation of the original problem. If the obtained solution is integral the method stops, otherwise, so-called branching decisions are made. These decisions divide the solution space into subspaces of the solution space, whose union covers the (integral part of the) solution space. This procedure is called branching, since recursive application of it defines a tree structure, where the subspaces are called nodes. Next to the branching, bounds are computed. This can be upper and/or lower bounds that are calculated in the nodes and are used to discard other nodes. For instance in a minimisation problem, if some node has a lower bound greater than an upper bound of some other node, it can be discarded from the search, because we can never find a better solution in the first node than in the second. This is called fathoming. For minimisation problems, the optimal objective function values of the linear programming relaxations are commonly used as lower bounds. Note that the solution space of the relaxation is a superset of the solution space of the original problem. Hence, the optimal objective value of the relaxation is a lower bound. For calculating upper bounds in a minimisation problem special purpose methods can be used, but the objective function value of an already obtained integer solution clearly is an upper bound on the optimal (integer) solution. Together with lower bounds this can be used for fathoming. Note that the same can be done for maximisation problems. In a maximazation setting the LP relaxation is an upper bound and an already obtained integer solution is a lower bound on the optimal solution. Of course, the maximisation problem can also be solved as a minimisation problem. To do this simply negate the objective function of the maximisation problem.

(27)

Conclusions 19

such that it cannot always be used for larger problems. DFS is likely to obtain an integer solution fast that can then be used for fathoming. This approach requires less memory, but on average it needs more time to find an optimal solution. Of course, next to these two branching schemes, other alternatives exist.

In integer linear programs where it is not possible to generate the whole technology matrix, one can apply column generation, as outlined in Section 4.4.2. As mentioned in the Section 4.4.2, when no columns need to be added anymore (for the relaxed problem), the solution of the relaxed master problem need not be integral. Moreover, there might not even be an integral solution to the master problem among the columns found, which is illustrated by an example in Section 6.2.5. Hence, generating all columns with profitable reduced cost and, after that, applying branch-and-bound with the columns found, does not necessarily produce an integer solution.

An often applied method for integer linear programs where it is not possi-ble to generate the whole technology matrix is the so-called Branch-and-Price method. The Branch-and-Price method creates branches where in each node column generation is performed, and possibly also bounds are calculated. The column generation part that is applied in each node is commonly called the pricing problem.

Although Branch-and-Price seems to be a nice method it is not always pos-sible to implement it in an efficient way. First, the pricing problem may be very inefficient. In Section 4.4.2 we modelled the pricing problem as a knapsack problem, which is only pseudo-polynomially solvable. One could imagine that for other problems the best one could come up with for the pricing problem is an NP-hard problem. Secondly, it is important to be able to incorporate branching decision into the pricing problem. This is not always an easy task, if not an impossible one.

4.5

Conclusions

(28)
(29)

Chapter 5

Problem definition and

theoretical analysis

This chapter starts with the modelling assumptions. After that, a formal math-ematical problem definition is presented. Next, the computational complexity of three special cases of the rostering problem are discussed. There we prove the rostering problem to be NP-complete. The chapter concludes with some general remarks and conclusions.

5.1

Modelling assumptions

As with every modelling of real life situations, one has to make some assump-tions. Not everything can be modelled and not every detail necessarily needs to be modelled. Next to that, assumptions can be useful in order to decrease the problem size and to keep the problem from becoming too complicated.

• For our modelling it is assumed that there are no constraints in between shifts. This can be compared, to some extent, to a company where work is done only during daytime. Hence, we do not have any constraints linking work-periods between different days.

• Staffing levels have to be met for every skill and every period; • An employee can work only on one skill at a time;

• Not every employee costs the same, i.e. wages are taken into consideration. Furthermore, next to a per period wage, employees also receive a ‘start-up’ fee. Both the wage and the ‘start-‘start-up’ fee can be different for different employees;

• When employees are called to work they should work a minimal number of consecutive working periods. However, they also should not work more than a maximal number of consecutive working periods. These minimal and maximal number of consecutive periods can be employee specific. • Employees are required to work a minimal number of these ‘blocks’ of

consecutive working periods, but are not allowed to work more than a

(30)

22 5. Problem definition and theoretical analysis

maximal number of working periods. This minimal and maximal number can differ between employees.

• Employees are not allowed to work more than a, employee specific, max-imal number of periods. Next to this, employees should work at least a, employee specific, minimal number of periods.

• There can be fixed periods during which employees must be on duty, and there can be fixed periods during which employee must be off-duty. These are also employee specific.

Now that the modelling assumptions are outlined we are ready to present a mathematical problem definition of our rostering problem. This is the main subject of the next section.

5.2

Mathematical problem definition

This section presents a mathematical definition of our rostering problem. First, some indices are introduced in Table 5.1. These indices are also used in the remainder of the thesis.

Table 5.1: Indices s, t = 1, . . . , T period indices

i = 1, . . . , n employee index j = 1, . . . , m skill index

Now, a mathematical definition of the Rostering Problem (RP) can be given. Here, a decision problem form is presented.1

Definition 5.1 (Rostering Problem).

GIVEN: A finite set of time periods T , a number of skills m, a number of employees n, a demand matrix D = (djt) of nonnegative integers, and for every

employee i a set of κishifts, Si= {Si1, . . . , Siκi}. Every shift meets labour rules, unavailabilities, and takes into account whether the employee has the required skills. Let K := max

i=1,...,n{κi}.

QUESTION: Does there exist a function f : Nm× Nn× NT× NK7→ {0, 1} with

f (i, j, t, k) = 1 if and only if employee i is working on skill j, during period t and the employee is really working shift k, such that

n X i=1 X k∈Si f (i, j, t, k) ≥ djt j = 1, . . . , m; t = 1, . . . , T (5.1a) m X j=1 X k∈Si f (i, j, t, k) ≤ 1 i = 1, . . . , n; t = 1, . . . , T (5.1b) and m X j=1 T X t=1 X k∈Si f (i, j, t, k) ≤ 1 i = 1, . . . , n (5.1c)

(31)

Complexity 23                        0 0 .. . 0 1 1 .. . 1 0 .. . 0 0                                               0 1 .. . 1 0 0 · · 0 1 .. . 1 0                        consecutive q-multi-shift Figure 5.1: Two types of shifts

Note that Definition 5.1 incorporates all assumptions of Section 5.1.

• Constraint (5.1a) makes sure demand is met, which is the second assump-tion in Secassump-tion 5.1;

• Constraint (5.1b) enforces that an employee works at most on one skill at a time. This is the third assumption in Section 5.1;

• The employee specific set of shifts, Si, contains only shifts that an

em-ployee is allowed to work. Together with constraint (5.1c), which implies that an employee works at most one shift, this makes sure that the as-sumptions of Section 5.1 that were not yet mentioned are encorporated in the problem.

The next section discusses the computational complexity of three special cases of the rostering problem defined in Definition 5.1.

5.3

Complexity

This section considers time complexity, a measure commonly used to assess the computational difficulty of combinatorial optimisation problems. A general discussion of complexity theory is given in Garey and Johnson (1979). This section first discusses the time complexity of some special cases. After that, the complexity of the general rostering problem as defined in Definition 5.1 is discussed.

(32)

24 5. Problem definition and theoretical analysis

of Section 5.3.1 is considered. Next, in Section 5.3.3, employees are allowed to work shifts consisting of multiple blocks of consecutive working periods. An example of such a shift is displayed on the right hand side of Figure 5.1. Again, the single skill case is considered. A shift that consists out of at most q blocks of consecutive working periods is called a ‘q-multi-shift’.

Before we start studying the special cases, we have to make one important remark. Namely, in all the special cases studied, employees are regarded as being equal. This implies that we do not have to explicity consider ‘collections of shifts’, since all employees have the same set of shifts they are allowed to work.

5.3.1

Consecutive working periods, single skill

This section considers the special case where employees are allowed to only work one shift of consecutive working periods and where m = 1. As mentioned before, it is assumed that the employees are equal. This problem is abbreviated by CONSSS (CONSecutive Single Skill). In decision problem form, we define it as

Definition 5.2 (CONSSS).

INSTANCE: A set of shifts A = (atk), where atk= 1 if and only if period t is

a working period in shift k, atk = 0 elsewhere, a demand vector d, and some

integer n ≥ 0. For each shift it holds that it consists out of at most one block of consecutive ones.

QUESTION: Is there a nonnegative integer vector x, such that Ax ≥ d and such that cTx ≤ n?

Note that in CONSSS we look for an integer vector x, such that demand is met. This is, because all employees are assumed to be equal, and hence there are no employee specific sets of shifts, as in Definition 5.1. So searching for a binary vector x that makes sure demand is met in fact is wrong. The main theorem of this section, Theorem 5.5, shows that CONSSS ∈ P. However, first interval matrices have to be defined.

Definition 5.3 (interval matrix). A vector m is called an interval vector if mi=



1 if a ≤ i ≤ b

0 otherwise for some a, b ∈ N.

A matrix M is called an interval matrix if all columns of M are interval vectors.

Now, we are able to state and prove the following theorem Theorem 5.4. Any interval matrix M is totally unimodular (TU).2

Proof. First, we define the k × k matrix N as follows

N :=        1 −1 0 . . . 0 0 0 1 −1 . . . 0 0 .. . ... ... . .. ... ... 0 0 0 . . . 1 −1 0 0 0 . . . 0 1       

(33)

Complexity 25

Let A be an arbitrary k × k submatrix of M . Then each column of the matix N A contains at most one 1 and one −1, and has zeros elsewhere. According to Lemma B.4 such a matrix is TU. Using det(N ) = 1, it follows that

{−1, 0, 1} 3 det(N A) = det(N ) · det(A) = det(A) Since, A is an arbitrary k × k submatrix (of M ), M is TU.

It is not hard to see that the matrix A of a CONSSS instance is an interval matrix, and hence, using Theorem 5.4, A is a TU. This observation implicates that CONSSS ∈ P, which we state in Theorem 5.5.

Theorem 5.5. The problem CONSSS, as defined in Definition 5.2, is polyno-mially solvable.

Proof. From Theorem 5.4, it follows that the matrix A of a CONSSS instance is TU. Hence, the solution for which cTx is minimal can be found in polynomial

time. After that, it is easy to verify whether cTx≤ n or not.

In the above proof we used that linear programs with a TU technology matrix are efficiently solvable. This holds, because from every TU matrix a network matrix can be created, see Nemhauser and Wolsey (1988), and network problems are polynomially solvable, see Cormen, Leiserson and Rivest (1990).

When the working periods in shifts are not consecutive the matrix A is in general not TU anymore. To see this, consider the following counter-example

  1 1 0 0 1 1 1 0 1  

that has a determinant equal to 2 /∈ {−1, 0, 1}.

Suppose we have a multi-day rostering problem where the working periods need to be consecutive, like the one displayed on the right hand side of Figure 5.1. Furthermore, suppose that an employee, when called to work, has to work the same shift every day. Then the following corollary is almost immediate from Theorem 5.4.

Corollary 5.6. If an employee, when called to work, works the same shift every day, the problem is still polynomially solvable.

Proof. If the technology matrix A corresponding to a single-day rostering prob-lem is TU, then the matrix

   A .. . A   

(34)

26 5. Problem definition and theoretical analysis

The argument used in this section to prove that CONSSS ∈ P is similar to the one used in Hochbaum and Levin (2006). They, however, proved an even larger class of problems to be polynomially solvable. In the result of Hochbaum and Levin cyclical rostering problems with consecutive working periods are proven to be polynomially solvable. In cyclical rostering, the final and first period are also regarded as being consecutive. For this proof, Hochbaum and Levin used N to transform the cyclical rostering problem to a network flow problem (for cyclical rostering the matrix N A is not TU). Since network flow problems can be solved polynomially this proves that cyclical rostering problems with consecutive working periods are polynomially solvable.

5.3.2

Consecutive working periods, multi-skill

This section considers a multi-skill version of CONSSS, the problem that was discussed in the previous section. So, the working periods still must be con-secutive, but m ≥ 1. An employee is not required to work on the same skill during all working periods of his shift. However, an employee is not allowed to work at more than one skill at a time. Furthermore, again all employees are as-sumed to be equal. This problem is abbreviated with CONSMS (CONSecutive Multi-Skill), and we define it in Definition 5.7.

Definition 5.7 (CONSMS).

INSTANCE: A set of shifts A = (ajtk), where ajtk = 1 if and only if period t

is a working period on skill j in shift k, ajtk = 0 elsewhere, a demand matrix

D = (djt), and some integer n ≥ 0. For each shift it holds that it consists out

of at most one block of consecutive working periods.

QUESTION: Is there an integer vector x ≥ 0, such that Ax ≥ D and 1Tx = n?

Note that CONSMS also looks for an integer vector x, instead of a binary vector x, since employees are assumed to be equal. This problem turns out to be NP-complete. We state and prove this in Theorem 5.11. In order to prove this theorem the concept of cyclical rostering is introduced in Definition 5.9, but first circulant matrices are defined in Definition 5.8.

Definition 5.8 (Circulant matrix). A matrix A is called circulant if A can be written as      a1 an · · · a2 a2 a1 · · · a3 .. . ... . .. ... an an−1 · · · a1     

for some vector a = (a1, a2, . . . , an)T.

(35)

Complexity 27

is a circulant matrix generated by the column vector (1, 1, 0, 1, 0, 0)T

In words, a circulant matrix is the matrix created by taking the first column and shifting it cyclically downwards to obtain successive columns.

Now, the Circulant Problem (CP) can be defined. Definition 5.9 (Circulant Problem).

INSTANCE: An n × n 0-1 circulant matrix A where the columns represent the shifts k and the rows the time periods t, a demand vector b, and a positive integer v.

QUESTION: Does there exist an integer vector x ≥ 0, such that 1Tx = v and Ax ≥ b?

Bartholdi (1981) has proven the NP-hardness of the Circulant Problem. Since CP ∈ NP trivially holds, we have that CP is NP-complete. This is stated (without proof) in the next theorem.

Theorem 5.10. The Circulant Problem is NP-complete.

In order to prove the NP-completeness of CONSMS we reduce it to CP. Theorem 5.11. CONSMS is NP-complete.

Proof. First, we show that CONSMS ∈ NP. Given a vector x, it is polynomially verifiable whether Ax ≥ D, x ≥ 0, and 1Tx = n or not. Hence, CONSMS ∈ NP.

In order to prove the NP-hardness of the CONSMS problem, we are going to show that CP ∝ CONSMS.

Given, the matrix A of a CP instance, consider the following instance of CONSMS with m = 2. Let skill 1 represent the ‘work’ skill and let skill 2 represent a dummy skill. Denote the technology matrix of a CONSMS instance by ¯A. Let ¯A1tk= Atkfor all t and all k and let ¯A2tk= 1 − Atkfor all t and all k.

Hence, whenever an employee is working for the CP instance, he works on skill 1 for the CONSMS instance, and whenever an employee is not working for the CP instance, he is working on skill 2 for the CONSMS instance. Note that the shifts of ¯A are consecutive, simply because for all shifts all periods are working periods. Furthermore, let the first column of D be equal to b, i.e. D1 = b and

let D2= 0. Finally, let n = v.

Note that this transformation of a CP instance into a CONSMS instance is polynomial.

Now, there exists an integer vector ¯x ≥ 0 such that ¯A¯x ≥ D and 1Tx = n if¯ and only if there exists an integer vector x ≥ 0 such that Ax ≥ b and 1Tx = v. For sufficiency, let ¯x = x. Let ¯A2denote the submatrix of ¯A for which j = 2.

When noting that ¯A2x ≥ 0 is true for all ¯¯ x ≥ 0, it follows that an integer x ≥ 0

satisfying Ax ≥ b and 1Tx = v satisfies ¯Ax ≥ D and 1Tx = n. Necessity is trivial.

(36)

28 5. Problem definition and theoretical analysis

5.3.3

Multi-shift rostering

This section discusses rostering problems where working periods need neither be consecutive nor cyclical. When a shift consists out of at least one block of ones and at most q blocks of ones, it is called a q-multi-shift, which is displayed in Figure 5.1. For sake of simplicity the single skill case is considered here, so m = 1. This problem is abbreviated by q-MSSS (q-Multi-Shift Single Skill), and is defined in Definition 5.12. For q-MSSS employees are also assumed to be equal.

Definition 5.12 (q-MSSS).

INSTANCE: A set of shifts A = (atk), where atk= 1 if and only if period t is

a working period in shift k, atk = 0 elsewhere, a demand vector d, and some

integer n ≥ 0. For each shift it holds that it consists out of at most q blocks of ones.

QUESTION: Is there an integer vector x ≥ 0, such that Ax ≥ d and such that 1Tx ≤ n.

Note that q-MSSS also looks for an integer vector x, instead of a binary vector x, since all employees are assumed to be equal. This problem also turns out to be NP-complete. For q ≥ 3 the NP-hardness is almost straightforward, because it can be easily reduced to the so-called ‘Exact Cover by 3-Sets problem’ (X3C) that is defined in Definition 5.13.

Definition 5.13 (X3C).

INSTANCE: A set X with |X| = 3v, for some integer v ≥ 0, and a collection C of 3-element subsets of X.

QUESTION: Does C contain an exact cover of X, i.e. does there exist a C0⊂ C such that every element of X occurs in exactly one member of C0?

X3C turns out to be NP-complete, see Garey and Johnson (1979). In The-orem 5.14 we give a proof of the NP-completeness of q-MSSS for q ≥ 3. Theorem 5.14. q-MSSS is NP-complete for q ≥ 3.

Proof. First, we note that q-MSSS ∈ NP. Given an integer solution vector x it is polynomially verifiable whether this solution satisfies Ax ≥ d, x ≥ 0, and 1Tx ≤ n or not.

To complete the proof we show that X3C ∝ q-MSSS. We create the matrix A of q-MSSS as follows. For each element j ∈ C we create a column in A. Now, aij = 1 if element i ∈ X is in the j-th element of C. Next to this, let n = v,

and let d ≡ 1. Note that for every column of A we have q ≤ 3.

Furthermore, note that this transformation of an X3C instance into a q-MSSS instance is polynomial.

Now, there is a solution to X3C if and only if there is an integer vector x ≥ 0 such that Ax ≥ d and 1Tx ≤ n.

To prove sufficiency, we first note that every column of A contains exactly 3 ones, that Ax ≥ d ≡ 1 and that |X| = 3n. These imply that the vector x must contain at least n ones. Since, 1Tx ≤ n also holds, it follows that

(37)

Conclusions 29

From this we have that

1TAx = (1TA)x = 3Tx = 3n = 1Td

The second equality follows since each column of A contains exactly 3 ones. The fourth equality follows since d contains exactly 3n ones.

Now, suppose ∃i0:P

jai0jxj > 1. Then

1TAx = 1Td ⇒ ∃i00:X

j

ai00

jxj = 0

However, this contradicts Ax ≥ d ≡ 1. Hence, Ax ≤ 1. Together with Ax ≥ 1 this implies

Ax = 1

Hence, if we let C0 contain exactly those j ∈ C for which the corresponding xj = 1, then this set covers X exactly, as is shown above.

To prove necessity, we let xj = 1 if the corresponding j ∈ C is contained

in C0. Let xj = 0 otherwise. Then x satisfies Ax = 1 and 1Tx = v. Hence,

Ax ≥ 1 ≡ d and 1Tx ≤ n.

So, we have shown q-MSSS to be NP-complete for q ≥ 3. In fact, it is even NP-complete for q = 2. A proof of its NP-hardness is given by Hochbaum and Levin (2006). There a reduction of q-MSSS to 3-SATISFIABILITY is given. Our proof of Theorem 5.14 shows that 2-MSSS ∈ NP, hence 2-MSSS is NP-complete.

5.4

Conclusions

This chapter first outlined the modelling assumptions that are use throughout this thesis. After that, a formal mathematical problem defintion of the rostering problem was presented. Next, in Section 5.3, the computational complexity of the rostering problem was studied. In Section 5.3.1 a special case of the rostering problem turned out to be polynomially solvable. In Section 5.3.2 and Section 5.3.3 we have shown two other special cases of our problem to be NP-complete. In all these special cases employees were considered as being equal. This implies that the versions of CONSMS and q-MSSS where employees are not assumed to be equal, i.e. where the employees have employee specific sets of shifts they are allowed to work, are also NP-complete. Then the general rostering problem that was defined in Definition 5.1 is of course also NP-complete. This is stated (without proof) in Theorem 5.15.

(38)
(39)

Chapter 6

Modelling

This chapter describes two modelling approaches used to solve the rostering problem defined in Defintion 5.1. First, an integer linear programming (ILP) formulation of the rostering problem is discussed in Section 6.1. After that, a Branch-and-Price approach is discussed in Section 6.2.

Although Definition 5.1 allows lots of constraints on the shifts, we put some restrictions on the modelling. In this chapter, we only model the multi-skill version of the q-MSSS problem that was defined in Definition 5.12. This problem is denoted by q-MSMS (q-Multi-Shift Multi-Skill). Since q-MSSS is already NP-complete, as we stated in Theorem 5.14, q-MSMS is trivially NP-complete. The modelling is restricted to this class of rostering problems, since numerous constraints that can be defined for general rostering problems are hard, if not impossible, to be included in the ILP formulation.

To give an example, constraints of the form

“An employee is allowed to work at most 40 hours a week, but twice every 13 weeks an exception of 48 working hours in a week is allowed. However, in a week following a week where more than 40 hours are worked an employee is not allowed to work more than 36 hours. Furthermore, working more than 40 hours a week is not allowed for more than one week out of every 4 consecutive weeks.”

are not uncommon in practise. To model such constraints in an ILP model lots of (binary) variables are needed. This will have a (very) negative influence on the solving time, because the number of (integer) variables and constraints increases significantly. In practise lots of constraints of these kind are implied on rosters. Furthermore, constraints on the maximum number of different skills that is worked on during a shift, or constraints on series of shifts are also not uncommon in practise. For both of these kinds of constraints it is not straight-forward how to include them in an ILP model, and it certainly implies a further growth of the number of constraints and variables of the model.

Of course, it is also not straightforward to incorporate such constraints in the Branch-and-Price problem either. However, in our Branch-and-Price implemen-tation these constraints are only part of a subsystem of the solution approach, which implies that it is easier to reduce the negative effects of these constraints. This is also outlined during the discussion of the Branch-and-Price method in Section 6.2.

(40)

32 6. Modelling

Although the Branch-and-Price approach is able to model the rostering prob-lem as defined in Definition 5.1, for reasons of comparison we chose to model only the q-MSMS case. A theoretical comparison of the two modelling approaches is presented in Section 6.3.

The chapter concludes with some general remarks and conclusions.

6.1

Integer linear programming model

This section states an integer linear programming (ILP) formulation of the prob-lem defined in Section 5.2. The parameters and variables of our model are listed in respectively Table 6.1 and Table 6.2.

Table 6.1: Parameters

n # employees

m # skills

T # periods

djt demand for employees with skill j in period t

eij 1 if employee i has skill j, 0 otherwise

Contract employee i:

cit fixed cost for employee i working period t

ri fixed cost when employee i starts working

ON(i) set of periods in which employee i should be on duty OFF(i) set of periods in which employee i should be off-duty

minoni minimal # times employee i should be called to start working

maxoni maximal # times employee i might be called to start working

minupi minimal # periods during which employee i works

maxupi maximal # periods during which employee i works

mindui minimal # consecutive working periods employee i should work

when called to start working

maxdui maximal # consecutive working periods employee i is allowed to

work when called to start working

tend(i) index of the last period in which employee i can start working;

tend(i) = T − mindui+ 1

Table 6.2: Variables Primary variables; independent

xijt 1 if employee i works on skill j during period t, 0 otherwise

Secondary variables; dependent ¯

xit 1 if employee i is working during period t, 0 otherwise;

¯ xit=P

m

j=1xijt

yit 1 if employee i starts working during period t, 0 otherwise

(41)

Integer linear programming model 33 min n X i=1 T X t=1 citx¯it+ riyit s.t. n X i=1 xijt≥ djt j = 1, . . . , m; t = 1, . . . , T (6.1a) yi1≥ ¯xi1 i = 1, . . . , n (6.1b) yit≥ ¯xit− ¯xi,t−1 i = 1, . . . , n; t = 2, . . . , T (6.1c) yit≤ ¯xit i = 1, . . . , n; t = 1, . . . , T (6.1d) yit≤ 1 − ¯xi,t−1 i = 1, . . . , n; t = 2, . . . , T (6.1e) xijt≤ eij i = 1, . . . , n; j = 1, . . . , m; t = 1, . . . , T (6.1f) and for i = 1, . . . , n ¯ xit= m X j=1 xijt t = 1, . . . , T (6.1g) m X j=1 xijt ≤ 1 t = 1, . . . , T (6.1h) minoni≤ T X t=1 yit≤ maxoni (6.1i) minupi≤ T X t=1 ¯ xit≤ maxupi (6.1j) ¯ xit= 1 for t ∈ ON(i) (6.1k) ¯ xit= 0 for t ∈ OFF(i) (6.1l)

and for i = 1, . . . , n and s = 1, . . . , tend(i)

s+maxdui X t=s ¯ xit≤ maxdui (6.1m) s+mindui−1 X t=s ¯ xit≥ mindui· yis (6.1n)

and for i = 1, . . . , n and s = tend(i) + 1, . . . , T let

yis= 0 (6.1o)

xijt∈ {0, 1} i = 1, . . . , n; j = 1, . . . , m; t = 1, . . . , T (6.1p)

yit∈ [0, 1] i = 1, . . . , n; t = 1, . . . , T (6.1q)

Referenties

GERELATEERDE DOCUMENTEN

167 N12.04 Zilt- en overstromingsgrasland 09.06 Overig bloemrijk grasland 3.32c Nat, matig voedselrijk

In de Schenck-machine wordt mechanisch niets gewijzigd aan de ophanging van het lichaam. Er zijn echter twee potentiometers, die om beurten dienen voor de onderlin- ge

Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of

These observations are supported by Gard (2008:184) who states, “While I would reject the idea of a general ‘boys crisis’, it remains true that there are many boys who

The Europe-USA Workshop at Bochum [75] in 1980 and at Trondheim [6] in 1985 were devoted to nonlinear finite element analysis in structural mechanics and treated topics such as

These three settings are all investigated for the same input set with 100 locations: one distribution center, nine intermediate points and 190 customer locations; the demand range

Finally, the research question comes out to be: What are differences of the importance of the nine components among online apparel retail, management consulting, telecom operation,

investments made by China’s sovereign wealth funds is being researched in this thesis to find if SWFs indeed actively pursue political objectives as a part of state diplomacy.