Professional Documents
Culture Documents
Queuing Theory PDF
Queuing Theory PDF
Introduction
9 Queues (waiting line) are a part of everyday life.
9 Providing too much service involves excessive costs. And not providing
enough service capacity causes the waiting line to become excessively long.
9 The ultimate goal is to achieve an economic balance between the cost of service
and the cost associated with the waiting for that service.
9 Queueing theory is the study of waiting in all these various guises.
Prototype Example—Doctor Requirement in a Emergence Room
9 Consider assigning an extra doctor to the emergency room, which has one
doctor already.
9 How much can we reduce the average waiting time for patients if the extra
doctor is hired?
Basic Structure of Queueing Models
Queueing system
Queue Discipline
9 Queue
¾ The queue is where customers wait before being served.
¾ A queue is characterized by the maximum permissible number of
customers that it can contain. Queue may be infinite (default one) or finite.
9 Queue Discipline
¾ Refers to the order in which members of the queue are selected for service.
¾ First-come-first-serve is normally used.
9 Service Mechanism
¾ Consists of one or more service facilities, each of which contains one or
more parallel service channels, called servers.
¾ At a given facility, the customer enters one of the parallel service channels
and is served by that server.
¾ Most elementary models assume one service facility with either one or a
finite number of servers.
¾ Service time is usually defined by a probability distribution.
An Elementary Queueing Process
9 A single waiting line forms in the front of a single service facility, within which
are stationed one or more servers. Each customer is serviced by one of the
servers, perhaps after some waiting in the queue.
Queueing system
C S
Queue
C S Service
Customers CCCCCC C S facility
C S
Served customers
∞
9 Lq = expected queue length (excludes customers being served) = ∑ (n − s) P
n=s
n .
9 If the λ n are not equal, then λ can be replaced in these equation by λ , the
average arrival rate over the long time.
1
9 Assume that the mean service time ( 1 / μ ) is a constant. Thus, W = Wq + .
μ
9 These four fundamental quantities (L, W, Lq, and Wq) could be immediately
determined as soon as one is found analytically.
Examples—commercial service system, transportation service system,
internal service system, and social service system.
The Role of the Exponential Distribution
9 The mostly commonly used distribution for interarrival and service time is
exponential distribution.
9 A random variable (interarrival or service times), T, is said to have an
exponential distribution with parameter α if its probability density function is
⎧αe −αt for t≥0
f T (t ) = ⎨
⎩ 0 for t<0
9 The cumulative probabilities are P{T ≤ t} = 1 − e −αt , P{T > t} = e −αt for t ≥ 0 .
1 1
9 E (T ) = , var(T ) = .
α α2
¾ The value T takes on is more likely to be “small” [less than half of E(T))]
than “near” its expected value. Is this property real?
⎧ 1 1⎫ ⎧1 1 3 1⎫
P ⎨0 ≤ T ≤ ⎬ = 0.393 , P ⎨ ≤T ≤ ⎬ = 0.383 .
⎩ 2α⎭ ⎩2 α 2α⎭
¾ Not real when the service required is essentially identical for each
customer, with the server always performing the same sequence of service
operations.
¾ It is suitable for the situations where the specific tasks required of the
server differ among customers (hospital or banking cases).
9 Property 2: Lack of memory: P{T > t + Δt | T > Δt} = P{T > t} for any positive of t
and Δt .
¾ The probability distribution of the remaining time until the event occurs
always is the same, regardless of how much time already has passed.
¾ The process “forgets” its history.
¾ The phenomenon occurs with the exponential distribution.
¾ For interarrival time, the time until next arrival is completely uninfluenced
by when the last arrival occurred.
9 Property 3: The minimum of several independent exponential random variables
has an exponential distribution.
¾ Let T1, T2, …, Tn be independent exponential random variables with
parameters α 1 , α 2 , …, α n . Also, let U be the random variable that takes on
the value equal to the minimum of the values of T1, T2, …, Tn.
n
¾ U indeed has an exponential distribution with parameter α = ∑ α i .
i =1
9 Property 5: For all positive values of t, P{T ≤ t + Δt | T > t} ≈ αΔt , for small Δt .
∞
xn
¾ The series expansion of e for any exponent x is e x = 1 + x + ∑
x
.
n=2 n!
∞
(−αΔt ) n
¾ P{T ≤ t + Δt | T > t} = P{T ≤ Δt} = 1 − e −αΔt = 1 − 1 + αΔt − ∑ ≈ αΔt .
n=2 n!
E n (t )
9 lim
n →∞
= mean rate at which process enters state n.
t
Ln (t )
9 lim
n→∞
= mean rate at which process leaves state n.
t
9 Rate In = Rate Out Principle: for any state of the system n, mean entering rate
= mean leaving rate. The equation expressing this principle is called the balance
equation for state n.
9 Pi is the steady-state probability of being in state i.
9 Consider state 0: the mean entering rate of state 0 is μ1 P1 ; the mean leaving rate
of state is λ0 P0 . The balance equation for state 0 is μ1 P1 = λ0 P0
9 For every other state there are two possible transitions both into and out of the
state. Therefore, each side of the balance equations for these states represents
the sum of the mean rates for the two transitions involved.
9 We can write the balance equations for the other states.
9 Notice that there is always one “extra” variable in these equations. Solve P1,
P2… in term of P0.
9 Then, use the sum of all probabilities equal 1 to solve for P0.
∞
∞
⎛ ∞ ⎞
∑
n =0
Pn = 1
⎝ n =0 ⎠ n =0
∑
implies that ⎜ ∑ C n ⎟ P0 = 1 , so that P0 = ( C n ) .
−1
9 The key measures of performance for the queueing system (L, Lq, W, and Wq)
can be obtained immediately after calculating the Pn.
∞ ∞
L = ∑ nPn , Lq = ∑ ( n − s ) Pn ,
n =0 n=s
L , W = Lq ,
W=
λ
q
λ
∞
where λ is the average arrival rate over the long run and λ = ∑ λ n Pn .
n=0
¾ The service rate per busy server is μ , the overall mean service rate for n
busy servers must be nμ .
¾ Therefore, μ n = nμ when n ≤ s , and μ n = sμ when n ≥ s .
9 When the maximum mean service rate sμ exceeds the mean arrival rate λ , that
λ
is, when ρ = < 1 , a queueing system will eventually reach a steady-state
sμ
condition. We can use the results derived in the birth-and-death model.
Results for the Single-Server Case (M/M/1)
n
⎛λ⎞
9 The Cn factors reduce to C n = ⎜⎜ ⎟⎟ = ρ n , for n = 0, 1, 2, …
⎝μ⎠
−1 −1
⎛ ∞ ⎞ ⎛ 1 ⎞
9 Therefore, Pn = ρ P0 , for n = 0, 1, 2, …, where P0 = ⎜ ∑ ρ n ⎟
n
= ⎜⎜ ⎟⎟ = 1− ρ .
⎝ n =0 ⎠ ⎝1− ρ ⎠
9 Thus, Pn = (1 − ρ ) ρ n , for n = 0, 1, 2, …
∞
λ
9 Consequently, L = ∑ n(1 − ρ ) ρ n =
n =0 μ −λ
∞
λ2
9 Lq = ∑ (n − 1) Pn =
n =1 μ (μ − λ )
9 When λ ≥ μ the mean arrival rate exceeds the mean service rate, the preceding
solution “blows up”.
with parameter μ (1 − ρ ) .
1 1
9 Therefore, W = E(W ) = = .
μ (1 − ρ ) μ − λ
9 P0 =
⎡ s −1 (λ / μ ) n (λ / μ ) s 1 ⎤
= 1 / ⎢∑ + ⎥.
⎣ n =0 n! s! 1 − λ /( sμ ) ⎦
(λ / μ ) n (λ / μ ) n
9 For 0 ≤ n ≤ s, Pn = P0 . For n ≥ s, Pn = P0 .
n! s! s n − s
P0 (λ / μ ) s ρ
9 Lq =
s!(1 − ρ ) 2
1 1 λ
9 Wq = L q / λ , W = W q + , L = λ (Wq + ) = Lq +
μ μ μ
9 P{W > t} = e − μt
⎢1 + 0
(
⎡ P λ/μ s ) ⎛ 1 − e − μt ( s −1−λ / μ )
⎜⎜
⎞⎤
⎟⎟⎥
⎢⎣ s!(1 − ρ ) ⎝ s −1− λ / μ ⎠⎥⎦
s −1
9 P{Wq > t} = (1 − P{Wq = 0})e − sμ (1− ρ )t , where P{Wq = 0} = ∑ Pn .
n =0
n
⎛λ⎞
9 For n = 0, 1, 2, …, K, C n = ⎜⎜ ⎟⎟ = ρ n ; for n > K, C n = 0 .
⎝μ⎠
1− ρ 1− ρ
9 Therefore, for ρ ≠ 1 , P0 = , so that Pn = ρ n , for n = 0, 1, 2, …, K.
1− ρ K +1
1− ρ K +1
ρ ( K + 1) ρ K +1
9 Thence, L = − , Lq = L − (1 − P0 ) .
1− ρ 1 − ρ K +1
Lq ∞
L
9 W = , Wq = , where λ = ∑ λ n Pn = λ (1 − PK )
λ λ n =0
(λ / μ ) n
9 For n = 1, 2, …, s, C n = ;
n!
(λ / μ ) n
For n = s, s+1, …, K, C n = ;
s! s n − s
For n > K, Cn = 0.
(λ / μ ) n
9 Hence, For n = 1, 2,…, s, Pn = P0 ;
n!
(λ / μ ) n
For n = s, s+1,…, K, Pn = P0 ;
s! s n − s
For n > K, Pn = 0 .
⎡ s (λ / μ ) n (λ / μ ) s K
⎛ λ ⎞
n−s
⎤
where P0 = 1 / ⎢∑ + ∑ ⎜⎜ ⎟⎟ ⎥.
⎢⎣ n =0 n! s! n = s +1 ⎝ sμ ⎠ ⎥⎦
P0 (λ / μ ) s ρ
9 Lq =
s!(1 − ρ ) 2
[ ]
1 − ρ K − s − ( K − s ) ρ K − s (1 − ρ ) , where ρ = λ /( sμ ) .
s −1 s −1
9 L = ∑ nPn + Lq + s (1 − ∑ Pn ) .
n =0 n =0
9 W and Wq are obtained from these quantities as shown for the single-server case.
9 Each member of the calling population alternates between inside and outside the
queueing system.
9 Assumes that each member’s outside time has an exponential distribution with
parameter λ .
9 When n members are inside, and so N - n members are outside, the probability
distribution of the remaining time until the next arrival is the distribution of the
minimum of the remaining outside times for the latter N - n members.
¾ This distribution is exponential with parameter λn = ( N − n)λ .
Results for the Single-Server Case (s=1) for the Finite Call Population
n n
⎛λ⎞ N! ⎛ λ ⎞
9 For n ≤ N , C n = N ( N − 1)...( N − n + 1)⎜⎜ ⎟⎟ = ⎜ ⎟
⎝μ⎠ ( N − n)! ⎜⎝ μ ⎟⎠
For n > N, Cn = 0
⎡ N! ⎛ λ ⎞ n ⎤
N
9 Therefore, P0 = 1 / ∑ ⎢ ⎜⎜ ⎟⎟ ⎥
n = 0 ⎢ ( N − n)! ⎝ μ ⎠ ⎥
⎣ ⎦
n
N! ⎛ λ ⎞
Pn = ⎜ ⎟ P0 , if n = 1, 2, …, N
( N − n)! ⎜⎝ μ ⎟⎠
N
λ+μ
Lq = ∑ (n − 1) Pn = N − (1 − P0 )
n =1 λ
N
μ
L = ∑ nPn = Lq + 1 − P0 = N − (1 − P0 )
n =0 λ
L Lq
W = and Wq =
λ λ
∞ N
where λ = ∑ λn Pn = ∑ ( N − n)λPn = λ ( N − L)
n =0 n =0
Results for the Multiple-Server Case (s>1) for the Finite Call Population
n
N! ⎛λ⎞
9 For n = 0, 1, 2, …, s, Cn = ⎜ ⎟ .
( N − n)!n! ⎜⎝ μ ⎟⎠
n
N! ⎛λ⎞
For n = s, s+1, …, N, Cn = ⎜⎜ ⎟⎟ .
( N − n)! s! s n − s ⎝μ⎠
For n > N, Cn = 0 .
n
N! ⎛λ⎞
9 If 0 ≤ n ≤ s , Pn = ⎜ ⎟ P0
( N − n)!n! ⎜⎝ μ ⎟⎠
n
N! ⎛λ⎞
If s ≤ n ≤ N , Pn = ⎜⎜ ⎟⎟ P0
( N − n)! s! s n − s ⎝μ⎠
If n > N , Pn = 0
⎡ s −1 N! ⎛λ⎞
n
N
N! ⎛λ⎞ ⎤
n
9 P0 = 1 / ⎢∑ ⎜⎜ ⎟⎟ + ∑ ⎜⎜ ⎟⎟ ⎥
⎣⎢ n =0 ( N − n)!n! ⎝ μ ⎠ ⎝ μ ⎠ ⎥⎦
n−s
n = s ( N − n )! s! s
N
9 Lq = ∑ (n − s ) Pn
n=s
s −1
⎛ s −1
⎞
9 L = ∑ nPn + Lq + s⎜1 − ∑ Pn ⎟
n =0 ⎝ n =0 ⎠
λ 2σ 2 + ρ 2
Lq =
2(1 − ρ )
L = ρ + Lq
Lq
Wq =
λ
1
W = Wq +
μ
9 For any fixed expected service time 1 / μ , notice that Lq, L, Wq, and W all
increase as σ 2 is increased.
9 The PDF is f (t ) =
(μk )k t k −1e − kμt , where μ and k are strictly positive parameters
(k − 1)!
1 1 1
and k needs to be integer. Mean = , and standard deviation = .
μ k μ
9 Suppose that T1, T2, .., Tk are k independent random variables with an identical
exponential distribution whose mean is 1 /(kμ ) . Then their sum T = T1 + T2 + …
+ Tk has an Erlang distribution with parameters μ and k.
λ2 /(kμ 2 ) + ρ 2 1 + k λ2
Lq = =
2(1 − ρ ) 2k μ ( μ − λ )
1+ k λ
Wq =
2k μ ( μ − λ )
1
W = Wq +
μ
L = λW
sμ − λ s −1 r j
where A = s! s ∑ + sμ ,
r j = 0 j!
∑ λi
k
B0 = 1 , Bk = 1− i =1
,
sμ
s = number of servers
μ = mean service rate per busy server,
N
λ
λ = ∑ λi , r= .
i =0 μ
ak 1 k
λi k
λ
9 Wk = + , where a k = ∑ 2 , b0 = 1 , bk = 1 − ∑ i .
bk −1bk μ k i =1 μ i i =1 μ i
9 The waiting time for priority class 1 customers are unaffected by the presence of
lower-priority classes customers. Thus, W1 must equal W for the corresponding
one-class M/M/1 model with s = 2, μ =3, and λ = 0.2 , which yield W1 = 0.3337
hour.
¾ Waiting time in the queue for class 1 customers is
W1 − 1 / μ = 0.33370 – 0.33333 = 0.00037
9 Now consider the first two priority classes. Let W 1− 2 be the expected waiting
time in the system of a random arrival in either of these two classes.
¾ The probability is λ1 /(λ1 + λ2 ) =1/4 that this arrival is in class 1 and
λ2 /(λ1 + λ2 ) =3/4 that it is in class 2.
1 3
W 1− 2 = W1 + W2 .
4 4
¾ W 1−2 must equal W for the M/M/s model with s = 2, μ =3, and λ = 0.8,
which yields W 1−2 = W = 0.33937.
¾ We already know the value of W1, so W2 = 0.34126. W2 − 1 / μ = 0.00793.
9 Similarly, W 1−3 = 0.1W1 + 0.3W2 + 0.6W3 . W 1−3 equals W for the M/M/s model with
s = 2, μ =3, and λ = 2, which yields W 1−3 = W = 0.375. So, W3 = 0.39875.
W3 − 1 / μ = 0.06542.
Queueing Network
9 Thus far we have considered only queueing systems that have a single service
facility with one or more servers.
9 Queueing systems are sometimes actually queueing networks, i.e., networks of
service facilities where customers must receive service at some of or all these
facilities.
¾ For example, orders being processed through a job shop must be routed
through a sequence of machine groups.
Equivalence Property
9 Assume that a service facility with s servers and an infinite queue has a Poisson
input with parameter λ and the same exponential service-time distribution with
parameter μ for each server (the M/M/s model), where sμ > λ . Then the
steady-state output of this service facility is also a Poisson process with
parameter λ .
Jackson Networks (with m facilities, i = 1, 2, …, m)
9 An infinite queue.
9 Customers arriving from outside the system according to a Poisson input
process with parameter ai.
9 Consider a Jackson network with three service facilities that have the parameter
shown below.
Pij
Facility j sj μj aj i=1 i=2 i=3
λ2 = 4 + 0.6 λ1 + 0.4 λ3
λ3 = 3 + 0.3 λ1 + 0.3 λ2
9 Each of the three facilities now can be analyzed independently by using the
formulas for the M/M/s model given before.
λi
ρi = (That is, ρ1 = 1/2, ρ 2 = 1/2, ρ 3 = 3/4).
si μ i
Pn1 =
Pn2 =
Pn3 =
9 Each server costs $20 per hour and waiting cost is $48 per hour.
9 We want to minimize 20s + 48L.
9 Use the results obtained before, we have
s L E(SC)= Css E(WC)= CwL E(TC)=E(SC)+E(WC)