0% found this document useful (0 votes)
157 views23 pages

Sequencing and Queue Theory

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
157 views23 pages

Sequencing and Queue Theory

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Sequencing

Sequencing problems deals with the selection of an optimum order for the number of jobs to
perform with a finite number of facilities. The objective of sequencing is to determine the
sequence of performing jobs such that we can minimize the total cost/time.
Sequencing problems arise in situations like a manufacturing plant for performing orders, in a
hospital where the patients wait for different types of tests and in a bank where customers wait
for different types of transactions, etc.

To find the optimum sequence, we first need to calculate the total elapsed time for each of the
possible sequences.

As we see earlier, even if the values of m and n are very small, it is difficult to get the sequence
what we desire with the total minimum elapsed time.
Note- Sequencing problem is the problem of finding an optimal sequence of completing a
certain number of jobs so as to minimize the total elapsed time between completion of first
and last job.
Terminologies
Processing Time: It is the time that a job i on each machine j requires.
1. Total Elapsed Time T: It is the time interval between starting the first job and completing
the last job including the idle time (if any) in a particular order by the given set of machines.
2. Idle Time: It is the time for which a machine j does not have a job to process, i.e., idle time
from the end of job (i-1) to the start of job i.
3. Processing Order: It refers to the order or sequence in which machine requires for
completing the job.
4. Number of Machines: It refers to the service facilities available through which a job must
pass before it is assumed to be completed.
5. No Passing Rule: It refers to the condition to be satisfied in which the order of jobs is to be
processed on given machines.
Assumptions
1. The processing times on different machines are exactly known and are independent of the
order of the jobs in which they are to be processed.
2. The time taken by the jobs in moving from one machine to another is negligible.

3. Once a job begins in a machine, it is to complete before another job can begin on the same
machine.

4. A job starts on a machine as soon as the previous job is over, and the machine is free to work.

5. No machine can process more than one job simultaneously.

6. Machines are of different types.

7. The order of completion of jobs are independent.

As discussed earlier, the objective of sequencing is to determine the sequence of jobs so that all
the jobs are performed in a minimum completion time from the beginning of the first job till the
completion of the last job.

The advantages of sequencing are:

1. We get the information like which machines are idle and period of idle time.

2. Completion time for all the jobs to complete

Types of Sequencing Problems–


There are four types of sequencing problems-

1. n jobs through 2 machines


2. n jobs through 3 machines
3. n jobs through m machines
4. two jobs through m machines

Johnson’s Rule in Sequencing Problems


The sequencing problem deals with determining an optimum sequence of performing a number
of jobs by a finite number of service facilities (machine) according to some pre-assigned order
so as to optimize the output. The objective is to determine the optimal order of performing the
jobs in such a way that the total elapsed time will be minimum.
Consider there are jobs 1,2,3,…….,n to be processed through m machines. (Machine A,
Machine B, Machine C, ……, Machine n). The objective is to find a feasible solution, such
that the total elapsed time is minimum. We can solve this problem using Johnson’s
method. This method provides solutions to n job 2 machines, n job 3 machines, and 2 jobs m
machines.

Johnson’s Algorithm:

Johnson’s rule in sequencing problems is as follows:

1. Find the smallest processing time on Machine 1 and Machine 2.


2. a) If the smallest value is in Machine 1 process that job first.
b) If the smallest value is in the Machine 2 process that job last.
3. a) if the minimum time for both Machine 1 and Machine 2 is equal, then perform the job of
Machine 1 first and then the job of Machine 2.
b) if there is a tie for a minimum time among jobs in Machine 1, select the job
corresponding to the minimum of Machine 2 and process it first.
c) if there is a tie for a minimum time among jobs in Machine 2, select the job
corresponding to the minimum of Machine 1 and process it last.
4. And then calculate the total elapsed time( the time interval between starting the first job and
completing the last job) and Idle time( the time during which the machine remains idle
during the total elapsed time.
Example:1

Jobs Machine 1 Machine 2

J1 9 7

J2 5 4

J3 10 9

J4 1 5
Jobs Machine 1 Machine 2

J5 3 2

5. Solution: The smallest time is 1 for Machine 1, process it first.

J4

6. Next, the smallest time is 2 for Machine 2, process it last

J4 J5

7. The next smallest time is 3 of job 5 but Job 5 is already being processed by Machine 2.
Discard it.
8. Next, the smallest time is 4 for Machine 2; process it last just before J5.

J4 J2J5

9. The next smallest time is 5 for job 2 but job 2 is already being processed by Machine 2.
Discard it.
10. Next, the smallest value is 7 for Machine 2; process it last just before J2.

J4 J1J2J5

11. Next, the smallest value is for Machine 1 & Machine 2, J1 of Machine 1 is already
being processed on Machine 2. So, take J3 of Machine 2 and process it last just before
J3.

J4 J3 J1J2J5

12. So, the final sequence of processing the jobs is J4, J3, J1, J2, and J5.

Machine 1 Machine 2

Job In Time Out Time In Time Out Time

J4 0 0+1=1 1 1+5=6
Machine 1 Machine 2

Job In Time Out Time In Time Out Time

J3 1 1+10=11 6 6+9=15

J1 11 11+9=20 15 15+7=22

J2 20 20+5=25 22 22+4=26

J5 25 25+3=28 26 26+2=28

13. Total Elapsed Time = 28


14. Idle time of Machine 1 = 0
15. Idle time of Machine 2 = 1 (Machine 2 has to wait for Machine 1 for 1 unit during the
execution of Job 4.

Example:2
. A book binder has one printing press, one binding machine and manuscripts of 7 different
books. The times required for performing printing and binding operations for different books are
shown below.

Book 1 2 3 4 5 6 7

Printing time (hours) 20 90 80 20 120 15 65

Binding time (hours) 25 60 75 30 90 35 50

Decide the optimum sequence of processing of books in order to minimize the total time required
to bring out all the books.

Solution:
Job 1 2 3 4 5 6 7

Machine M1 20 90 80 20 120 15 65

Machine M2 25 60 75 30 90 35 50

1. The smallest processing time is 15 hour for job 6 on Machine-1. So job 6 will be processed
first.

2. The next smallest processing time is 20 hour for job 1, 4 on Machine-1 and for these jobs 30 is
largest on Machine-2. So job 4 will be processed after job 6.

6 4

3. The next smallest processing time is 20 hour for job 1 on Machine-1. So job 1 will be
processed after job 4.

6 4 1

4. The next smallest processing time is 50 hour for job 7 on Machine-2. So job 7 will be
processed last.

6 4 1 7

5. The next smallest processing time is 60 hour for job 2 on Machine-2. So job 2 will be
processed before job 7.

6 4 1 2 7

6. The next smallest processing time is 75 hour for job 3 on Machine-2. So job 3 will be
processed before job 2.

6 4 1 3 2 7
7. The next smallest processing time is 90 hour for job 5 on Machine-2. So job 5 will be
processed before job 3.

6 4 1 5 3 2 7

According to Johnson’s algorithm, the optimal sequence is as below

6 4 1 5 3 2 7

M1 M1 M2 M2 Idle time
Job
In time Out time In time Out time M2

6 0 0 + 15 = 15 15 15 + 35 = 50 15

4 15 15 + 20 = 35 50 50 + 30 = 80 -

1 35 35 + 20 = 55 80 80 + 25 = 105 -

5 55 55 + 120 = 175 175 175 + 90 = 265 70

3 175 175 + 80 = 255 265 265 + 75 = 340 -

2 255 255 + 90 = 345 345 345 + 60 = 405 5

7 345 345 + 65 = 410 410 410 + 50 = 460 5

The total minimum elapsed time = 460


Idle time for Machine-1
=460-410

=50

Idle time for Machine-2


=(15)+(175-105)+(345-340)+(410-405)+(460-460)

=15+70+5+5+0
=95

Processing for n job and three machine


Question 1:Find solution of Processing 5 Jobs through 3 Machines Problem

Job 1 2 3 4 5

Machine-1 8 10 6 7 11

Machine-2 5 6 2 3 4

Machine-3 4 9 8 6 5

Solution:

Job 1 2 3 4 5

Machine M1 8 10 6 7 11

Machine M2 5 6 2 3 4

Machine M3 4 9 8 6 5

Since any of condition min{T1j}≥max{Tij} and/or min{Tmj}≥max{Tij}, for j=2,3,...,m-1 is


satisfied.

So given problem can be converted to 2-machine problem.

Machine-G

13 16 8 10 15

Machine-H

9 15 10 9 9
1. The smallest processing time is 8 hour for job 3 on Machine-G. So job 3 will be processed
first.

2. The next smallest processing time is 9 hour for job 1,4,5 on Machine-H and for this jobs 10 is
smallest on Machine-G. So job 4 will be processed last.

3 4

3. The next smallest processing time is 9 hour for job 1,5 on Machine-H and for this jobs 13 is
smallest on Machine-G. So job 1 will be processed before job 4.

3 1 4

4. The next smallest processing time is 9 hour for job 5 on Machine-H. So job 5 will be
processed before job 1.

3 5 1 4

5. The next smallest processing time is 15 hour for job 2 on Machine-H. So job 2 will be
processed before job 5.

3 2 5 1 4

According to Johnson’s algorithm, the optimal sequence is as below

3 2 5 1 4

Job M1 M1 M2 M2 M3 M3 Idle time Idle time


In time Out time In time Out time In time Out time M2 M3

3 0 0+6=6 6 6+2=8 8 8 + 8 = 16 6 8

2 6 6 + 10 = 16 16 16 + 6 = 22 22 22 + 9 = 31 8 6

5 16 16 + 11 = 27 27 27 + 4 = 31 31 31 + 5 = 36 5 -

1 27 27 + 8 = 35 35 35 + 5 = 40 40 40 + 4 = 44 4 4

4 35 35 + 7 = 42 42 42 + 3 = 45 45 45 + 6 = 51 2 1

The total minimum elapsed time = 51

Idle time for Machine-1


=51-42

=9

Idle time for Machine-2


=(6)+(16-8)+(27-22)+(35-31)+(42-40)+(51-45)

=6+8+5+4+2+6

=31

Idle time for Machine-3


=(8)+(22-16)+(40-36)+(45-44)+(51-51)

=8+6+4+1+0

=19
Processing for n jobs through m machines

Question 1: Find solution of Processing 5 Jobs through 4 Machines Problem

Job 1 2 3 4 5

Machine-1 11 13 9 16 17

Machine-2 4 3 5 2 6

Machine-3 6 7 5 8 4

Machine-4 15 8 13 9 11

Solution:

Job 1 2 3 4 5

Machine M1 11 13 9 16 17

Machine M2 4 3 5 2 6

Machine M3 6 7 5 8 4

Machine M4 15 8 13 9 11

Since any of condition min{T1j}≥max{Tij} and/or min{Tmj}≥max{Tij}, for j=2,3,...,m-1 is


satisfied.

So given problem can be converted to 2-machine problem.

Machine-G

21 23 19 26 27

Machine-H
25 18 23 19 21

1. The smallest processing time is 18 hour for job 2 on Machine-H. So job 2 will be processed
last.

2. The next smallest processing time is 19 hour for job 3 on Machine-G. So job 3 will be
processed first.

3 2

3. The next smallest processing time is 19 hour for job 4 on Machine-H. So job 4 will be
processed before job 2.

3 4 2

4. The next smallest processing time is 21 hour for job 1 on Machine-G. So job 1 will be
processed after job 3.

3 1 4 2

5. The next smallest processing time is 21 hour for job 5 on Machine-H. So job 5 will be
processed before job 4.

3 1 5 4 2

According to Johnson’s algorithm, the optimal sequence is as below

3 1 5 4 2
M1 M2 M2 M3 M3 M4 Idle Idle Idle
Jo M1 M4
In In Out In Out In time time time
b Out time Out time
time time time time time time M2 M3 M4

9+5= 14 + 5 = 19 + 13
3 0 0+9=9 9 14 19 9 14 19
14 19 = 32

9 + 11 = 20 + 4 = 24 + 6 = 32 + 15
1 9 20 24 32 6 5 -
20 24 30 = 47

20 + 17 37 + 6 = 43 + 4 = 47 + 11
5 20 37 43 47 13 13 -
= 37 43 47 = 58

37 + 16 53 + 2 = 55 + 8 = 63 + 9 =
4 37 53 55 63 10 8 5
= 53 55 63 72

53 + 13 66 + 3 = 69 + 7 = 76 + 8 =
2 53 66 69 76 11 6 4
= 66 69 76 84

The total minimum elapsed time = 84

Idle time for Machine-1


=84-66

=18

Idle time for Machine-2


=(9)+(20-14)+(37-24)+(53-43)+(66-55)+(84-69)

=9+6+13+10+11+15

=64

Idle time for Machine-3


=(14)+(24-19)+(43-30)+(55-47)+(69-63)+(84-76)

=14+5+13+8+6+8

=54
Idle time for Machine-4
=(19)+(63-58)+(76-72)+(84-84)

=19+5+4+0

=28

Processing for two jobs through m machines


Question 1: Find solution of Processing 2 Jobs Through m Machines Problem

Job-1 A B C D E

Machine-1 2 4 3 6 6

Job-2 C A D E B

Machine-2 4 6 3 3 6

Solution:
1. We are given the job sequences and processing time of 2 jobs at 5 machines. We follow the graphical
method to find the minimum total elapsed time from starting the first job at the first machine to
completion of the second job at the last machine.

2. We first represent the processing time of job 1 on different machines, i.e, 2,4,3,6,6 along the x-axis and
the processing time of job 2, i.e., 4,6,3,3,6 along the y-axis.
We draw the first vertical line at 2 hrs, the second at 2+4=6 hrs, the third at 6+3=9 hrs, and so on.

Similarly, we draw the horizontal lines at 4 hrs, the second at 4+6=10 hrs, the third
at 10+3=13 hrs, and so on.

3. We draw the rectangular blocks by pairing the same machines as shown in the Figure
(1) For machine A, 0 to 2 hours on x-axis and 4 to 10 hours on y-axis
(2) For machine B, 2 to 6 hours on x-axis and 16 to 22 hours on y-axis
(3) For machine C, 6 to 9 hours on x-axis and 0 to 4 hours on y-axis
(4) For machine D, 9 to 15 hours on x-axis and 10 to 13 hours on y-axis
(5) For machine E, 15 to 21 hours on x-axis and 13 to 16 hours on y-axis

4. Avoiding the rectangular blocks, draw the line starting from origin O to the end point, moving
horizontally, vertically and diagonally along a line which makes an angle 45 deg with the
horizontal line.

Moving horizontally along this line indicates that the job 1 is under process while the job 2 is
idle.
Similarly moving vertically along this line indicates that the job 2 is under process while the job
1 is idle.
The diagonal movement along this line shows that both jobs are under process. Since
simultaneous processing of both jobs on a machine is not possible, therefore a diagonal
movement through rectangle areas is not allowed.

(1) we move diagonally upto (9,9), which means both the jobs 1 and 2 are being processed
simultaneously
(2) we move vertically upto (9,13), which means Job 2 is under process amd Job 1 is idle for 4
hrs
(3) we move diagonally upto (18,22), which means both the jobs 1 and 2 are being processed
simultaneously
(4) we move horizontally upto (21,22), which means Job 1 is under process and Job 2 is idle for
3 hrs

5. An optimum path minimizes the idle time for both the jobs.
Idle time of job 1 =4 hours.

Idle time of job 2 =3 hours.

6. The elapsed time is obtained by adding the idle time for either job to the processing time for
that job.
Elapsed time, job 1 = processing time of job 1 + idle time of job
1 =(2+4+3+6+6)+(4)=21+4=25 hours.
Elapsed time, job 2 = processing time of job 2 + idle time of job
2 =(4+6+3+3+6)+(3)=22+3=25 hours.

Queuing Theory

It is a common phenomenon in everyday life to see a large number of persons waiting in front of
a booking counter, in a railway station or in a theatre or in a ration shop to have some service
carried out. This waiting problem leads the Danish engineer A.K. (Agner Krarup) Erlang, who
worked for the Copenhagen Telephone Exchange to find a solution. He developed in 1903
the Queuing theory. Queuing theory analyze the shared facility needs to be accesed for service
by a large number of jobs or customers. Examples for the queuing theory are waiting lines in
cafeterias, hospitals, banks, airports and so on. In the following you can find more detailled
informations for this topic.

The queues that a computer manages are sometimes viewed as being in stacks. In most systems,
an item is always added to the top of a stack. A process that handles queued items from the
bottom of the stack first is known as a first-in first-out (FIFO) process. A process that handles the
item at the top of the stack first is known as a last-in first-out (LIFO) process.

Elements of Queuing Systems

Population of Customers can is considered either limited (closed systems) or unlimited (open
systems). Unlimited population represents a theoretical model of systems with a large number of
possible customers (a bank on a busy street, a motorway petrol station). Example of a limited
population may be a number of processes to be run (served) by a computer or a certain number
of machines to be repaired by a service man. It is necessary to take the term "customer" very
generally. Customers may be people, machines of various nature, computer processes, telephone
calls, etc.
Arrival defines the way customers enter the system. Mostly the arrivals are random with random
intervals between two adjacent arrivals. Typically the arrival is described by a random
distribution of intervals also called Arrival Pattern.

Queue represents a certain number of customers waiting for service (of course the queue may be
empty). Typically the customer being served is considered not to be in the queue. Sometimes the
customers form a queue literally (people waiting in a line for a bank teller). Sometimes the queue
is an abstraction (planes waiting for a runway to land). There are two important properties of a
queue: Maximum Size and Queuing Discipline.

Maximum Queue Size (also called System capacity) is the maximum number of customers that
may wait in the queue (plus the one(s) being served). Queue is always limited, but some
theoretical models assume an unlimited queue length. If the queue length is limited, some
customers are forced to renounce without being served.

Queuing Discipline represents the way the queue is organized (rules of inserting and removing
customers to/from the queue). There are these ways:

1) FIFO (First in First Out) also called FCFS (First Come First Serve) - orderly queue.

2) LIFO (Last in First Out) also called LCFS (Last Come First Serve) - stack.

3) SIRO (Serve in Random Order).

4) Priority Queue that may be viewed as a number of queues for various priorities.

5) Many other more complex queuing methods that typically change the customer’s position in
the queue according to the time spent already in the queue, expected service duration, and/or
priority. These methods are typical for computer multi-access systems.

Most quantitative parameters (like average queue length, average time spent in the system) do
not depend on the queuing discipline. That’s why most models either do not take the queuing
discipline into account at all or assume the normal FIFO queue. In fact the only parameter that
depends on the queuing discipline is the variance (or standard deviation) of the waiting time.
There is this important rule (that may be used for example to verify results of a simulation
experiment):
The two extreme values of the waiting time variance are for the FIFO queue (minimum) and the
LIFO queue (maximum).

Theoretical models (without priorities) assume only one queue. This is not considered as a
limiting factor because practical systems with more queues (bank with several tellers with
separate queues) may be viewed as a system with one queue, because the customers always
select the shortest queue. Of course, it is assumed that the customers leave after being served.
Systems with more queues (and more servers) where the customers may be served more times
are called Queuing Networks.

Service represents some activity that takes time and that the customers are waiting for. Again
take it very generally. It may be a real service carried on persons or machines, but it may be a
CPU time slice, connection created for a telephone call, being shot down for an enemy plane, etc.
Typically a service takes random time. Theoretical models are based on random distribution of
service duration also called Service Pattern. Another important parameter is the number of
servers. Systems with one server only are called Single Channel Systems, systems with more
servers are called Multi Channel Systems.

Output represents the way customers leave the system. Output is mostly ignored by theoretical
models, but sometimes the customers leaving the server enter the queue again ("round robin"
time-sharing systems).

Queuing Theory is a collection of mathematical models of various queuing systems that take as
inputs parameters of the above elements and that provide quantitative parameters describing the
system performance.

Because of random nature of the processes involved the queuing theory is rather demanding and
all models are based on very strong assumptions (not always satisfied in practice). Many systems
(especially queuing networks) are not soluble at all, so the only technique that may be applied is
simulation.

Nevertheless queuing systems are practically very important because of the typical trade-off
between the various costs of providing service and the costs associated with waiting for the
service (or leaving the system without being served). High quality fast service is expensive, but
costs caused by customers waiting in the queue are minimum. On the other hand long queues
may cost a lot because customers (machines e.g.) do not work while waiting in the queue or
customers leave because of long queues. So a typical problem is to find an optimum system
configuration (e.g. the optimum number of servers). The solution may be found by applying
queuing theory or by simulation.

Applications and limitation

Applications

The queueing theorie is used to analyze computer, telecommunication systems, traffic systems
(traffic flue), logistic and manufacturing systems.

Some examples:

-Where customers are involved such as restaurants, supermarket, airport

-useful in manufacturing units

-applicable for the problem of machine breakdown and repair

-applicable for the scheduling of jobs in production control

-provide solution of inventory control problems

Limitations

-Most of the queuing models are still complex and are not easy to understand

-Many times form of theoretical distribution applicable to given queuing situations is not known

-The study of queuing problems become more difficult if the queuing discipline is not in „first in,
first out“

Kendall's notation
David George Kendall was an English statistician and mathematician, known for his work on
probability, statistical shape analysis, lay lines and queuing theory. Kandall's Notation is the
standard system used to describe and classify a queuing node.

A queuing model is characterized by:

a) The arrival process of customers.

b) The behavior of customers.

c) The service times.

d) The service discipline.

e) The service capacity.

f) The waiting room.

A special notation, called Kendall's notation, is used to describe a queueing system. The notation
has the form A/B/C/K.

->A describes the inter arrival time distribution

->B the service time distribution

->c the number of servers

->K the size of the system capacity (including the servers).

The symbols traditionally used for A and B are

->M for exponential distribution (M stands for Markov)

->D for deterministic distribution

->G for general distribution.

When the system capacity is infinite (K = 1) one simply uses the symbol A/B/c. For instance,
M/M/1, M/M/c, M/G/1 and G/M/1 are very common queueing systems.
M/M/1 queuing system

M/M/1 queue represents the queue length in a system having a single server, where arrivals are
determined by a Poisson process and job service times have an exponential distribution. The
model is the most elementary of queuing models and an attractive object of study as closed-form
expressions can be obtained for many metrics of interest in this model. Here is the arrival
population unlimited and all arrivals wait to be served. λ is constant and μ >λ (average service
rate > average arrival rate).

Operating characteristics:

1. Average server utilization

p=λ / μ

2. Average number of customers waiting

Lq= λ 2 / μ (μ - λ)

3. Average number in system

L = Lq + λ / μ

4. Average waiting time

Wq=Lq= λ / μ (μ - λ)

5. Average time in the system

W= Wq + 1/ μ

6. Probability of 0 customers in system


P0= 1 - λ / μ

7. Probability of exactly n customers in system

Pn = ( λ / μ )*n*P0

A mathematical example of M/M/1 Queue

We are in a train station and we see, that a arriving train join a single queue for the runway. We
have an exponentially distributed service time with a rate μ= 30 arrivals / hour ( as we computed
that in 5 minutes 1 train arrived the station) and we have poisson arrivals with a rate λ= 25
arrivals / hour.

Now we want to calculate W, L, Wq and Lq.

W= 1 / μ - λ= 1/ ( 30-25)= 0,20 hours ≈ 12 min

L= λW = λ / (μ - λ)= 25/ (30-25)= 5 trains

Wq = W- (1/μ)= 1/ (μ - λ) - 1/μ= 1/ ( 30-25) - (1/30)= 0.167 hours≈ 10 min

Lq= λW= λ^2 / μ ( μ - λ )= 25 ^ 2 / 30 ( 30-25) ≈4,167 trains

You might also like