Waiting Times: Matching Supply With Demand
Waiting Times: Matching Supply With Demand
Chapter 7
These slides are based in part on slides that come with Cachon & Terwiesch
book Matching Supply with Demand http://cachon-terwiesch.net/3e/. If you
want to use these in your course, you may have to adopt the book as a textbook
or obtain permission from the authors Cachon & Terwiesch.
1
utdallas.edu/~metin
Learning Objectives
Interarrival and Service Times and their variability
Obtaining the average time spent in the queue
Pooling of server capacities
Priority rules
utdallas.edu/~metin
2
Where are the queues?
utdallas.edu/~metin
3
A Queue is made of a server and a queue in front
Processing
Buffer
We are interested in the waiting times in the queue and the queue length.
utdallas.edu/~metin
An Example of a Simple Queuing System
Incoming Answered
calls Reps Calls
Calls processing
on Hold calls
1 0 4
2 5 4
3 10 4
4 15 4
5 20 4
6 25 4
7 30 4
8 35 4
9 40 4
10 45 4
11 50 4
12 55 4
utdallas.edu/~metin 7
Variability: Where does it come from? Examples
Tasks:
• Inherent variation
• Lack of Standard Operating Procedures
• Quality (scrap / rework)
Buffer Processing
Input:
• Unpredicted Volume swings
• Random arrivals (randomness is the rule,
not the exception) Resources:
• Incoming quality • Breakdowns / Maintenance
• Product Mix • Operator absence
• Set-up times
utdallas.edu/~metin
Random Arrival Rate and Service Times
Arrival Service Patient 1 Patient 3 Patient 5 Patient 7 Patient 9 Patient 11
Patient Time Time
Patient 2 Patient 4 Patient 6 Patient 8 Patient 10 Patient 12
1 0 5
2 7 6
3 9 7 Time
5 18 5
6 22 2
3
7 25 4
Number of cases
8 30 3
2
9 36 4
10 45 2
1
11 51 2
12 55 2
0
Averages 5 4 2 min. 3 min. 4 min. 5 min. 6 min. 7 min.
Interarrival
time Service times
utdallas.edu/~metin
9
Variability Leads to Waiting Time
Average Arrival Rate (0.2/min) and Service Times (4 min)
Arrival Service
Patient Time Time
Service time
1 0 5
2 7 6
3 9 7
4 12 6
5 18 5
Wait time
6 22 2
7 25 4
8 30 3
9 36 4 5
10 45 2 4
11 51 2
3
12 55 2
2
1
Inventory
(Patients at lab) 0
7:00 7:10 7:20 7:30 7:40 7:50 8:00 10
utdallas.edu/~metin
Is the incoming call rate stationary?
Number of customers
Per 15 minutes
160
140
120
100
80
60
40
20
0
Time
12:30
10:45
21:15
23:00
17:45
19:30
14:15
16:00
0:15
2:00
3:45
7:15
9:00
5:30
utdallas.edu/~metin
11
How to test for stationary?
Cumulative Cumulative
Number of Number of
Customers Customers
700 70
600 60
500 50
Expected arrivals
400 if stationary 40
300
30
200
Actual, cumulative 20
arrivals
100
10
0
0
6:00:00 7:00:00 8:00:00 9:00:00 10:00:00 7:15:00 7:18:00 7:21:00 7:24:00 7:27:00 7:30:00
Time Time
90
Probability{Interarrival time t}
80 0.8
70
60 0.6
50
40 0.4
30
20 0.2
10
0
t time
0
Duration t
𝑡
Prob 𝐼𝐴 ≤ 𝑡 = 1 − exp − , IA interarrival time
𝑎
E 𝐼𝐴 = 𝑎, expected time between two arrivals in a row
StDev 𝐼𝐴 = 𝑎, expected and StDev are the same for exponential distribution
utdallas.edu/~metin
13
Comparing empirical and theoretical distributions
Distribution Function
1
Exponential distribution
0.8
0.6
0.4
Empirical distribution
0.2
-
0
Interarrival time
0:00:00 0:00:09 0:00:17 0:00:26 0:00:35 0:00:43 0:00:52 0:01:00 0:01:09
utdallas.edu/~metin
14
Analyzing the Arrival Process
CVa=StDev(IA)/E(IA)
Stationary
Arrivals?
YES NO
utdallas.edu/~metin
15
Analyzing the Service Times
Seasonality and Variability
Call duration 2.5
[minutes] Week-end averages
1.5
1 Week-day averages
0.5
Time of the
0 day
0:00 23:00
800
Frequency
600
of service times
200
Std. Dev = 141.46
Mean = 127.2
Call durations
0 N = 2061.00
[seconds]
utdallas.edu/~metin A
16
Computing the expected waiting time Tq
Inventory Inventory
waiting Iq in service Ip
Inflow Outflow
utdallas.edu/~metin
17
Utilization
FlowRate 1 / a p
Utilizatio n u
Capacity 1 / p a
Utilization=90/300=0.3=30%
utdallas.edu/~metin
18
The Waiting Time Formula
Waiting Time Formula for Exponential Arrivals
utilizatio n
aCV 2
CV 2
Time in queue Activity Time
p
1 utilizatio n 2
Variability factor
Utilization factor
Service time factor
EX: Average Activity time=p=90 seconds; Average Interarrival time=a=300 seconds; CVa=1 and CVp=1.333
0.3 1 1.333
2 2
Average time in queue 90 53.57 sec
1 0.3 2
1 1
c) I * Tq p * 8 4 2
a 6
d) If teller is busy wp2/3, outputs15 per hour.
If teller is idle wp 1/3, outputs0 per hour.
utdallas.edu/~metin
Average output (2/3) *15 (1 / 3) * 0 10 per hour Average input !!! 20
The Flow Time Increase Exponentially in Utilization
Increasing
Variability
Inventory
waiting Iq
Inflow Outflow
utdallas.edu/~metin
22
Utilization with m servers
FlowRate 1/ a p
Utilizatio n u
Capacity m * (1 / p) a m
Utilization=90/(10x11.39)=0.79=79%
utdallas.edu/~metin
23
Waiting Time Formula for Parallel Resources
Activity time utilizatio n
2 ( m 1) 1
CV 2
CV 2
Time in queue a p
m 1 utilizatio n 2
90 0.79
2 (101) 1
12
1.333 2
Time in queue 24.94 sec
10 1 0.79 2
T Tq p 24.94 90 114.94 sec 1.916 min
utdallas.edu/~metin
24
Online Retailer Example
Customers send emails to a help desk of an online retailer every 2
minutes, on average, and the standard deviation of the inter-arrival time
is also 2 minutes. The online retailer has three employees answering
emails. It takes on average 4 minutes to write a response email. The
standard deviation of the service times is 2 minutes.
(b) How many emails would there be -- on average -- that have been
submitted to the online retailer, but not yet answered?
utdallas.edu/~metin
25
Service Levels in Waiting Systems
Fraction of 1 90% of calls had to
customers who wait 25 seconds or
have to wait x less
seconds or less 0.8 Waiting times for those customers
who do not get served immediately
0.6
0.2
0
0 50 100 150 200
utdallas.edu/~metin
27
Waiting Lines: Points to Remember
• Variability is the norm, not the exception
- understand where it comes from and eliminate what you can
- accommodate the rest
• Next case:
- application to call center
- careful in interpreting March / April call volume
utdallas.edu/~metin
Summary of the formulas
1. Collect the following data:
- number of servers, m
- activity time, p
- interarrival time, a
- coefficient of variation for interarrival (CVa ) and processing time (CVp )
p
2. Compute utilization: u=a m
utdallas.edu/~metin
29
Staffing levels
Cost of direct labor per serviced unit
Total wages per time m x (wages per time) p x (wages per time)
Cost of Direct Labor
Flow rate Arrival rate 1/a u
Because ma=p/u
utdallas.edu/~metin
30
Cost of direct labor per serviced unit
Another example with 9 servers
Ex: m=9. $10/hour wage for each CSR; Activity time=p=90 secs;
Interarrival time=11.39 secs; 1-800 number line charge $0.05 per minute
p 90
Utilization u 0.878
m x a 9x11.39
1.5 min/call x (16.66 cents/min)
Cost of Direct Labor 28.474 cents/call
0.878
90 0.878
2 ( 9 1) 1
12
1.333 2
Time in queue 10 * 5.218 *1.39 72.54 sec
9 1 0.878 2
T Tq p 72.54 90 162.54 sec 2.709 min
With T 2.709; Cost of line charge per call 2.709 * 0.05 $0.1354 / call
utdallas.edu/~metin 31
Cost of Staffing Levels
m u Labor cost Line cost Total cost
per call charge per call per call
8 1.3458
9 0.878 0.2847 0.1354 0.4201
10 0.790 0.3164 0.0958 0.4122
11 0.4323
12 0.4593
13 0.4887
14 0.5193
15 0.5503
The optimal staffing level m=10
utdallas.edu/~metin 32
Staffing Levels under various Interarrival Times
2:00
3:45
5:30
7:15
9:00
21:15
23:00
16:00
19:30
10:45
12:30
14:15
17:45
utdallas.edu/~metin
33
The Power of Pooling
Independent Resources Waiting
Time Tq
2x(m=1)
70.00
m=1
60.00
50.00
40.00
m=2
30.00
20.00
m=5
Pooled Resources 10.00 m=10
(m=2)
0.00
60% 65% 70% 75% 80% 85% 90% 95%
Utilization u
Implications:
+ balanced utilization
Service times:
A C A: 9 minutes
B: 10 minutes
B 4 min. D C: 4 minutes
9 min.
D: 8 minutes
19 min. C 12 min. A
23 min. D 21 min. B
p2
p1
W(t) W(t)
First finishes
Time t Second finishes Time t
utdallas.edu/~metin
Summary
Interarrival and Service Times and their variability
Obtaining the average time spent in the queue
Pooling of server capacities
Priority rules
utdallas.edu/~metin
38