Waiting Times

Waiting Times
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.
utdallas.edu/~metin
1
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
Buffer
Input:
Passengers in an airport
Customers at a bank
Patients at a hospital
Callers at a call center
Arrival rate
Queues
Processing
Resources:
Check-in clerks at an airport
Tellers at a bank
Nurses at a hospital
Customer service representatives
(CRS) at a call center
Capacity
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
calls
Answered
Calls
Reps
processing
calls
Calls
on Hold

Call center


Blocked calls
(busy signal)
Lost throughput
utdallas.edu/~metin
Abandoned calls
(tired of waiting)
Holding cost
Lost goodwill
Lost throughput (abandoned)
At peak, 80% of calls
dialed received a busy
signal.
Customers getting
through had to wait on
average 10 minutes
Extra phone line
expense per day for
waiting was $25,000.
Financial consequences
Cost of capacity
Cost per customer
$$$ Revenue $$$
5
A Somewhat Odd Service Process
Constant Arrival Rate (0.2/min) and Service Times (4 min)
Arrival rate 0.2/min = 1/(4 mins) = 1 every five minutes, which implies interarrival time of 5 minutes.
Units of arrival rate 1/min whereas units of interarrival time is min.
Arrival
Time
Service
Time
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
Patient
utdallas.edu/~metin
7:00
7:10
7:20
7:30
7:40
7:50
8:00 6
Where is Variability?

There certainly is significant (actually infinite) amount of waiting
when the arrival rate is greater than the service rate
– Equivalently, the processing capacity is less than the arrival rate

More interestingly, variability can cause long waiting times.
Variability in
–
–
–
–
–
–
Arrival process
Processing times
Availability of resources; Absent, sick, broken or vacationing servers.
Types of customers; Priority versus regular customers.
Routing of flow units; Recall the Resume Validation Example.
Response of customers to waiting for a while; Wait more or abandon
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)
• Incoming quality
• Product Mix
Especially relevant in service operations
(what is different in service industries?):
• emergency room
• air-line check in
• call center
• check-outs at cashier
utdallas.edu/~metin
Resources:
• Breakdowns / Maintenance
• Operator absence
• Set-up times
Routes:
• Variable routing
• Dedicated machines
Random Arrival Rate and Service Times
Patient
Arrival
Time
Service
Time
1
0
5
2
7
6
3
9
7
4
12
6
5
18
5
6
22
2
7
25
4
8
30
3
Patient 1 Patient 3
Patient 5 Patient 7
Patient 2
Patient 6
Patient 4
Patient 9
Patient 8
Patient 11
Patient 10
Patient 12
Time
7:00
7:10
7:20
7:30
7:40
7:50
8:00
9
36
4
10
45
2
11
51
2
12
55
2
5
4
Averages
Interarrival
time
utdallas.edu/~metin
Number of cases
3
2
1
0
2 min.
3 min.
4 min.
5 min.
Service times
6 min.
7 min.
9
Variability Leads to Waiting Time
Average Arrival Rate (0.2/min) and Service Times (4 min)
Arrival
Patient Time
Service
Time
Service time
1
0
5
2
7
6
3
9
7
4
12
6
5
18
5
6
22
2
7
25
4
8
30
3
9
36
4
5
10
45
2
4
11
51
2
12
55
2
Wait time
3
2
Inventory
(Patients at lab)
utdallas.edu/~metin
1
0
7:00
7:10
7:20
7:30
7:40
7:50
8:00
10
Is the incoming call rate stationary?
Number of customers
Per 15 minutes
160
140
120
100
80
60
40
20
utdallas.edu/~metin
23:00
21:15
19:30
17:45
16:00
14:15
12:30
10:45
9:00
7:15
5:30
3:45
2:00
0:15
0
Time
11
How to test for stationary?
Cumulative
Number of
Customers
Cumulative
Number of
Customers
700
70
600
60
500
50
Expected arrivals
if stationary
400
40
300
30
200
Actual, cumulative
arrivals
20
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
Time
Not stationary over a day, try over an hour or over 30 minutes.
utdallas.edu/~metin
7:27:00
7:30:00
Time
12
Probability{Interarrival time  t}
Percentage of calls with {Interarrival time  t}
Exponential distribution for Interarrival times
Number of calls with interarrival time t
100
90
80
1
0.8
70
60
0.6
50
0.4
40
30
0.2
20
10
0
Duration t
Prob 𝐼𝐴 ≤ 𝑡 = 1 − exp −
𝑡
𝑎
0
t time
, 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
0:00:00
utdallas.edu/~metin
Interarrival time
0:00:09
0:00:17
0:00:26
0:00:35
0:00:43
0:00:52
0:01:00
0:01:09
14
Analyzing the Arrival Process
 CVa=StDev(IA)/E(IA)
Stationary
Arrivals?
YES
NO
Exponentially distributed
inter-arrival times?
YES
• Compute a: average interarrival time
• CVa=1
• All results of chapters 8 and 9 apply
utdallas.edu/~metin
Break arrival process up
into smaller time
intervals
NO
• Compute a: average interarrival time
• CVa= St.dev. of interarrival times / a
• Results of chapter 8 or 9 do not apply,
require simulation or more complicated models
15
Analyzing the Service Times
Seasonality and Variability
Call duration
[minutes]
2.5
Week-end averages
2
1.5
Week-day averages
1
0.5
Time of the
day
0
0:00
23:00
800
Frequency
600
CVp: Coefficient of variation
of service times
400
200
Std. Dev = 141.46
Mean = 127.2
Call durations
N = 2061.00
0
utdallas.edu/~metin
[seconds]
A
16
Computing the expected waiting time Tq
Inventory
waiting Iq
Inventory
in service Ip
Inflow
Outflow
Entry to
system
Begin
Service
Waiting Time Tq
Departure
Service Time p
Flow Time T=Tq+p
utdallas.edu/~metin
17
Utilization
FlowRate 1 / a p
Utilizatio n  u 


Capacity 1 / p a
Example: Average Activity time=p=90 seconds
Average Interarrival time=a=300 seconds
Utilization=90/300=0.3=30%
utdallas.edu/~metin
18
The Waiting Time Formula
Waiting Time Formula for Exponential Arrivals
2
2


CV

CV
utilizatio
n

 a
p

Time in queue  Activity Time 


2
 1  utilizatio n  

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
2
2
 0.3   1  1.333 
  53.57 sec
Average time in queue  90 

1

0
.
3
2



Waiting Time Formula above is a restatement of Pollaczek-Khinchin (PK) Formula:
PK Formula: 𝑇𝑞 =
1
=𝑝
utdallas.edu/~metin
1
𝑆𝑒𝑐𝑜𝑛𝑑 𝑚𝑜𝑚𝑒𝑛𝑡 𝑜𝑓 𝑎𝑐𝑡𝑖𝑣𝑖𝑡𝑦 𝑡𝑖𝑚𝑒
𝑎 1−𝑝/𝑎
𝑝/𝑎
=𝑝
2
1
𝑝2 +Variance of activity time
1−𝑝/𝑎 𝑝2
𝑝/𝑎 1+𝐶𝑉𝑝2
1−𝑝/𝑎
2
=𝑝
2
𝑢 1+𝐶𝑉𝑝2
1−𝑢
2
19
Bank Teller Example

An average of 10 customers per hour come to a bank teller who serves each
customer in 4 minutes on average. Assume exponentially distributed
interarrival and service times.
(a) What is the teller’s utilization?
(b) What is the average time spent in the queue waiting?
(c) How many customers would be waiting for this teller or would be serviced by this
teller on average?
(d) On average, how many customers are served per hour?
Deterministic Counterpart
Answer: p=4 mins; a=6 mins=60/10
p 4
  0.66
a 6
2
2
 0.66   1  1 
  8
b) Tq  4 

 1  0.66   2 
a) u 
Arrive
Arrive
4 minutes
2 mins
Depart
4 minutes
2 mins
Depart
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
Average  p  Time in queue
2
2
flow
 utilizatio n   CVa  CV p 
time T
 p  Activity Time  
 
 1  utilizatio n  
2


Increasing
Variability
Theoretical Flow Time
utdallas.edu/~metin
Utilization
100%
21
Computing Tq with m Parallel Servers
Inventory in the system I=Iq+ Ip
Inventory
in service Ip
Inventory
waiting Iq
Outflow
Inflow
Entry to system
Begin Service
Waiting Time Tq
Departure
Service Time p
Flow Time T=Tq+p
utdallas.edu/~metin
22
Utilization with m servers
FlowRate
1/ a
p
Utilizatio n  u 


Capacity m * (1 / p) a m
Example: Average Activity time=p=90 seconds
Average Interarrival time=a=11.39 secs over 8-8:15
m=10 servers
Utilization=90/(10x11.39)=0.79=79%
utdallas.edu/~metin
23
Waiting Time Formula for Parallel Resources
Approximate Waiting Time Formula for Multiple (m) Servers
2
2
2 ( m 1) 1 



CV

CV
 Activity time   utilizatio n
a
p


Time in queue 


m
2

  1  utilizatio n  

Example: Average Activity time=p=90 seconds
Average Interarrival time=a=11.39 seconds
m=10 servers
CVa=1 and CVp=1.333
2 (101) 1 
2
2


1

1
.
333
 90   0.79

  24.94 sec
Time in queue  



2
 10   1  0.79  

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.
(a) Estimate the average customer wait before being served.
(b) How many emails would there be -- on average -- that have been
submitted to the online retailer, but not yet answered?
Answer: a=2 mins; CVa=1; m=3; p=4 mins; CVp=0.5
a) Find Tq. b) Find Iq=(1/a)Tq
utdallas.edu/~metin
25
Service Levels in Waiting Systems
Fraction of
customers who
have to wait x
seconds or less
90% of calls had to
wait 25 seconds or
less
1
Waiting times for those customers
who do not get served immediately
0.8
0.6
0.4
Fraction of customers who get served
without waiting at all
0.2
0
0
50
100
150
200
Waiting time [seconds]
• Target Wait Time (TWT)
• Service Level = Probability{Waiting TimeTWT}; needs distribution of waiting time
• Example: Deutsche Bundesbahn Call Center
- now (2003): 30% of calls answered within 20 seconds
- target: 80% of calls answered within 20 seconds
utdallas.edu/~metin
26
Bank of America’s Service Measures
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
• Variability leads to waiting times although utilization<100%
• Use the Waiting Time Formula to
- get a quantitative feeling of the system
- analyze specific recommendations / scenarios
• Adding capacity is expensive, although some safety capacity is necessary
• 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
3. Compute expected waiting time
2 ( m 1) 1  
CVa2  CV p2
 Activity time   utilizatio n



Tq 



m
1

utilizatio
n
2

 
 




4. Based on Tq , we can compute the remaining performance measures as
Flow time T=Tq+p
Inventory in service Ip=m*u
Inventory in the queue=Iq=Tq/a
Inventory in the system I=Ip+Iq
utdallas.edu/~metin
29
Staffing levels
Cost of direct labor per serviced unit
Cost of Direct Labor 
Total wages per time
m x (wages per time) p x (wages per time)


Flow rate  Arrival rate
1/a
u
Because ma=p/u
Ex: $10/hour wage for each CSR; m=10
Activity time=p=90 secs; Interarrival time=11.39 secs
1-800 number line charge $0.05 per minute
p
90

 0.79
m x a 10x11.39
1.5 min/call x (16.66 cents/min)
Cost of Direct Labor 
 31.64 cents/call
0.79
Recall T  1.916; Cost of line charge per call  1.916x 0.05  $0.0958 / call
Utilization  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

 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
Utilization  u 
2 ( 9 1) 1 
2
2


1

1
.
333
 90   0.878

  10 * 5.218 *1.39  72.54 sec
Time in queue  



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
charge per call 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
Number of
CSRs
Number of customers
Per 15 minutes
160
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
140
120
100
80
60
40
20
utdallas.edu/~metin
Time
23:00
21:15
19:30
17:45
16:00
14:15
12:30
10:45
9:00
7:15
5:30
3:45
2:00
0:15
0
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
(m=2)
10.00
m=10
0.00
60%
65% 70%
75%
Implications:
+ balanced utilization
80%
85%
90%
95%
Utilization u
+ Shorter waiting time (pooled safety capacity)
utdallas.edu/~metin
- Change-overs / set-ups
Service-Time-Dependent Priority Rules
• Flow units are sequenced in the waiting area (triage step)
• Shortest Processing Time (SPT) Rule
- Minimizes average waiting time
• Do you want to wait for a short process or a long one?
A
Service times:
A: 9 minutes
B: 10 minutes
C: 4 minutes
D: 8 minutes
C
B
9 min.
19 min.
23 min.
4 min.
D
12 min.
C
D
Total wait time: 9+19+23=51min
21 min.
B
Total wait time: 4+12+21=37 min
• Problem of having “true” processing times
utdallas.edu/~metin
A
Service-Time-Independent Priority Rules
•Sequence based on importance
- emergency cases; identifying profitable flow units
•First-Come-First-Serve
- easy to implement; perceived fairness
•The order in which customers are served does Not affect the average waiting time.
•W(t): Work in the system
•An arrival at t waits until the work W(t) is completed
W(t)
p2
p1
utdallas.edu/~metin
First
arrival
Second
arrival
Last
departure
Time t
Service-Time-Independent Order does not
affect the waiting time
Order: 1-1-2
Order: 1-2-1
W(t)
W(t)
First finishes
Time t
Second finishes
Time t
Work is conserved even when the processing order changes.
No matter what the order is, the third arrival finds the same amount of work W(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