Chapter 13

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Chapter 13: Workforce Scheduling

Phan Nguyen Ky Phuc

November 17, 2021

Contents

1 Introduction 1

2 Nurse Rottering Problem 2

3 Crew Scheduling Proble 5

1 Introduction

Workforce allocation and personnel scheduling deal with the arrangement of work schedules
and the assignment of personnel to shifts in order to cover the demand for resources that
vary over time.
Common constraints for Workforce Scheduling

• The demand per day, nj , j = 1, ..., 7,( n1 is Sunday and n7 is Saturday) is met.

• Each employee works exactly 5 out of 7 days (from Sunday to Saturday).

• Each employee works no more than 6 consecutive days.

Math Model
Index

• i index of employees i = 1...I

• d index of day d = 1...D

Parameters

1
Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

• Nd Number of employees requires for day d

Requirement:

• Each employee works exactly 5 out of 7 days (from Sunday to Saturday).

• Each employee works no more than 6 consecutive days.

Decision Variables

• Xid Binary variable Xid = 1 employee i is assigned to day d, otherwise Xid = 0

• Yi if the employee is used

Objective Function
I
X
min Yi
i=1

Constraints
Demand constraint for each day

I
X
Xid ≥ Nd , ∀d
i=1

Consecutive day constraints

t=6
X
Xi,d+t ≤ 6, ∀i, d = 1...D − 6
t=0
t=6
X
Xi,d+t = 5Yi , ∀i, d = 1, 8, 15, 22, ..
t=0

If the employee i is used then Yi = 1

Yi ≥ Xid , ∀i, d
D
X
Yi ≤ Xid , ∀i
d=1

2 Nurse Rottering Problem

Assumption

• One day has 2 shifts: Day Shift and Nigh Shift

• One nurse cannot work 2 consecutive shifts

Chapter 13 Page 2
Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

• One nurse must work at most 5 shifts per week

Index

• i index of employees i = 1...I

• d index of day d = 1...D

Parameters

• Dd Number of nurses requires for day shift d

• Nd Number of nurses requires for night shift d

Decision Variables

• XDid Binary variable XDid = 1 if nurse i is assigned to day shift d, otherwise XDid = 0

• XNid Binary variable XNid = 1 if nurse i is assigned to night shift d, otherwise


XNid = 0

• XRid Binary variable XRid = 1 if nurse i is off on day d

• Yi if the nurse i is used

Objective function:
I
X
min Yi
i=1

Constraints
Demand constraints
I
X
XDid ≥ Dd , ∀d
i=1
XI
XNid ≥ Nd , ∀d
i=1

The consecutive shift constraints

XDid + XNid + XRid = 1


XNid + XDi,d+1 ≤ 1

One nurse cannot work at most 6 consecutive days

t=6
X
XRi,d+t ≥ 1, ∀i, d = 1...D − 6
t=0

Chapter 13 Page 3
Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

One nurse must work at most 5 shifts per week

t=6
X t=6
X
XDi,d+t + XNi,d+t ≤ 5, ∀i, d = 1, 8, 15, 22, ..
t=0 t=0

If the nurse i is used then Yi = 1

Yi ≥ XDid , ∀i, d
Yi ≥ XNid , ∀i, d
D
X D
X
Yi ≤ XDid + XNid , ∀i
d=1 d=1

1 /∗ ∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗
2 ∗ OPL 1 2 . 9 . 0 . 0 Model
3 ∗ Author : kyphuc
4 ∗ C r e a t i o n Date : May 2 7 , 2020 a t 2 : 0 7 : 5 3 PM
5 ∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗ ∗/
6 i n t numDay=28;
7 i n t numEm=40;
8 r a n g e Day = 1 . .numDay ;
9 r a n g e Em= 1 . .numEm;
10 { i n t }Monday = { 1 , 8 , 1 5 , 2 2 } ;
11 i n t D[ Day ] = [ 5 , 5 , 5 , 5 , 5 , 5 , 5 ,
12 6 ,6 ,6 ,6 ,6 ,6 ,6 ,
13 7 ,7 ,7 ,7 ,7 ,7 ,7 ,
14 8 ,8 ,8 ,8 ,8 ,8 ,8];
15 i n t N[ Day ] = [ 5 , 5 , 5 , 5 , 5 , 5 , 5 ,
16 6 ,6 ,6 ,6 ,6 ,6 ,6 ,
17 7 ,7 ,7 ,7 ,7 ,7 ,7 ,
18 8 ,8 ,8 ,8 ,8 ,8 ,8];
19 dvar b o o l e a n XD[Em ] [ Day ] ;
20 dvar b o o l e a n XN[Em ] [ Day ] ;
21 dvar b o o l e a n XR[Em ] [ Day ] ;
22 dvar b o o l e a n Y[Em ] ;
23 e x e c u t e SETTING{
24 c p l e x . t i l i m =120;
25 }
26 minimize sum ( i i n Em)Y[ i ] ;
27 s u b j e c t to
28 {
29 f o r a l l ( d i n Day ) {
30 sum ( i i n Em)XD[ i ] [ d]>=D[ d ] ;
31 sum ( i i n Em)XN[ i ] [ d]>=N[ d ] ;
32 }
33 f o r a l l ( d i n Day , i i n Em) {

Chapter 13 Page 4
Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

34 XD[ i ] [ d]+XN[ i ] [ d]+XR[ i ] [ d]==1;


35 }
36 f o r a l l ( d i n 1 . . numDay−1, i i n Em) {
37 XN[ i ] [ d]+XD[ i ] [ d+1]<=1;
38 }
39 f o r a l l ( d i n 1 . . numDay−6, i i n Em) {
40 sum ( t i n 0 . . 6 )XR[ i ] [ d+t ] >=1;
41 }
42 f o r a l l ( d i n Monday , i i n Em) {
43 sum ( t i n 0 . . 6 )XD[ i ] [ d+t ]+sum ( t i n 0 . . 6 )XN[ i ] [ d+t ] <=5;
44 }
45 f o r a l l ( d i n Day , i i n Em) {
46 Y[ i ]>=XD[ i ] [ d ] ;
47 Y[ i ]>=XN[ i ] [ d ] ;
48 }
49 f o r a l l ( i i n Em) {
50 Y[ i ]<=sum ( d i n Day )XD[ i ] [ d]+sum ( d i n Day )XN[ i ] [ d ] ;
51 }
52 }

3 Crew Scheduling Proble

Consider a set of m jobs, e.g., flight legs. A flight leg is characterized by a point of departure
and a point of arrival, as well as an approximate time interval during which the flight has
to take place. There is a set of n feasible and permissible combinations of flight legs that
one crew can handle, e.g., round trips or tours (the number n usually is very large). A
round trip may consist of several flight legs. Any given flight leg may be part of many round
trips. Round trip j, j = 1, ..., n, has a cost cj . Setting up a crew schedule is equivalent to
determining which round trips should be selected and which ones not. The objective is to
choose a set of round trips with a minimum total cost in such a way that each flight leg is
covered exactly once by one and only one round trip.
Annotation

• i: index of leg

• j: index of route

• aij = 1 if leg i belongs to the route j,otherwise, it is equal to 0

• xj = 1 if route j is selected, otherwise xj equal to 0

Objective function
X
min j = 1J (1)

Chapter 13 Page 5
Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

Constraints
J
X
aij xj = 1, ∀i (2)
j=1

Note: In this problem, all possible routes must be given in advanced.


The main idea is to divide all xj into 2 sets. The first set J1 which contains all xj = 1. The
second set J2 which contains all xj = 0.

Algorithm 1 Maximizing Weighted Number of Activities


Input:
Given job parameters pj , wj , rj , dj , Mj
Process:
1: Step 1
2: Set j=1
3:
4: Step 2
5: Take activity j and select, among the resources and time slots available, the resource
and time slots with the lowest g(νi,t+1 , ..., νi,t+pj ) rank. Discard activity j if it cannot be
assigned to any machine at any time.
6:
7: Step 3
8: If j = n ST OP , otherwise set j = j + 1 and return to Step 2.

1 i n t numDay=28;
2 i n t numEm=40;
3 r a n g e Day = 1 . .numDay ;
4 r a n g e Em= 1 . .numEm;
5 { i n t }Monday = { 1 , 8 , 1 5 , 2 2 } ;
6 { i n t } Sunday = { 7 , 1 4 , 2 1 , 2 8 } ;
7 { i n t } Saturday = { 6 , 1 3 , 2 0 , 2 7 } ;
8 i n t D[ Day ] = [ 5 , 5 , 5 , 5 , 5 , 0 , 0 ,
9 6 ,6 ,6 ,6 ,6 ,0 ,0 ,
10 7 ,7 ,7 ,7 ,7 ,0 ,0 ,
11 8 ,8 ,8 ,8 ,8 ,0 ,0];
12 i n t N[ Day ] = [ 5 , 5 , 5 , 5 , 5 , 0 , 0 ,
13 6 ,6 ,6 ,6 ,6 ,0 ,0 ,
14 7 ,7 ,7 ,7 ,7 ,0 ,0 ,
15 8 ,8 ,8 ,8 ,8 ,0 ,0];
16 dvar b o o l e a n XD[Em ] [ Day ] ;
17 dvar b o o l e a n XN[Em ] [ Day ] ;
18 dvar b o o l e a n XR[Em ] [ Day ] ;
19 dvar b o o l e a n Y[Em ] ;
20 dvar b o o l e a n Z [Em ] [ Monday ] ;
21 dvar b o o l e a n V[Em ] [ Monday ] ;
22 e x e c u t e SETTING{
23 c p l e x . t i l i m =120;
24 }
25 minimize sum ( i i n Em)Y[ i ] ;

Chapter 13 Page 6
Ho Chi Minh City International University Scheduling
Industrial Systems Engineering Department Lecturer: Phan Nguyen Ky Phuc

26 s u b j e c t to
27 {
28 f o r a l l ( d i n Day ) {
29 sum ( i i n Em)XD[ i ] [ d]>=D[ d ] ;
30 sum ( i i n Em)XN[ i ] [ d]>=N[ d ] ;
31 }
32 f o r a l l ( d i n Day , i i n Em) {
33 XD[ i ] [ d]+XN[ i ] [ d]+XR[ i ] [ d]==1;
34 }
35 f o r a l l ( d i n 1 . . numDay−1, i i n Em) {
36 XN[ i ] [ d]+XD[ i ] [ d+1]<=1;
37 }
38 f o r a l l ( d i n 1 . . numDay−6, i i n Em) {
39 sum ( t i n 0 . . 6 )XR[ i ] [ d+t ] >=1;
40 }
41 f o r a l l ( d i n Monday , i i n Em) {
42 sum ( t i n 0 . . 6 )XD[ i ] [ d+t ]+sum ( t i n 0 . . 6 )XN[ i ] [ d+t ] <=5;
43 }
44 f o r a l l ( d i n Day , i i n Em) {
45 Y[ i ]>=XD[ i ] [ d ] ;
46 Y[ i ]>=XN[ i ] [ d ] ;
47 }
48 f o r a l l ( i i n Em) {
49 Y[ i ]<=sum ( d i n Day )XD[ i ] [ d]+sum ( d i n Day )XN[ i ] [ d ] ;
50 }
51 f o r a l l ( i i n Em, d i n Sunday ) {
52 XR[ i ] [ d]==1;
53 }
54 f o r a l l ( i i n Em, d i n Saturday ) {
55 XR[ i ] [ d]==1;
56 }
57 f o r a l l ( i i n Em, d i n Monday ) {
58 f o r a l l ( t in 0 . . 6 ) {
59 Z [ i ] [ d]>=XD[ i ] [ d+t ] ;
60 }
61 Z [ i ] [ d]<=sum ( t i n 0 . . 6 )XD[ i ] [ d+t ] ;
62 f o r a l l ( t in 0 . . 6 ) {
63 V[ i ] [ d]>=XN[ i ] [ d+t ] ;
64 }
65 V[ i ] [ d]<=sum ( t i n 0 . . 6 )XN[ i ] [ d+t ] ;
66 Z [ i ] [ d]+V[ i ] [ d]==Y[ i ] ;
67 }
68 }

Chapter 13 Page 7

You might also like