Days-off scheduling : Algorithm

advertisement
Chapter 3
Workforce scheduling
Plan
•
Introduction
•
Days-off scheduling
•
Shift scheduling
•
Cyclic staffing probme
•
Crew scheduling
-2-
Intoduction
• Workforce allocation & personnel scheduling deal with the
arrangement of work schedules and the assignment of
personnel to shits to cover the demand for resources that vary
over time.
• In service environments the operations are often prolonged and
irregular, and the staff requirements fluctuate over time.
• The schedules are typically subject to various constraints
dictated by equipment requirements, union rules, ...
-3-
Days-off scheduling
An elementary personnel assignment problem.
The problem is to find the minimum number of employees to cover a 7days-a-week operation so that the following constraints are satisfied:
1. The demand per day, nj, j = 1, ..., 7 (Sunday to Saturday), is met
2. Each employee is given k1 out of every k2 weekends off
3. Each employee works exactly 5 out of 7 days (Sunday to Saturday)
4. Each employee works no more than 6 consecutive days.
Days j
Requirement
1
Sun
1
2
Mon
0
3
Tues
3
4
Wed
3
5
Thurs
3
6
Fri
3
7
Sat
2
k1/k2 = 1/3
-4-
Days-off scheduling : lower bounds
Weekend constraint
 k2 max  n1 , n7  
W 

k

k
  2 1 
Where W is the minimum size of the workforce
(k2 – k1)W >= k2 max(n1, n7)
Total demand constraint:
 7

W    n j 5
 j 1

5W >= Snj
Maximum daily demand constraint:
W >= max (n1, ..., n7)
Days j
Requirement
1
Sun
1
2
Mon
0
3
Tues
3
4
Wed
3
5
Thurs
3
6
Fri
3
7
Sat
2
k1/k2 = 1/3
-5-
Days-off scheduling : Algorithm
W = min workforce, n = max(n1, n7)
Step1. (Schedule the weekends off)
Assign the 1st weekend off to the first W-n employees
Assign the 2nd weekend off to the second W-n employees
This process is continued cyclically.
S
1x
2
3
S
x
M
M
T
W
T
F
S
S
x
x
M
M
T
W
T
F
S
S
x
x
M
M
T
W
T
F
S
x
-6-
Days-off scheduling : Algorithm
uj = W- nj, j= 2, ..., 6, uj = n – nj, j = 1, 7
Step2. (Determine the additional off-day pairs)
Construct a list of n pairs of off days, numbered 1 to n.
Choose day k such that uk = max(u1, ..., u7)
Choose day l (l k), such that ul > 0; if ul = 0 for all l k, set l = k
Add the pair (k, l) to the list and decrease uk and ul by 1.
Repeat the process n times.
Days j
uj
1
Sun
1
2
Mon
3
3
Tues
0
4
Wed
0
5
Thurs
0
6
Fri
0
7
Sat
0
(2, 1), Sunday-Monday
(2, 2), Monday-Monday (non distinct pairs)
-7-
Days-off scheduling : Algorithm
Set i = 1
Step3. (Categorize emplyees in week i)
Type T1 : weekend i off, no days needed during week i, weekend i+1 off
Type T2 : weekend i off, 1 off day needed during week i, weekend i+1 on
Type T3 : weekend i on, 1 off day needed during week i, weekend i+1 off
Type T4 : weekend i on, 2 off days needed during week i, weekend i+1 on
|T3| + |T4| = n, |T2| + |T4| = n (as n people working each weekend)
Pair Each employee of T2 with one of T3
Step 4 (Assign off-day pairs in week i)
Assign the n pairs of days, starting from the top off the list as follows:
First assign pairs of days to the employees of T4
Then, to each employee of T3 and his companion of T2, assign the one of T3 the
earliest day of the pair.
Set i = i+1 and return to step 3.
-8-
Days-off scheduling : Algorithm
S
1x
2
3
S
x
M
M
T
W
T
F
S
S
x
x
M
M
T
W
T
F
S
S
x
x
M
M
T
W
T
F
S
x
Week 1 : T2 = 1, T3 = 2, T4 = 3
Week 2 : T2 = 2, T3 = 3, T4 = 1
Week 3 : T2 = 3, T3 = 1, T4 = 2
S
1x
2
3
S
x
x
M
x
x
x
M
T
W
T
F
S
x
S
x
x
M
x
x
x
M
T
W
T
F
S
S
x
x
x
M
x
x
x
M
T
W
T
F
The schedule generated by the days-off scheduling algorithm is
always feasible.
-9-
S
x
Shift scheduling
A cycle (one day, one or several weeks) is fixed.
Each work assignment pattern over a cycle has its own cost.
Problem:
m time intervals/periods in the predetermined cycle
bi personnel are required for period i
b different shift patterns, and each employee is assigned to one and only
one pattern
(a1j, a2j, ..., amj) = shift pattern j with aij = 1 if period i is a work period.
cj = cost of patern j
Determine the number of employees of each pattern in order to minimise
the total cost.
- 10 -
Shift scheduling
minimise c1 x1  c2 x2  ...  cn xn
subject to
ai1 x1  ai 2 x2  ...  ain xn  bi , i  1,..., m
xi integer.
- 11 -
Shift scheduling
Pattern
1
2
3
4
Hours of Work
10 AM to 6PM
1pm tp9pm
12pm to 6pm
10am to 1pm
Hours
Staffing requirement
10am-11am
3
11am-12am
4
12am-1pm
6
1pm - 2 pm
4
2 pm - 3pm
7
3pm-4pm
8
4pm-5pm
7
5pm-6pm
6
6pm-7pm
4
7pm-8pm
7
8pm-9pm
8
Total Hours
8
8
6
3
Cost
50 €
60 €
30 €
15 €
What if overtime
is allowed?
- 12 -
Shift scheduling
• The integer programming formulation of the general personnel
scheduling problem (with arbitrary 0-1 A matrix) is NP-hard
• The special case with each column containing a contiguous set
of ones is easy and the solution of the LP-relaxation is always
integer.
- 13 -
Cyclic staffing problem
The objective is to minimise the cost of
assigning people to an m-period cyclic schedule
so that
sufficient workers are present during time period i, in order to meet
requirement bi,
and each person works a shift of k consecutive periods and is free
the other m-k periods.
Each column is a possible shift
(5,7) cyclic
staffing
1
1

1

A  1
1

0
0

0 0 1 1 1 1
1 0 0 1 1 1 
1 1 0 0 1 1

1 1 1 0 0 1 ,
1 1 1 1 0 0

1 1 1 1 1 0
0 1 1 1 1 1 
min cX / AX  B
- 14 -
Cyclic staffing problem : algorithm
Step 1. Solve the linear relaxation of the problem to obtain xi’
If (xi’) are integer, STOP
Step 2. Form two linear programs LP’ and LP’’ from the relaxation
of the original problem by adding respectively the constraints:
x1  x2  ...  xn   x '1  x '2  ...  x 'n 
and
x1  x2  ...  xn   x '1  x '2  ...  x 'n ¨.
LP’’ has an optimal solution that is integer
If LP’ does not have a feaible solution, then the solution of LP’’ is the
optimal solution
If LP’ has a feasible solution, then it has an optimal solution that is
integer and the best of LP’ and LP’’ solutions is the optimal solution.
- 15 -
Cyclic staffing problem : algorithm
1
1

A  1

0
0
0 0 1 1
3 
4
1 0 0 1 
 
1 1 0 0  , b  6 
 

1 1 1 0
4
7 
0 1 1 1 
c   3.6, 4.8,5.5,3.7,5.2 
Optimal  43.3
- 16 -
CREW SCHEDULING
• Crew scheduling problems are very important in transportation
especially in airline industry
• Consider a set of m jobs, or 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, round trips or tours.
• Each round trip j, has a cost cj.
• Crew schedule determines round trips to select in order to
minimize the total cost under the constraint that each flight leg is
covered exactly once by one and only one round trip.
- 17 -
CREW SCHEDULING
minimise c1 x1  c2 x2  ...  cn xn
subject to
ai1 x1  ai 2 x2  ...  ain xn  bi , i  1,..., m
xi integer.
• Each column in the A matrix is a round trip, and each row is a
flight leg that must be covered exactly once by one round trip.
• Set partitioning problem.
- 18 -
CREW SCHEDULING
2
5 1
4 2
3
4 3
2 2
3
5
2
2
1
route
cj
1
8
1
0
0
0
0
2
10
0
1
0
0
0
3
4
0
0
1
0
0
4
4
0
0
0
1
0
5
2
0
0
0
0
1
6
14
1
1
0
0
0
7
10
1
0
1
0
0
8
8
1
0
0
1
0
9
8
1
0
0
0
1
10
10
0
1
1
0
0
11
11
0
1
0
1
0
12
12
0
1
0
0
1
13
6
0
0
1
1
0
14
6
0
0
1
0
1
15
5
0
0
0
1
1
depot
Truck
routing
network
- 19 -
Download