Queueing theory

Queueing theory is the mathematical study of waiting lines, or queues. A queueing model is constructed so that queue lengths and waiting time can be predicted. Queueing theory is generally considered a branch of operations research because the results are often used when making business decisions about the resources needed to provide a service.
Queueing theory has its origins in research by Agner Krarup Erlang when he created models to describe the system of Copenhagen Telephone Exchange company, a Danish company. The ideas have since seen applications including telecommunication, traffic engineering, computing
and, particularly in industrial engineering, in the design of factories, shops, offices and hospitals, as well as in project management.
Spelling.
The spelling "queueing" over "queuing" is typically encountered in the academic research field. In fact, one of the flagship journals of the field is "Queueing Systems".
Single queueing nodes.
A queue, or queueing node can be thought of as nearly a black box. Jobs or "customers" arrive to the queue, possibly wait some time, take some time being processed, and then depart from the queue.
The queueing node is not quite a pure black box, however, since some information is needed about the inside of the queuing node. The queue has one or more "servers" which can each be paired with an arriving job until it departs, after which that server will be free to be paired with another arriving job.
An analogy often used is that of the cashier at a supermarket. There are other models, but this is one commonly encountered in the literature. Customers arrive, are processed by the cashier, and depart. Each cashier processes one customer at a time, and hence this is a queueing node with only one server. A setting where a customer will leave immediately if the cashier is busy when the customer arrives, is referred to as a queue with no buffer (or no "waiting area", or similar terms). A setting with a waiting zone for up to "n" customers is called a queue with a buffer of size "n".
Birth-death process.
The behaviour of a single queue (also called a "queueing node") can be described by a birth–death process, which describes the arrivals and departures from the queue, along with the number of jobs (also called "customers" or "requests", or any number of other things, depending on the field) currently in the system. An arrival increases the number of jobs by 1, and a departure (a job completing its service) decreases "k" by 1.
Balance equations.
The steady state equations for the birth-and-death process, known as the balance equations, are as follows. Here formula_1 denotes the steady state probability to be in state "n".
The first two equations imply
and
By mathematical induction,
The condition formula_8 leads to:
which, together with the equation for formula_1 formula_11, fully describes the required steady state probabilities.
Kendall's notation.
Single queueing nodes are usually described using Kendall's notation in the form A/S/"c" where "A" describes the distribution of durations between each arrival to the queue, "S" the distribution of service times for jobs and "c" the number of servers at the node. For an example of the notation, the M/M/1 queue is a simple model where a single server serves jobs that arrive according to a Poisson process (where inter-arrival durations are exponentially distributed) and have exponentially distributed service times (the M denotes a Markov process). In an M/G/1 queue, the G stands for "general" and indicates an arbitrary probability distribution for service times.
Example analysis of an M/M/1 queue.
Consider a queue with one server and the following characteristics:
Further, let "E""n" represent the number of times the system enters state "n", and "L""n" represent the number of times the system leaves state "n". Then for all "n", |"E""n" − "L""n"| ∈ {0, 1}. That is, the number of times the system leaves a state differs by at most 1 from the number of times it enters that state, since it will either return into that state at some time in the future ("E""n" = "L""n") or not (|"E""n" − "L""n"| = 1).
When the system arrives at a steady state, the arrival rate should be equal to the departure rate.
Thus the balance equations
imply
The fact that formula_16 leads to the geometric distribution formula
where formula_18
Simple two-equation queue.
A common basic queuing system is attributed to Erlang, and is a modification of Little's Law. Given an arrival rate "λ", a dropout rate "σ", and a departure rate "μ", length of the queue "L" is defined as:
Assuming an exponential distribution for the rates, the waiting time "W" can be defined as the proportion of arrivals that are served. This is equal to the exponential survival rate of those who do not drop out over the waiting period, giving:
The second equation is commonly rewritten as:
The two-stage one-box model is common in epidemiology.
Overview of the development of the theory.
In 1909, Agner Krarup Erlang, a Danish engineer who worked for the Copenhagen Telephone Exchange, published the first paper on what would now be called queueing theory. He modeled the number of telephone calls arriving at an exchange by a Poisson process and solved the M/D/1 queue in 1917 and M/D/"k" queueing model in 1920. In Kendall's notation:
If there are more jobs at the node than there are servers, then jobs will queue and wait for service
The M/G/1 queue was solved by Felix Pollaczek in 1930, a solution later recast in probabilistic terms by Aleksandr Khinchin and now known as the Pollaczek–Khinchine formula.
After the 1940s queueing theory became an area of research interest to mathematicians. In 1953 David George Kendall solved the GI/M/"k" queue and introduced the modern notation for queues, now known as Kendall's notation. In 1957 Pollaczek studied the GI/G/1 using an integral equation. John Kingman gave a formula for the mean waiting time in a G/G/1 queue: Kingman's formula.
Leonard Kleinrock worked on the application of queueing theory to message switching in the early 1960s and packet switching in the early 1970s. His initial contribution to this field was his doctoral thesis at the Massachusetts Institute of Technology in 1962, published in book form in 1964. His theoretical work published in the early 1970s underpinned the use of packet switching in the ARPANET, a forerunner to the Internet.
The matrix geometric method and matrix analytic methods have allowed queues with phase-type distributed inter-arrival and service time distributions to be considered.
Systems with coupled orbits are an important part in queueing theory in the application to wireless networks and signal processing. 
Problems such as performance metrics for the M/G/"k" queue remain an open problem.
Service disciplines.
Various scheduling policies can be used at queuing nodes:
Server failures occur according to a stochastic process (usually Poisson) and are followed by the setup periods during which the server is unavailable. The interrupted customer remains in the service area until server is fixed. 
Arriving customers not served (either due to the queue having no buffer, or due to balking or reneging by the customer) are also known as dropouts and the average rate of dropouts is a significant parameter describing a queue.
Queueing networks.
Networks of queues are systems in which a number of queues are connected by what's known as customer routing. When a customer is serviced at one node it can join another node and queue for service, or leave the network.
For networks of "m" nodes, the state of the system can be described by an "m"–dimensional vector ("x"1, "x"2, ..., "x""m") where "x""i" represents the number of customers at each node.
The simplest non-trivial network of queues is called tandem queues. The first significant results in this area were Jackson networks, for which an efficient product-form stationary distribution exists and the mean value analysis which allows average metrics such as throughput and sojourn times to be computed. If the total number of customers in the network remains constant the network is called a closed network and has also been shown to have a product–form stationary distribution in the Gordon–Newell theorem. This result was extended to the BCMP network where a network with very general service time, regimes and customer routing is shown to also exhibit a product-form stationary distribution. The normalizing constant can be calculated with the Buzen's algorithm, proposed in 1973.
Networks of customers have also been investigated, Kelly networks where customers of different classes experience different priority levels at different service nodes. Another type of network are G-networks first proposed by Erol Gelenbe in 1993: these networks do not assume exponential time distributions like the classic Jackson Network.
Routing algorithms.
In discrete time networks where there is a constraint on which service nodes can be active at any time, the max-weight scheduling algorithm chooses a service policy to give optimal throughput in the case that each job visits only a single person service node. In the more general case where jobs can visit more than one node, backpressure routing gives optimal throughput. A network scheduler must choose a queuing algorithm, which affects the characteristics of the larger network. See also Stochastic scheduling for more about scheduling of queueing systems.
Mean field limits.
Mean field models consider the limiting behaviour of the empirical measure (proportion of queues in different states) as the number of queues ("m" above) goes to infinity. The impact of other queues on any given queue in the network is approximated by a differential equation. The deterministic model converges to the same stationary distribution as the original model.
Heavy traffic/diffusion approximations.
In a system with high occupancy rates (utilisation near 1) a heavy traffic approximation can be used to approximate the queueing length process by a reflected Brownian motion, Ornstein–Uhlenbeck process, or more general diffusion process. The number of dimensions of the Brownian process is equal to the number of queueing nodes, with the diffusion restricted to the non-negative orthant.
Fluid limits.
Fluid models are continuous deterministic analogs of queueing networks obtained by taking the limit when the process is scaled in time and space, allowing heterogeneous objects. This scaled trajectory converges to a deterministic equation which allows the stability of the system to be proven. It is known that a queueing network can be stable, but have an unstable fluid limit.