Queuing Theory

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

Queuing theory

Examples are:
waiting to pay in the supermarket
waiting at the telephone for information
planes the circle before they can land

Example questions:
what is the average waiting time of a customer?
how many customers are waiting on average?
how long is the average service time?
what is the chance that one of the servers has
nothing to do?

Queuing system
Target group of
potential customers

queue

server(s)

customers

queuing system
2

Parameters of queuing systems


The behaviour of a queuing system is dependent on:

arrival process (l and distribution of interarrival times)


service process (mand distribution of service times)
number of servers
capacity of the system
size of the population for this system

Kendalls notation
A/B/c/N/K where:
A the interarrival distribution
B the service time distribution
C the number of parallel servers
N the system capacity
K the size of the target group.

abbreviations for distribution functions:


M exponential
D constant or deterministic
Ek Erlang
G General

Kendalls notation
Example:
M/M/1//
single-server system with unlimited queuing capacity and
an infinite target group. The arrival intervals and the service
times are distributed exponentially
If N and K are infinite, they can be left out of the notation.
M/M/1// is abbreviated to M/M/1

Kendalls notation
Exercises:

hairdresser with 3 chairs for a haircut and 5 waiting


chairs

6 machines that need to be serviced and 1 service


engineer with Poisson distributed service time

planes that land on one airstrip

queue in a canteen with exponentially distributed


interarrival times and constant service times

Output variables

Utilisation rate (server utilization, percentage of the


time that a server is busy, where c=the number of
parallel servers)
Probability of n customers in the system Pn
Average number of customers in the system L (service
and queue)
Average number of customers in the queue Lq
Average time spent by a customer in the system w
(service and queue)
Average time spent by a customer in the queue wq

Transient versus steady-state


behaviour

transient behaviour (from t=0)


performance indicators such as average waiting time,
average number of customers in queue, etc. are
dependent of the time, e.g. wq(t), Lq(t)

steady-state (stationary) behaviour (t )


performance indicators such as average waiting time
are not dependent of the time anymore; the probability
that the system is in a certain state is completely
independent of time, e.g. wq, Lq

Transient behaviour

history of number of customers in the system =


graph of number of customers versus time

important to know the queuing strategy:


FIFO (first in first out)
LIFO (last in first out = stack)
SIRO (service in random order)
SPT (shortest processing time first)
PR (priority)

History: hospital exercise

time

10

total number of visits by the one nurse (N)


for all N visits the starting time
for all visits the time in system by the patient
for all visits the time in queue by the patient

Markov models

11

arrival times are exponentially distributed (Poisson


process)
formulas for steady-state situation
service times are drawn from a deterministic,
exponentially, or Erlang distribution
M/M/1, M/G/1, M/Ek/1, M/D/1
M/M/1/N, M/M/c, M/M/1/K/K
formulas for e.g. Pn, L, Lq, w, wq
formulas for M/M/1 system can be derived quite easily
(not material for the exam)

Utilisation of server

12

utilisation of M/../1 is r =l /m

utilisation of M/../c is r =l /cm

if r > 1then the system is instable: on average, more


customers arrive than the system can handle

a traffic intensity a is used for systems with a finite


population

Littles equation

13

system in stationary condition

number of customers in system is L

average total time in system is w

Littles equation: L = l * w

Markov model: M/M/1

Average number of customers in system for M/M/1 in


steady-state condition

P0 * l

P1 * l

P2 * l

P3 * l

Pn-1 * l

Pn * l

.
0

P1 * m

14

P2 * m

P3 * m

State

P4 * m

Steady state, so P0 * l = P1 * m
But also: P0 * l + P2 * m= P1 * (l + m)
Pn = l n/mn* P0

Pn* m

Pn+1* m

Markov model: M/M/1 (cont.)

for the sum of P, the following equation holds:


n ="

!P

=1

n=0

the relation between Pn and P0 is:


n ="

n ="
()%
()%
&& ## * P0 = 1 = P0 ! && ##
!
n =0 ' $
n =0 ' $

15

if the system is in steady-state then l /m<1 and:

can be replaced by:

Using this, we can calculate that P0 equals:


P0 = 1 "

1
1" ! /

n="

()%
&& ##
!
n =0 ' $

Markov model: M/M/1 (cont.)


& ( #& ( #
Thus we get for Pn: Pn = $$1 ' !!$$ !!
% "% "

because for L we know that:


n=)

n=)

& *# &*#
L = ( n * Pn = ( n * $$1 ' !! * $$ !!
n =0
n =0
% " %"

16

'
=

& ' & ' #2


#
$
* 1 + + $$ !! + ......!
$
!
"
%
%
"

writing it out yields:

L=

!
"!

fill in and use Littles equation. Then we get a table with


the most important values for a M/M/1 system.

Markov model: M/M/1 (cont.)


L
w=

17

=
L
!

1
wQ = w "

LQ =

Pn

! wQ

!
"!
1
"!
!
( "! )
!2

( "! )
! ! n
= (1" )( )

Exercise: canteen with one


check-out point

18

On average, one customer per minute arrives (number


of customers per minute Poisson distributed)

Average service time is 40 seconds per customer


(exponentially distributed)

What is:
average time in system?
Average waiting time?
Average number of customers in the queue?
probability there are exactly 5 customers in the
system?

The M/G/1 system

Arrival times are exponentially distributed


service times distribution have an unknown standard
deviation s 2
steady state parameters for M/M/1 can be calculated by
substituting 2=1/2
2

L
w=

=
L
#

wQ = w $

19

LQ =
P0

=
1

# wQ

=
=
=

$2

# ( +" )
!+
2 (1$ ! )
$2
2
1 # ( +" )
+

2 (1$ ! )
$2
2
# ( +" )
2 (1$ ! )
2
$2
2
# ( +" )
2 (1$ ! )
1$ !

The M/Ek/1 system

arrival times are exponentially distributed


service times distribution is Erlang of order k
k exponential distributions after another with average
1/mand standard deviation 1/km2
steady state parameters for M/M/1 can be calculated
from M/G/1 by substituting 2=1/k2
L
w=

=
L

20

LQ =

#1

= +

"
1

"w Q

wQ = w#

!+

1+ k ! 2
2k 1# !
1+ k ! -1

2k 1# !
1+ k ! -1
2k 1# !
1+ k ! 2
2k 1# !

The M/Ek/1 system: exercise

21

blood-test for patients


3 separate doctors or assistants: blood pressure, taking
blood, discussion with doctor
on average: 15 minutes per activity (exponential) and 1
arrival per hour (Poisson)
calculate:
average number of patients in the waiting room

The M/D/1 system

arrival times are exponentially distributed


service times have no variance
steady state parameters for M/D/1 can be calculated
from M/G/1 by substituting 2=0
Note: the average queue length for M/D/1 is exactly half
of M/M/1
L
w=

=
L

"

wQ = w#
22

LQ =

"w Q

!+

1 !2

2 1# !
-1
#1 1 !
= +
2 1# !
-1
1 !
=
2 1# !
2
1 !
=
2 1# !

The M/D/1 system (exercise)

23

planes that land on a runway


one runway
30 arrivals per hour (Poisson)
90 seconds deterministic landing time
fuel costs f. 5000,- per hour
calculate:
average length of queue
average waiting time
expected total number in system
fuel costs per hour as a result of delay in queue

Relation between queuing systems


Service time
distribution
M/M/1

Variable

M/D/1

24

Number of customers in the


system
!
L=
"!

# "1
L=#+
2(1 " # )

M/G/1

Sta

dardd=1/15

M/G/1

Sta

dardd=1/10

M/G/1

# 2 (1 + $ 2 2 )
L=#+
2(1 " # )

Average waiting time in


queue
L 1
wQ = "
!
0.13

0,73

L 1
wQ = "
!

0.01

L 1
wQ = "
!

0.13

# 2 (1 + $ 2 2 )
L=#+
2(1 " # )

2.83

L 1
wQ = "
!

0.22

Standardd=1/5

# 2 (1 + $ 2 2 )
L=#+
2(1 " # )

7.33

L 1
wQ = "
!

0.67

M/E1/1

k=1

# 2 (1 + k )
L=#+
2k (1 " # )

L 1
wQ = "
!

0.13

M/E2/1

k=2

# 2 (1 + k )
L=#+
2k (1 " # )

1.67

L 1
wQ = "
!

0.1

M/E3/1

k=3

# 2 (1 + k )
L=#+
2k (1 " # )

1.55

L 1
wQ = "
!

0.09

Reducing waiting times

25

reduce number of arrivals per time unit


reduce service time
increase number of servers
decrease variance in service time

The M/M/1/N system

if the system is full, the


customer leaves
in this case, l /mis
called a
l e is the arrival
intensity of the entities
that stay in the system
le<l
calculation: l e = l (1-PN)

Parameters: see table

1 ! PN

'e
(
w

" a[1 ! (N + 1)a N + Na N +1 ]


$$
(1 ! a N + 1 )(1 ! a)
#
$N
$% 2
" 1!a N
$$
1! a N + 1
# N
$
$% N + 1
' (1 ! PN ) = (1 ! P0 ) = e
'e
= 1 ! P0

'e

'=

'&
'=

wQ

w!

LQ

' e w Q = L ! (1 ! P0 )

Pn

" (1 ! a)a n
$$
1 ! a N +1
#
1
$
$% N + 1

26

'&

'&
n = 0, 1, K , N

' =

The M/M/1/N system: exercise

27

Small travel agent with one employee


3 chairs to wait
l = 5 customers per hour (Poisson)
m= 10 customers per hour (Poisson)
calculate:
the effective arrival intensity l

The M/M/c system

more servers
if umber of customers in system n < c then new arrival
can be served immediately
stable system if l < cm
utilisation rate is not r = l /mbut r = l /cm
if r > 1 then system grows with (l -cm)

complex formulas, so often tables or graphs are used

28

The M/M/c system

29

The M/M/c system

30

The M/M/c system (exercise)

31

customers at post office


1 queue and more servers
arrival intensity 2 per minute (Poisson)
service time 40 seconds (exponential)
determine:
number of servers needed to reach steady state
probability that there are no customers in the system
with the calculated number of servers
average queue length with the calculated number of
servers

You might also like