Beruflich Dokumente
Kultur Dokumente
This article may be used only for the purposes of research, teaching, and/or private study. Commercial use
or systematic downloading (by robots or other automatic processes) is prohibited without explicit Publisher
approval, unless otherwise noted. For more information, contact permissions@informs.org.
The Publisher does not warrant or guarantee the articles accuracy, completeness, merchantability, fitness
for a particular purpose, or non-infringement. Descriptions of, or references to, products or publications, or
inclusion of an advertisement in this article, neither constitutes nor implies a guarantee, endorsement, or
support of claims made of that product, publication, or service.
INFORMS is the largest professional society in the world for professionals in the fields of operations research, management
science, and analytics.
For more information on INFORMS, its publications, membership, or meetings visit http://www.informs.org
INGOLFSSON & GROSSMAN
Graphical Spreadsheet Simulation of Queues
School of Business
ing simulation (Grossman, 1999), with the relevant
University of Alberta material summarized in sections 2-4. The contribu-
Edmonton, Alberta T6G 2R6, Canada tion of this paper (sections 5-8) is the development
Armann.Ingolfsson@UAlberta.Ca and use of "live" simulation graphs to provide a rich
visual means for understanding queues and simula-
Thomas A. Grossman, Jr. tion, and techniques for using these graphs to moti-
Faculty of Management vate students, enhance their learning, and stimulate
University of Calgary their interest in simulation.
2500 University Dr. NW The queueing simulation and their graphical repre-
Calgary, Alberta, Canada T2N 1N4 sentations were implemented in Microsoft Excel 97,
grossman@UCalgary.ca and any specific instructions below refer to this soft-
ware package.
Abstract 1. Introduction
Graphical representations of spreadsheet queueing Queuing theory has always been a staple in survey
simulations can be used to teach students about courses on management science. Queueing theory
queues and queueing processes. A customer graph is a powerful tool for computing certain steady-state
shows the experience of every individual customer queue performance measures. However, queueing
in a queue, based on arrival time, start of service, theory is a poor vehicle for teaching students about
end of service, and showing clearly the length of what transpires in queues. For example, queueing
time in queue and service time for each individual theory tells us that, other things being equal, a queue
customer. The cumulative effect is powerful, illus- with higher service time variability has longer aver-
trating how one long service time (or short age queueing time than a queue with lower variabil-
interarrival time) can cause delays for many succeed- ity. (Note that we are using "queueing theory" to
ing customers. The server graph (a Gantt chart) mean what it usually means to students taking a sur-
shows the experience of each server, illustrating how vey course in management science: a small collec-
customers stack up, and the nature of periods of idle tion of formulas, typically for single server Mark-
time. The graphs are linked to a spreadsheet simula- ovian queues.) However, queueing theory yields no
tion and update instantly when the simulation is rep- insight into why this occurs.
licated. The graphs illustrate the complete evolution Spreadsheet queueing simulation can be used to give
of a queue (which simulation animations cannot do) students insight into queue behavior -- why queues
and help provide a holistic view of queues. They form, why they persist, the role of variability, and
can be used to teach students about the nature of the non-linear effect of increasing utilization on
queues and support active learning where the stu- queue performance. In this paper we extend previ-
dents articulate for themselves the cause of queue ous work on spreadsheet queueing simulation to pro-
behaviors. vide a graphical representation of queue behavior.
This graphical representation, which is connected
to a live simulation model, allows students to ar-
ticulate for themselves powerful insights about queue
27
INFORMS Transcations on Education 2:2 (27-39) INFORMS
INGOLFSSON & GROSSMAN
Graphical Spreadsheet Simulation of Queues
behavior. This enhances their intuition about queues 3. Overview of Simulating Queues in Spread-
and stochastic phenomena in general, and gives them sheets
a solid foundation to utilize queueing theory formu-
Any spreadsheet model can be simulated using tech-
las when appropriate.
niques that can be found in survey textbooks such
as Ragsdale (1998) or Winston and Albright (1997).
Downloaded from informs.org by [202.67.38.6] on 10 September 2017, at 04:15 . For personal use only, all rights reserved.
28
INFORMS Transcations on Education 2:2 (27-39) INFORMS
INGOLFSSON & GROSSMAN
Graphical Spreadsheet Simulation of Queues
start 9:00
1 1 9:01 3 9:01 9:04 0:00 0:03
2 1 9:02 9 9:02 9:11 0:00 0:09
3 1 9:03 9 9:04 9:13 0:01 0:10
4 3 9:07 9 9:11 9:20 0:04 0:13
5 3 9:10 9 9:13 9:22 0:03 0:12
Figure 1: A two-server queueing simulation template. The entries in bold are included on the template.
Students use the bold entries to compute the italicized entries.
29
INFORMS Transcations on Education 2:2 (27-39) INFORMS
INGOLFSSON & GROSSMAN
Graphical Spreadsheet Simulation of Queues
Figure 2: interactive version (opens new window; 5.1 The Customer Graph
requires Internet Explorer 4.01 or later)
Figure 3 shows the "customer graph". The horizon-
We now discuss the key idea of this paper, which is tal axis measures time. The vertical axis displays
to represent graphically the results of a spreadsheet the customer number, with customer 1 the first to
queueing simulation such as the one shown in Fig- arrive, customer 2 the second to arrive, etc. (column
Downloaded from informs.org by [202.67.38.6] on 10 September 2017, at 04:15 . For personal use only, all rights reserved.
30
INFORMS Transcations on Education 2:2 (27-39) INFORMS
INGOLFSSON & GROSSMAN
Graphical Spreadsheet Simulation of Queues
When the simulation is replicated (that is, the spread- up by vertical lines to show when the server fin-
sheet is recalculated, by pressing the F9 key), the ished serving one customer and immediately began
customer graph is updated instantly and automati- serving the next customer.
cally. The updated graph reflects new samples from
the interarrival and service time distributions, and
the corresponding customer arrival times, service Like the customer graph, the server graph is updated
Downloaded from informs.org by [202.67.38.6] on 10 September 2017, at 04:15 . For personal use only, all rights reserved.
start times, and service end times. instantaneously when the simulation is replicated
(that is, the spreadsheet is recalculated).
Figure 5 shows both the customer and server graphs
5.2 The Server Graph
for three replications. When viewed in a web
Figures 4 shows the "server graph" (a Gantt chart) browser, the Figure cycles automatically through the
corresponding to the same replication as Figure 3. three replications.
The horizontal axis measures time. The vertical axis
shows the server index. The server graph represents
each server by a horizontal bar whose length equals
the duration of the simulation. Each server bar is
divided into sections whose color indicates whether
the server was busy (serving a customer) or idle dur-
ing that time interval. The busy sections are broken
31
INFORMS Transcations on Education 2:2 (27-39) INFORMS
INGOLFSSON & GROSSMAN
Graphical Spreadsheet Simulation of Queues
Downloaded from informs.org by [202.67.38.6] on 10 September 2017, at 04:15 . For personal use only, all rights reserved.
Figure 5: Customer and server graphs. When viewed in a web browser, the Figure will cycle through
three different replications of the simulation.
5.3. Programming the Spreadsheet Queueing Simu- The steps for constructing the customer graph are:
lation Graphs 1 Program in this order each customer's arrival
It is easy to program the spreadsheet queueing simu- time, time in queue, and time in service.
lation graphs. However, some non-standard tech- 2 Graph these data using Excel's built-in "stacked
niques are required. We summarize here the steps bar chart."
required to program the graphs in Microsoft Excel
97. 3 Format the arrival time series to have no area
and no border (this makes the series invisible
on the chart).
4 Format one of the visible series (time in queue
or time in service) to have zero gap width
32
INFORMS Transcations on Education 2:2 (27-39) INFORMS
INGOLFSSON & GROSSMAN
Graphical Spreadsheet Simulation of Queues
(double-click the series and choose the options 6. Uses of the Spreadsheet Queueing Simulation
tab). The zero gap width will be applied to both Graphs
visible series. Now, one can interpret the upper
The spreadsheet queueing graphs help communicate
envelope of the bars to be the cumulative num-
clearly the function of a complex model. Although
ber of arrivals to the system as a function of time.
we have students in class fill out by hand the tem-
Downloaded from informs.org by [202.67.38.6] on 10 September 2017, at 04:15 . For personal use only, all rights reserved.
Constructing the server graph is more complicated plate in Figure 1, the richness of the model does not
than constructing the customer graph. The steps are seem to be fully appreciated until the moment we
as follows. recalculate the worksheet while viewing the cus-
tomer graph. In addition, repeated replications seem
1.Create a column for each server that contains
to help students more fully internalize the function
all the start and end times of services performed
of simulation models. In contrast to queueing theory
by that server, sorted in ascending order. Excel's
formulas (and to some extent simulation packages)
SMALL(range, i) function (which finds the i-th
the spreadsheet simulation is not a black box. Stu-
smallest number in range) can be used to do this,
dents can do the simulation by hand, and hence it is
assuming all the start and end times for a par-
easier to grasp the functioning of the model.
ticular server are in a contiguous range (for ex-
ample, see columns E and F in Figure 2, for Because of the rich graphical presentation, complex
server 1). data are easily interpreted, particularly by students
with weak quantitative skills. With some facilita-
2.Select the columns corresponding to all the serv-
tion from their instructor, students can articulate the
ers and plot them using Excel's built-in clustered
insights themselves. This reduces their dependence
bar chart. Instruct Excel that the data is orga-
on the instructor. Such active learning presumably
nized in rows, rather than columns.
results in deeper understanding and better long-term
3.Format one of the series to have an overlap of retention.
100.
Students can see for themselves the impact of vari-
4.Reverse the order of the series. ability by observing multiple replications of two
5.Change the area color of the series so they alter- models that differ only in the variance of service
nate - corresponding to busy and idle intervals. time. This in turn leads to student insights into why
queues form -- particularly when utilization (arrival
The customer and server graphs display time on the rate divided by total service rate) is significantly
horizontal axis using Excel's time format, assuming lower than 100%. Likewise, the simulation model
the underlying data is formatted to display as time. can quickly be programmed to have a very brief
Unfortunately, Excel defaults to using rather strange interarrival time, or a very long service time (or one
times to display on the horizontal axis, such as 8:38. can hit F9 several times until such an effect occurs)
The Appendix shows VBA code that overcomes this so students can observe. This helps students under-
problem. The code executes every time the stand why queues persist after forming. These in-
worksheet recalculates (and therefore, every time the sights are not possible with queueing theory formu-
simulation is replicated). It sets the lower and upper las, and are harder to obtain with simulation anima-
limits on the time axis to be the ones specified for tions.
the simulation and chooses approximately ten time
instants to display between the upper and lower lim- The utilization performance measure often indicates
its. The interval between two consecutive displayed that servers have idle time. It is attractive to devote
times is constrained to be a multiple of 5 minutes. this idle time to useful work, but this is problematic
in many real situations. The server graph shows the
nature of server idle time, and allows students to
observe the challenge of harnessing the idle time
periods. The graph makes obvious the stochastic
33
INFORMS Transcations on Education 2:2 (27-39) INFORMS
INGOLFSSON & GROSSMAN
Graphical Spreadsheet Simulation of Queues
nature of server idle time, which makes difficult any Then the average arrival rate of customers is
attempt to plan useful work between customers. The
= A(t)/t (1)
server graph also shows the length of server idle
periods, highlighting that they are often too short to Now let
be useful. F(t) = area of shaded region from 0 to t in Figure 6
Downloaded from informs.org by [202.67.38.6] on 10 September 2017, at 04:15 . For personal use only, all rights reserved.
34
INFORMS Transcations on Education 2:2 (27-39) INFORMS
INGOLFSSON & GROSSMAN
Graphical Spreadsheet Simulation of Queues
departed after receiving service. Unfortunately, many will have to make sure the arrival time of a cus-
of the numbers are missing. Some students might tomer is always less than or equal to the "arrival at
have seen examples of imperfect data sets in a prior tap" time for that customer, if it is known.
statistics course. If the data set can be thought of as
The missing departure times can also be estimated
consisting of several independent draws from the
fairly easily. One can estimate the average service
same distribution, then one option is to simply re-
Downloaded from informs.org by [202.67.38.6] on 10 September 2017, at 04:15 . For personal use only, all rights reserved.
Some of the missing data are easy to estimate, par- where the customer graph can help.
ticularly the arrival times. For example, a reason- Figure 8 shows a customer graph for the data shown
able estimate for the missing arrival time for cus- in Figure 7, after the missing arrival times and de-
tomer 72 would be the average of the arrival times parture times have been estimated as explained
of customers 71 and 73. When several arrival times above. The "arrival at tap" times have been set equal
in a row are missing (such as for customers 74-76) to the arrival time of the respective customers, to
one can estimate the missing times such they are provide initial estimates.
equally spaced between the last known arrival time
and the next known arrival time. In addition, one
35
INFORMS Transcations on Education 2:2 (27-39) INFORMS
Figure 8: Customer gr
INGOLFSSON & GROSSMAN
Graphical Spreadsheet Simulation of Queues
Downloaded from informs.org by [202.67.38.6] on 10 September 2017, at 04:15 . For personal use only, all rights reserved.
A close look at Figure 8 shows that the "arrival at The customer graph can also be used to examine the
tap" time for customer 72 must be adjusted from its validity of assumptions about how the system oper-
current value of 8:26:30. A server does not become ates. For example, we notice that customer 74 de-
available until 8:27, when customer 70 departs. The parts from service before customer 73 enters ser-
next customer with missing "arrival at tap" data is vice. So the queue does not operate in a truly first-
customer 74. From the queueing graph, we see that come-first-serve manner at all times (and this is not
this customer will not have access to a server until an artifact of how we estimated the missing data -
customer 72 departs, at 8:30. Continuing in this fash- the "arrival at tap" for customer 73 and the depar-
ion we can replace all the missing "arrival at tap" ture time of customer 74 were both recorded). The
times with estimates that are at least consistent with customer graph also shows that customers 71, 73,
how the system operates. and 76 are all receiving service simultaneously, de-
It is even possible to do the estimation graphically spite the system having only two servers (again, this
in Excel, by grabbing the vertical line correspond- is based on numbers that were actually recorded,
ing to an "arrival at tap" time and moving it. When not our estimates of missing number). Apparently,
one does this, Excel brings up the goal seek dialog customers "shared servers" at certain times.
box, and asks what "changing cell" to use. Enter the It is easy to throw one's hands up in frustration and
cell with the missing "arrival at tap" data and click ask for better data, but in reality that might not be an
OK, and Excel will adjust the data to correspond to option. Customer graphs can help pre-process the
the new position of the vertical line in the graph. data in an intelligent way to allow the best analysis
Some students enjoy applying this procedure because that is possible, given the quality of the data. Queue-
the can concentrate on the graphical representation ing graphs also help the analyst see whether assump-
rather than precise numbers on the time scale, but tions about how the system operates are supported
for other students the complexity of the procedure by the data.
is an impediment.
36
INFORMS Transcations on Education 2:2 (27-39) INFORMS
INGOLFSSON & GROSSMAN
Graphical Spreadsheet Simulation of Queues
7.3 Linking Transactional Data to Macroscopic Pa- graph makes the basic concepts of simulation very
rameters clear to students. It also shows how simulation (in a
spreadsheet or in dedicated simulation software) can
The customer graph displays almost all there is to
be used to model complex business processes.
know about a queueing system in one picture. To
use a term coined by Edward R. Tufte [Tufte, 1983], Graphical spreadsheet queueing simulation is a
Downloaded from informs.org by [202.67.38.6] on 10 September 2017, at 04:15 . For personal use only, all rights reserved.
the customer graph has a high data-ink ratio. The strong lead-in to traditional queueing theory results.
average arrival rate to the system (l) can be visual- Students develop intuition regarding queues in gen-
ized as the (average) slope of the A(t) curve in Fig- eral. They easily grasp the distinctions among one
ure 7, and estimated numerically as A(t)/t as dis- arrival, one particular day's queue (or one replica-
cussed above. The number in system at any time t tion), average performance in a single day, and av-
can be visualized as the vertical distance between erage performance across many days. It is easier for
A(t) and D(t). The average number in system (L) students to understand the meaning of queueing
can be visualized as the average vertical distance theory results, and to appreciate the limitations of
between A(t) and D(t). Hence, the customer graph the average results that most queueing theory mod-
can be used to illustrate both such macroscopic pa- els yield. In turn, the hard work required to imple-
rameters as l and L, and microscopic transactional ment a spreadsheet queueing simulation makes them
data (arrival time, waiting time, service time) for appreciate the speed with which queueing theory
every customer -- all in one picture. This can help to provides results.
explain the link between the detailed behavior of a
Finally, spreadsheet queueing simulation increases
queue over time (which students usually understand
student interest in learning simulation software (and
easily) and average measures of performance, such
taking elective courses in simulation). Business stu-
as L and W (which students usually have more dif-
dents find spreadsheet simulation of queues to be
ficulty interpreting).
inherently interesting. This makes them excited
about simulation in general. However, programming
spreadsheet queueing simulations, even with the
7.4. The Effect of Increasing Utilization on Queues
templates in Grossman (1999) can be cumbersome.
As a first order approximation, many students be- When we demonstrate a simulation package such as
lieve intuitively that utilization less than 100% means Arena and indicate that a queue which requires hours
that no queue should form. The customer graph al- of spreadsheet programming can be programmed in
lows them to see that a queue does form if there is under 1 minute in Arena, students take note. Simu-
variability in arrivals or service, and the size of the lation elective enrolments have increased since we
queue increases non-linearly as utilization gets close started using spreadsheet queueing simulation in the
to 100%. They can articulate for themselves why required course.
this is so.
9. Conclusions
8. Benefits of Spreadsheet Queueing Simulation
We discussed the use of spreadsheet queueing simu-
Graphs
lation graphs to enhance student understanding of
The use of spreadsheet queueing simulation graphs queues and of simulation. Use of this technique
can enhance student understanding of queues. By seems to increase student interest in elective courses
providing a rich visual representation of the com- in simulation.
plete evolution of a queue, complex queue behavior
We look forward to using the server graph in re-
can be presented to students so that they can articu-
search work with call center managers exploring the
late the insights themselves, rather than relying on
possibility of mixed inbound-outbound call centers
the instructor for wisdom. The ease with which rep-
where outbound calls are made during periods of
lications can be made and instantly presented on the
37
INFORMS Transcations on Education 2:2 (27-39) INFORMS
INGOLFSSON & GROSSMAN
Graphical Spreadsheet Simulation of Queues
idleness in a pure inbound call center. It is difficult ' will be a multiple of 5 minutes.
to understand and communicate the size and stochas-
tic nature of the time windows for outbound calls. X = Int(X / 10 / 5 + 1)
The server graph provides a powerful stochastic rep- For I = 1 To N
resentation of these time windows. With
Downloaded from informs.org by [202.67.38.6] on 10 September 2017, at 04:15 . For personal use only, all rights reserved.
ActiveSheet.ChartObjects(I).Chart.Axes(xlValue)
.MinimumScale = [start_time]
10. Appendix
.MaximumScale = [close_time]
10.1 Software Downloads
.MajorUnit = 1 / 24 / 60 * 5 * X
A family of spreadsheet queueing templates with End With
customer and server graphs for queues with balk-
Next I
ing, reneging, and both balking and reneging can be
downloaded from http://www.bus.ualberta.ca/ End Sub
aingolfsson/simulation/ [local copy] .
38
INFORMS Transcations on Education 2:2 (27-39) INFORMS
INGOLFSSON & GROSSMAN
Graphical Spreadsheet Simulation of Queues
and Operations Management, sixth edition, Rich- Ragsdale, C. T. (1998), Spreadsheet Modeling and
ard D. Irwin, Chicago, IL. Decision Analysis, second edition, South-Western
College Publishing, Cincinnati, OH.
Clauss, F. J. (1996), Applied Management Science
and Spreadsheet Modeling, Duxbury Press, Belmont, Tufte, E. R. (1983), The Visual Display of Quantita-
CA. tive Information, Graphics Press, Cheshire, CT.
Evans, J. R. and D. L. Olson (1998), Introduction to Winston, W. L. (1996), Simulation Modeling Using
Simulation and Risk Analysis, Prentice Hall, Upper @RISK, Duxbury Press, Belmont, CA.
Saddle River, NJ.
Winston, W. L. and S. C. Albright (1997), Practical
Evans, J.R. (2000), "Spreadsheets as a Tool for Management Science, Spreadsheet Modeling and
Teaching Simulation", INFORMS Transactions on Applications, Duxbury Press, Belmont, CA.
Education, Vol. 1, No. 1, http://ite.informs.org/
Vol1No1/evans/evans.html
Grossman, T. A., Tran, K. and Ursu, G.D. (1997),
"Prospects and techniques for dynamic discrete event
simulation in spreadsheets," Proceedings of the In-
ternational Association of Science and Technology
for Development International Conference on Ap-
plied Modelling and Simulation, Banff, Canada, July,
available at http://www.ucalgary.ca/~grossman/
simulation/history.htm.
Grossman, T. A. (1999), "Spreadsheet Modeling and
Simulation Improves Understanding of Queues,"
Interfaces vol.29, no.3, pp.88-103. Templates avail-
able from http://www.ucalgary.ca/~grossman/simu-
lation/ .
Hesse, R. (1997), Managerial Spreadsheet Model-
ing and Analysis, Richard D. Irwin, Chicago, IL.
Kleinrock, L. (1975), Queueing Systems, Volume 1:
Theory, John Wiley and Sons, New York, NY.
Lawrence, J. A. and B.A. Pasternack (1998), Ap-
plied Management Science, a Computer-Integrated
Approach for Decision Making, John Wiley and
Sons, New York, NY.
Liberatore, M. J. and R. L. Nydick (1999), "Break-
ing the mold: A new approach for teaching the first
MBA management science course," Interfaces,
vol.29, no.4, pp.99:116.
39
INFORMS Transcations on Education 2:2 (27-39) INFORMS