Or 1-5
Or 1-5
PURAMANNUR
PG DEPARTMENT OF COMPUTER SCIENCE
(Affiliated to the University of Calicut)
OPERATIONS RESEARCH
FIFTH MODULE
Module 5
Network Scheduling: Concept of network, basic components, PERT and CPM, Rules of
network construction, maximal flow problem, project scheduling critical path
calculations, advantages of network (PERT/CPM).
Sequencing models: processing n jobs through two machines, n jobs through three
machines, two jobs through m machines.
PERT CPM
PERT is that technique of project CPM is that technique of project
management which is used to manage management which is used to manage
uncertain (i.e., time is not known) only certain (i.e., time is known)
activities of any project. activities of any project.
18.
19.
MAJLIS ARTS AND SCIENCE COLLEGE
PURAMANNUR
PG DEPARTMENT OF COMPUTER SCIENCE
(Affiliated to the University of Calicut)
OPERATIONS RESEARCH
FOURTH MODULE
Module IV
Assignment model: Mathematical formulation of the problem - assignment
algorithm-impossible algorithms - travelling salesman problem
Assignment problem is a special LPP which deals with assignment of workers to machines, clerks to
various checkout counters, salesman to different sales areas, service crews to different districts
and so on. Thus in an assignment problem, the question is how the assignments should be made in
order that the total cost involved is minimized.
This method is specially designed to handle assignment problems in an efficient way. HAM is based
on the concept of opportunity cost. For a typical balanced assignment problem involving a certain
number of people and an equal number of jobs, with an objective function of minimization type,
the method is applied as listed in the following steps.
Step 1: Locate the smallest cost element in each row of the cost table and subtract it from each
element in that row. As a result there shall be at least one zero in each row of this new table,
called the reduced cost table.
Step 2: In the reduced cost table obtained, consider each column and locate the smallest element
in it. Subtract the smallest value from every other entry in the column. As a result of this , there
would be at least one zero in each of the rows and columns of the second reduced cost table.
Step 3: Draw the minimum number of horizontal and vertical lines (not diagonal lines) that are
required to cover all 0 elements. If the number of lines drawn is equal to n (i.e. the number of rows
or columns) the solution is optimal and proceeds to step 6. If the number of lines drawn is less than
n, go to step 4.
Step 4: Select the smallest uncovered cost element. Subtract this element from all uncovered
elements including itself and add this element to each value located at the intersection of any two
lines. The cost elements through which only one line passes remain unaltered.
Step 5: Repeat step 3 and 4 until an optimal solution is obtained.
Step 6: Given the optimal solution, make the job assignments as indicated by the zero elements.
This can be done as follows:
a) Locate a row which contains only one ‘zero’ element. Assign the job corresponding to
this element to its corresponding person. Cross out the zeros, if any, in the column
corresponding to the element, which is indicative of the fact that the particular job and
person are no more available.
b) Repeat (a) for each of such rows, which contain only one zero. Similarly, perform the
same operation in respect of each column containing only one zero element, crossing
out the zero(s), if any, in the row in which the element lies.
c) If there is no row or column with only a single 0 element left, then select a row or
column arbitrarily and choose one of the jobs (or persons) and make the assignment.
Now cross the remaining zeros in the column and row in respect of which the
assignment is made.
d) Repeat steps (a) through (c) until all assignments are made.
e) Determine the total cost with reference to the original cost table.
3. Problems
A production supervisor is considering how he should assign the four jobs that are to be
performed, to four of the workers. He wants to assign the jobs to the workers such that
the aggregate time to perform the jobs is the least. Based on previous experience, he has
the information on the time taken by the four workers in performing these jobs, as given in
the table:
Worker Job
A B C D
1 45 40 51 67
2 57 42 63 55
3 49 52 48 64
4 41 45 60 55
Table 1: Time taken (in minutes) by 4
Workers
Solution: The solution to this problem has been discussed in a step wise manner:
Step 1: The minimum elements of each row is subtracted from all elements in the row as shown in
the following table known as the reduced cost table or opportunity cost table:
Worker Job
A B C D
1 5 0 11 27
2 15 0 21 13
3 1 4 0 16
4 0 4 19 14
Step 2: For each column of the above table the minimum value is subtracted from all other values
giving us another reduced cost table:
Worker Job
A B C D
1 5 0 11 14
2 15 0 21 0
3 1 4 0 3
4 0 4 19 1
Step 3: Draw the minimum number of lines covering all zeros. We will first cover those
rows/columns which contain larger number of zeros such that we obtain the following reduced
cost table.
Worker Job
A B C D
1 5 0 1 1 14
2 15 0 2 1 0
3 1 4 0 3
4 0 4 1 9 1
Step 4: Since the number of lines drawn=4(=n), the optimal solution is obtained. The assignments
are made after scanning the rows and columns for unit zeros. Assignments made are shown with
squares as depicted in the table.
Worker Job
A B C D
1 5 0 11 14
2 15 0 21 0
3 1 4 0 3
4 0 4 19 1
Assignments are made in the following order. Since row 1, 3 and 4 contain 1 zero each, we assign
1-B, 3-C and 4-A. Since worker 1 has been assigned the job B, we cross the zero in the second
column of the second row. After making these assignments, only worker 2 and job D are left for
assignment. The final pattern of assignments is 1-B, 2-D, 3-C and 4-A involving a total time of
40+55+48+41=184 minutes ( as taken from the original table).
The Hungarian method of solving assignment problems require that the number of columns should
be equal to the number of rows in which case the problem is known as balanced problem and
when the rows and columns are unequal, it is called an unbalanced assignment problem. In case of
such class of problems, one to one match is not possible.
In such situations, dummy columns / rows, whichever is smaller in number are inserted with zeros
as the cost elements. For example, in case of 4x5 cost matrix, a dummy row is added. In each
column in respect of this row, a zero would be placed. After this process of adding dummy rows/
columns, the problem is solved in a usual manner.
5. Problem
You are given information about cost of performing different jobs by different persons.
The job-person marking x indicates that the individual involved cannot perform the
particular job. Using this information, state (a) the optimal assignment of jobs (b) the
cost of such assignment.
Person Job
J1 J2 J3 J4 J5
P1 27 18 X 20 21
P2 31 24 21 12 17
P3 20 17 20 X 16
P4 22 28 20 16 27
Solution: Balancing the problem and assigning a high cost to the pairings P1-J3 and P3-J4, we obtain
the following cost table:
Person Job
J1 J2 J3 J4 J5
P1 27 18 M 20 21
P2 31 24 21 12 17
P3 20 17 20 M 16
P4 22 28 20 16 27
P5(dummy) 0 0 0 0 0
From the above table a reduced cost table is derived as depicted below. However the cells with
prohibited assignments continue to be shown with the cost element M, as M is defined to be
extremely large such that subtraction or addition of a value does not practically affect it.To test
optimality, lines are drawn to cover all zeros.
Job
Person
J1 J2 J3 J4 J5
P1 9 0 M 2 3
P2 19 12 9 0 5
P3 4 1 4 M 0
P4 6 12 4 0 11
P5(dummy) 0 0 0 0 0
Since the number of lines covering zeros is less than n, we select the lowest uncovered cell which
equals
4. With this value we obtain the revised reduced cost table as depicted below:
Job
Person
J1 J2 J3 J4 J5
P1 9 0 M 6 3
P2 15 8 5 0 1
P3 4 1 4 M 0
P4 2 8 0 0 7
P5(dummy) 0 0 0 4 0
Since in the above table, the number of lines covering zeros equals 5(=n), an optimal assignment
can be made which is : P1-J2, P2-J4, P3-J5, P4-J3 while job J1 would remain unassigned. The
assignment pattern would cost 18+12+16+20=66 in aggregate.
6. What is the Maximization Case of Assignment Problem?
In some situations the assignment problem may call for maximization of profit, revenue etc. as the
objective. For dealing with such problems, we first change it into an equivalent minimization
problem. This is achieved by subtracting each of the elements of the given pay-off matrix from a
constant value (say K). Usually the largest of all values in the given matrix is located and then each
one of the values is subtracted from it. Then the problem is solved the same way as the
minimization problem.
7. Problem
A company plans to assign 5 salesmen to 5 districts in which it operates. Estimates of
sales revenue in thousands of rupees for each salesman in different districts are given in
the following table. In your opinion, what should be the placement of the salesmen if
the objective is to maximize the expected sales revenue?
Salesman Distric t
D1 D2 D3 D4 D5
S1 40 46 48 36 48
S2 48 32 36 29 44
S3 49 35 41 38 45
S4 30 46 49 44 44
S5 37 41 48 43 47
Solution:
Since this is a maximization problem, we first subtract each of the entries in the table from the
largest one (i.e. 49) to obtain the following opportunity loss matrix:
Salesman Distric t
D1 D2 D3 D4 D5
S1 9 3 1 13 1
S2 1 17 13 20 5
S3 0 14 8 11 4
S4 19 3 0 5 5
S5 12 8 1 6 2
Now we can proceed the same way as in case of minimization problems by following the below
mentioned steps:
Step 1: Subtract minimum value in each row from every value in the row so as to obtain the
following reduced cost table:
Salesman Distric t
D1 D2 D3 D4 D5
S1 8 2 0 12 0
S2 0 16 12 19 4
S3 0 14 8 11 4
S4 19 3 0 5 5
S5 11 7 0 5 1
Step 2:Now subtract minimum value in each column from each value in that column in the above
reduced cost table to obtain the following table. Test for optimality by drawing lines to cover zeros.
Salesman Distric
D1 D2 D3 D4 D5
S1 8 0 0 7 0
S2 0 14 12 14 4
S3 0 12 8 6 4
S4 9 1 0 0 5
S5 1 5 0 0 1
Since the number of lines covering all zeros is fewer than n, we select the least uncovered cell
value, which equals 4 and obtain a modified table as shown below:
Salesman District
D1 D2 D3 D4 D5
S1 12 0 0 7 0
S2 0 10 8 10 0
S3 0 8 4 2 0
S4 23 1 0 0 5
S5 15 5 0 0 1
There are more than one optimal assignments possible in this case because of existence of multiple
zeros in different rows and columns. The following assignments are possible:
S1-D2,S2-D1,S3-D5,S4-D3,S5-D4
or S1-D2,S2-D5,S3-D1,S4-D3,S5-
D4 or S1-D2,S2-D5,S3-D1,S4-
D4,S5-D3 or
S1-D2,S2-D1,S3-D5,S4-D4,S5-D3
Each of these assignment patters would lead to an expected aggregate sales equal to 231
thousand rupees.
9. Which method is used for solving assignment problem?
Ans:-Hungarian Method
10. What is travelling salesman problem?
The traveling salesman problem consists of a salesman and a set of cities.
The salesman has to visit each one of the cities starting from a certain one (e.g. the
hometown) and returning to the same city. The challenge of the problem is that
the traveling salesman wants to minimize the total length of the trip.
11.
Solution:
12. Problem solution
.
MAJLIS ARTS AND SCIENCE COLLEGE
PURAMANNUR
PG DEPARTMENT OF COMPUTER SCIENCE
(Affiliated to the University of Calicut)
OPERATIONS RESEARCH
FIRST MODULE
Module I
Operation research and LPP: Operation Research and Decision
making, Advantages of O R, Approach in decision making,
Application of O R, uses and limitations of O R.
(1 Mark Questions)
Ans :
The first task is to study the relevant system and develop a well-defined statement
of the problem. This includes determining appropriate objectives, constraints,
interrelationships and alternative course of action. The OR team normally works in
an advisory capacity. The team performs a detailed technical analysis of the problem
and then presents recommendations to the management. Ascertaining the
appropriate objectives is very important aspect of problem definition. Some of the
objectives include maintaining stable price, profits, increasing the share in market,
improving work morale etc. OR team typically spends huge amount of time in
gathering relevant data.∙
Parameters – the constant in the constraints (right hand side values) The
advantages of using mathematical models are Describe the problem more
concisely and indicates clearly what additional data are relevant for analysis∙
Forms a bridge to use mathematical technique in computers to analyze∙
This phase is to develop a procedure for deriving solutions to the problem. A common
theme is to search for an optimal or best solution.
After the completion of testing phase, the next step is to install a well-documented
system for applying the model. This system will include the model, solution
procedure and operating procedures for implementation. The system usually is
computer-based. Databases and Management Information System may provide up-
to-date input for the model. An interactive computer based system called Decision
Support System is installed to help the manager to use data and models to support
their decision making as needed. A managerial report interprets output of the model
and its implications for applications.
f) Implementation
Feedback is obtained
Documentation
OPERATIONS RESEARCH
THIRD MODULE
(1 Mark Questions)
1. While Solving a transportation problem the occurrence of degeneracy means that
Ans: the solution so obtained is not feasible.
2. A transportation problem is said to be balance if
Ans: total demand=total supply
3. A feasible solution of a transportation problem involves exactly m+n-1 possible
variables is known as
Ans: Basic Feasible Solution.
(2 Mark Questions)
4. What is an unbalanced transportation problem?
Ans: The problem of transporting a product from several factories (supply origins) to a
number of warehouses (demand destinations) is generally considered as a very good
application area for linear programming technique. When the total number of units
available at the supply origins is equal to the total number of items available at the
demand destinations, it is termed a balanced transportation problem. If these two
values are not equal, it is termed an unbalanced problem.
5. Explain transportation problem? Show that it can be considered as LPP.
Ans: The Transportation Method of linear programming is applied to the problems
related to the study of the efficient transportation routes i.e. how efficiently the
product from different sources of production is transported to the different
destinations, such as the total transportation cost is minimum.
(4 Mark /Short Essay Questions)
6. Explain transportation problem? Give its Mathematical Formulation?
Ans: Let there be m origins and n destinations. Let the amount of supply at the i
th origin is ai . Let the demand at j th destination is bj.The cost of transporting one
unit of an item from origin i to destination j is cij and is known for all
combinations (i,j). Quantity transported from origin i to destination j be xijThe
objective is to determine the quantity xij to be transported over all routes (i,j) so as to
minimize the total transportation cost. The supply limits at the origins and the
demand requirements at the destinations must be satisfied. The above transportation
problem can be written in the following tabular form:
Now the linear programming model representing the transportation problem is given by
12. Obtain the initial basic feasible solution for the following transportation problem
by various methods?
Ans:
North West Corner Method
OPERATIONS RESEARCH
SECOND MODULE
Module II
LPP: Introduction, mathematical formulation the problem, canonical and standard
forms of LPP. Simplex method, artificial variable technique - Big M and two phase
method - problem of degeneracy - concept of duality - dual simplex method.
(1 Mark Questions)
1. Minimization of objective function in LPP means
Ans: Least value chosen among the allowable decisions
2. For maximization LPP, the objective function coefficient for an artificial variable
is :
Ans: - M
3. The dual of the Primal maximization LPP having m constraints and n non
negative variables Should:
Ans: have n constraints and non negative variables.
(2 Mark Questions)
9. State the general linear programming problem in standard form?
A:A nonnegative vector of variables that satisfies the constraints of (P) is called a
feasible solution to the linear programming problem. A feasible solution that
minimizes the objective function is called an optimal solution. A nonnegative vector
of variables that satisfies the constraints of (P) is called a feasible solution to the
linear programming problem. A feasible solution that minimizes the objective
function is called an optimal solution.
A: Slack variable: It is used o convert a Less than or equal to (≤) constraint into
equality to write standard form. It is ADDED to ≤ constraint.
Surplus & Artificial variables: They are used to convert Greater than or equal to (≥)
constraint into equality to write standard form.
A: LP makes logical thinking and provides better insight into business problems.
Manager can select the best solution with the help of LP by evaluating the cost and
profit of various alternatives.
Financial Management
Inventory Management
A: The duality in Linear Programming states that every LPP has another LPP
related to it and thus can be derived from it. The original LPP is called Primal
while the Derived LP is called Dual.
Non-negativity restriction: For all linear programs, the decision variables should
always take non-negative values which mean the values for decision variables should
be greater than or equal to 0.
Step3. Write the objective function as an equation in the form "left hand side"= 0 where
terms involving variables are negative. Example: Z = 3x + 4y becomes – 3x – 4y + Z = 0.
Step4. Place the system of equations with slack variables, into a matrix. Place the
revised objective equation in the bottom row.
Step 5. Select pivot column by finding the most negative indicator. (Indicators are those
elements in bottom row except last two elements in that row)
Step 6. Select pivot row. (Divide the last column by pivot column for each corresponding
entry except bottom entry and negative entries. Choose the smallest positive result. The
corresponding row is the pivot row. In case there is no positive entry in pivot column
above dashed line, there is no optimal solutions)
Step 7. Find pivot: Circle the pivot entry at the intersection of the pivot column and the
pivot row, and identify entering variable and exit variable at mean time. Divide pivot by
itself in that row to obtain 1. Also obtain zeros for all rest entries in pivot column by row
operations.
Step 8. Do we get all nonnegative indicators? If yes, we may stop. Otherwise repeat step
5 to step 7.
Step 9. Read the results: Correspond the last column entries to the variables in front of
the first column. The variables not showing are automatically equal to 0.
Ans: In the first phase of this method, the sum of the artificial variables is minimized
subject to the given constraints (known as auxiliary L.P.P.) to get a basic feasible
solution to the original L.P.P. Second phase then optimizes the original objective
function starting with the basic feasible solution obtained at the end of Phase 1. The
iterative procedure of the algorithm may be summarizing as below:
Step 1:
Write the given L.P.P into its standard form and check whether there exists a starting
basic feasible solution.
If there does not exist a ready starting basic feasible solution, go on to the next
step.
PHASE 1
Step 2:
Add the artificial variable to the left side of the each equation that lacks the needed
starting basic variables. Construct an auxiliary objective function aimed at minimizing
the sum of all artificial variables
Step 3:
Apply simplex algorithm to the specially constructed L.P.P. The following three cases
arise at the least interaction:
Max z* < 0 and at least one artificial variable is present in the basis with positive
value. In such case, the original L.P.P does not possess any feasible solution.
Max z* = 0 and at least artificial variable is present in the basis at zero value. In
such a case, the original L.P.P possess the feasible solution. In order to get basic
feasible solution we may proceed directly to Phase 2 or else eliminate the
artificial basic variable and then proceed to Phase 2.
Max z* = 0 and no artificial variable is present in the basis. In such a case, a basic
feasible solution to the original L.P.P has been found. Go to Phase 2.
PHASE 2
Step 4:
Consider the optimum basic feasible solution of Phase 1 as the starting basic feasible
solution for the original L.P.P. Assign actual coefficients to the variables in the objective
function and a value zero to the artificial variables that appear at zero value in the final
simplex table of Phase 1.
Apply usual simplex algorithm to the modified simplex table to get the optimum solution
of the original problem.
Example:
Subject to
x1 +3x2 +x3 ≤5
2x1 –x2 +x3 ≥2
4x1 + 3x2 - 2x3 = 5
x1, x2, x3 ≥ 0
Solution:
If the objective function is in minimization form, then convert it into maximization form
Changing the sense of the optimization
Any linear minimization problem can be viewed as an equivalent linear maximization
problem, and vice versa. Specifically:
Minimize = Maximize
If z is the optimal value of the left-hand expression, then -z is the optimal value of the
right-hand expression.
Subject to
x1 +3x2 +x3 ≤5
2x1 –x2 +x3 ≥2
4x1 + 3x2 - 2x3 = 5
Where x1, x2, x3 ≥ 0
Where x4 is a slack variable, x5 is a surplus variable. Now, if we let x1, x2 and x3 equal to
zero in the initial solution, we will have x4 = 5 and x5 = -2, which is not possible because
a surplus variable cannot be negative. Therefore, we need artificial variables.
PHASE 1
In this phase, we remove the artificial variables and find an initial feasible solution of
the original problem. Now the objective function can be expressed as
subject to
cj 0 0 0 0 0 -1 -1
-1 A1 2 -1 1 0 -1 1 0 2
-1 A2 4 3 -2 0 0 0 1 5
zj–cj -6 -2 1 0 1 0 0
Keycolumn=x1 column
Minimum(5/1,2/2,5/4)=1
Keyrow = A1 row
Pivot element = 2
A1 departs and x1 enters.
Iteration 2:
cj 0 0 0 0 0 -1
Basic Solution
cB variables x1 x2 x3 x4 x5 A2 values
B b (= XB)
- -
0 x1 1 1/2 0 0 1
1/2 1/2
-1 A2 0 5 -4 0 2 1 1
zj-cj 0 -5 4 0 -2 0
A2 departs and x2 enters.Here, Phase 1 terminates because both the artificial variables
have been removed from the basis.
PHASE 2
The basic feasible solution at the end of Phase 1 computation is used as the initial basic
feasible solution of the problem. The original objective function is introduced in Phase
2 computation and the usual simplex procedure is used to solve the problem.
Iteration 3:
cj 3 -1 2 0 0
Iteration 4:
cj 3 -1 2 0 0
0 x5 0 5/2 -2 0 1 1/2
Iteration 5:
cj 3 -1 2 0 0
Basic variables Solution values
cB x1 x2 x3 x4 x5
B b (= XB)
Result:
Step 1:
Express the linear programming problem in the standard form by introducing slack
and/or surplus variables, if any.
Step 2:
Introduce non-negative variables to the left hand side of all the constraints of (> or = )
type. These variables are called artificial variables. The purpose of introducing artificial
variables is just to obtain an initial basic feasible solution. However, addition of these
artificial variables causes violation of the corresponding constraints. Therefore we would
like to get rid of these variables and would not allow them to appear in the optimum
simplex table. To achieve this, we assign a very large penalty ' — M ' to these artificial
variables in the objective function, for maximization objective function.
Step 3:
At any iteration of the usual simplex method there can arise any one of the following
three cases :
(a) There is no vector corresponding to some artificial variable, in the basis yb.
(b) There is at least one vector corresponding to some artificial variable, in the
basis yB, at the zero level. That is, the corresponding entry in XB is zero. Also, the co-
efficient of M in each net evaluation Zj- Cj(j = 1, 2, n) is non- negative.
In such a case, the current basic feasible solution is a degenerate one. This is a case
when an optimum solution to the given L.P.P. includes an artificial basic variable and
an optimum basic feasible solution still exists.
(c) At least one artificial vector is in the basis yB, but not at the zero level. That is, the
corresponding entry in XB is non-zero. Also coefficient of M in each net evaluation Zj -
Cj is non-negative,
In this case, the given L.P.P. does not possess any feasible solution.
Step 4:
Example:
Maximize z = x1 + 5x2
Subject to
3x1 +4x2 ≤ 6
x1 + 3x2 ≤ 2
x1, x2 ≥ 0
Solution:
Converting inequalities to equalities
By introducing surplus variables, slack variables and artificial variables, the
standard form of LPP becomes
Subject to
x1 ≥ 0, x2 ≥ 0, x3 ≥ 0, x4 ≥ 0, A1≥ 0
where,
x3 is a slack variable
x4 is a surplus variable
A1 is an artificial variable.
Solution values
cB Basic variables B x1 x2 x3 x4 A1
b (= XB)
0 x3 3 4 1 0 0 6
–M A1 1 3 0 –1 1 2
As M is a large positive number, the coefficient of M in the zj–cj row would decide the
incoming basic variable.
As -3M < -M, x2 becomes a basic variable in the next iteration.
Key column = x2 column.
Minimum (6/4, 2/3) = 2/3
Key row = A1 row
Pivot element = 3.
A1 departs and x2 enters.
Note: The iteration just completed, artificial variable A1 was eliminated from the basis.
The new solution is shown in the following table.
Iteration 2:
cj 1 5 0 0
Iteration 3:
cj 1 5 0 0
Result:
The optimal solution is x1 = 0, x2 = 3/2
Max z = 0 + 5 x 3/2 =15/2
Additional Problems
21.
Ans:
22.
Ans:
23. Write the dual of following LPP
NiniNize z = 20x1 + 40x2
36 x1 + 6x2 ≥ 108,
3x1 + 12x2 ≥ 36,
20 x1 + 10x2 ≥ 100 and x1 ≥ 0, x2 ≥ 0.
Ans: first we have to write the given LPP in standard form.
Introducing surplus variables s1, s2, s3 ≥ 0, the primal problem in standard form
can be written as
NiniNize z = 20x1 + 40x2 + 0. s1 + 0. s2 + 0. s3
36 x1 + 6x2 − s1 = 108,
3x1 + 12x2 − s2 = 36,
20 x1 + 10x2 − s3 = 100
x1, x2, s1, s2, s3 ≥ 0.
Associated dual is
NaxiNize z ∗ = 108w1 + 36w2 + 100w3
36w1 + 3w2 + 20w3 ≤ 20,
6w1 + 12w2 + 10w3 ≤ 40,
-w1 ≤ 0, -w2 ≤ 0, −w3 ≤0
where w1, w2, w3 are unrestricted in sign dominated by w1 ≥ 0, w2 ≥ 0, w3 ≥0