OR Mod 2
OR Mod 2
OR Mod 2
Programming problems in general deal with determining optimal allocation of limited resources to
meet given objectives. The resources may be in the form of men, materials, machines etc. The
objective is to optimize the total profit or total cost, using the limited resources, subject to the various
restrictions.
Definition
Linear programming may be defined as a method of determining an optimum programme of
independent activities in view of available resources. The objective in a linear programming problem
is to maximize profit or minimize cost, subject to a number of limitations known as constraints. For
this an objective function is constructed which represents total profit or total cost. The constraints are
expressed in the form of equations or inequalities. Both the objective function and the constraints are
linear relationship between the variables. The solution of a linear programming problem shows how
much should be produced or sold or purchased which will optimize the objective function and satisfy
the constraints.
Uses of LPP
LPP technique is used to achieve the best allocation of available resources. Available resources may
be man-hours, money, machine-hours, raw materials etc.
Examples
1. A production manager wants to allocate the available machine-time, labour and raw materials
to the activities of producing the different products. The manager would like to determine the
number units of the products to be produced so as to maximize the profit.
2. A manufacturer wants to develop a production schedule and an inventory policy that will
minimize the total production and inventory costs.
3. A marketing manager wants to allocate fixed advertising budget among alternative
advertising media scuh as radio, television, newspapers and magazines. He wants to
determine the media scheduled that maximizes the advertising effectiveness.
Applications of LP in industry and management (Uses of LP in management)
LP is extensively used to solve variety of industrial and management problems. Some examples are
given below.
1. Product mix. This problem deals with determining the quantum of different products to be
manufactured knowing the marginal contribution of each product and the amount of available
resources used by each product. The objective is to maximize the total contribution subject to
constraints formed by available resources.
2. Product smoothing. This is a problem in which the manufacturer has to determine the best
plan for producing a product with a fluctuating demand.
3. Media selection. The problem is to select the advertising mix that will maximize the
advertising effectiveness subject to the constraints like the total advertising budget, usage rate
of various media etc.
4. Travelling salesman problem. The problem is to find the shortest route for a salesman
starting from a given city, visiting each of the specified cities and then returning to the
original point of departure.
5. Capital investment. The problem is to find the allocation which maximizes the total return
when a fixed amount of capital is allocates to a number of activities.
6. Transportation problem. Using transportation technique of LP we can determine the
distribution system that will minimize total shipping cost from several warehouses to various
market locations.
7. Assignment problems. The problem of assigning the given number of personnel to different
jobs can be solved with the help of assignment model. The objective is to minimize the total
time taken or total cost.
8. Blending problem. These problems are likely to arise when a product can be made from a
variety of available raw materials of various composition and prices. The problem is to find
the number of units of each raw material to be blended to make one unit of product.
9. Communication industry. LP methods are used in solving problems involving facilities for
transmission, switching, relaying etc.
10. Rail road industry. LP technique can be used to minimize the total crew and engine
expenses subject to restrictions on hiring and paying the trainmen, the scheduling of ship
capacities of rail road etc.
11. Staffing problem. LP method can be used to minimize the total number of employees in
restaurant, hospital, police station etc. meeting the staff need at all hours.
Advantages of LP
1. It provides an insight and perspective into problem environment related with a
multidimensional phenomenon. This generally results in clear picture of the true problem.
2. It makes a scientific and mathematical analysis of the problem situations. It also considers all
possible aspects and remedies associated with the problem.
3. It gives an opportunity to the decision maker to formulate his strategies consistent with the
constraints and the objectives.
4. It deals with changing situations. Once a plan is arrived through the LP, it can be revaluated
for changing conditions.
5. By using LP the decision maker makes sure that he is considering the best solution.
Limitations of LP
1. It treats all relationships as linear. This assumption may not hold good in many real life
situations.
2. Usually the decision variables would have physical significance only if they have integer
values. But sometimes we get fractional valued answers in LP.
3. All parameters in the LP model are assumed to be known constants, but in reality they are
frequently neither known nor constants.
4. Many problems are complex since the number of variables and constraints are quite a large
number.
Basic assumptions
The LPP are solved on the basis of the following assumptions.
1. Proportionality. There must be proportionality between objectives and constraints.
2. Additivity. Sum of the resources used by different activities must be equal to the total
quantity of resources.
3. Divisibility. The solution need not be in whole numbers.
4. Certainty. Coefficients in the objective function and constraints are completely known and
do not change during the period under study.
5. Finiteness. Activities and constraints are of finite number.
6. Optimality. The solution to a problem is to be optimum (maximum or minimum).
Requirements for employing LP technique
1. Definition of the objective. A well defined objective is the first basic requirement. The
objective may be (i) production at least cost (ii) obtaining maximum profit (iii) the best
distribution of the productive factors within a fixed period of time.
2. Quantitative measurement of the elements of problem. It is essential that each element of a
problem is capable of being expressed numerically.
3. Alternatives. There must be alternative courses of action to choose.
4. Constraints. There must be limitations of resources. These give rise to constraints.
5. Non-negative restrictions. Decision variables must assume only non-negative values.
6. Linearity. Both the objective function and constraints must be expressed in terms of linear
equations or inequalities.
7. Finiteness. There must be finite number of activities and constraints. Otherwise optimal
solution cannot be obtained.
Characteristics of LPP
1. Objective function. The objective function is of the form z = + + ...+ ,
where , , . . . , are constants and , , . . . , are decision variables.
2. Linear constraints. There are a set of restrictions imposed on the variables appearing in the
objective function. These restrictions are due to limitations of resources. Constraints are of the
form + + ...+ b (or b) where , , . . . , and b are constants.
There may be more than one constraint.
3. Feasible solution. A feasible solution to a LPP is a set of values of the decision variables
, ,..., which satisfy the constraints.
4. Optimal solution. There can be one or more feasible solutions to a LPP. A feasible solution
which optimizes the objective function is known as optimal solution.
Formation of Mathematical model to a LPP
Formation of suitable mathematical model to explain the given situation is the starting point of linear
programming. The following steps are applied in this process.
Step 1. Identify the objective as maximization or minimization.
Step 2. Mention the objective quantitatively and express it as linear function of decision variables,
known as objective function.
Step 3. Identify the constraints in the problem and express them as linear inequalities or equations
of the decision variables. The non-negative conditions such as 0, ..., 0
are also included where , , . . . , are decision variables.
Standard form of a mathematical model of LPP
A general LPP can be stated as
Find , ,..., which optimize
z= + + ...+
Subject to + + ...+ (or ) . . . (1)
+ + ...+ (or ) . . . (2)
... ... ... ... ... ...
+ + ...+ (or ) . . . (m)
and 0, ..., 0 . . . . (n)
where all ’s, ’s, ’s are constants and ’s are decision variables.
The conditions (1) to (m) are called structural constraints and the condition (n) is called non-negative
constraint. ’s are called cost or profit coefficients. ’s are called structural coeffiients and ’s are
called requirements.
Example. A company has three operational departments weaving, processing and packing with
capacity to produce three different types of clothes namely suiting, shirting and woolens yielding a
profit of Rs.2, Rs.4, Rs.3 per metre respectively. One metre of suiting requires 3 minutes in weaving,
2 minutes in processing and 1 minute in packing. Similarly one metre of shirting requires 4 minutes
in weaving, 1 minute in processing and 3 minutes in packing. One metre of woolen requires 3 minutes
in each department. In a week, total run time of each department is 60, 40 and 80 hours for weaving,
processing and packing respectively. Formulate the LPP to find the product mix to maximize the
profit.
Answer:
Departments (time taken in minutes) Profit
Types of clothes (Rs. per metre)
Weaving Processing Packing
Suiting ( metre) 3 2 1 2
Shirting ( metre) 4 1 3 4
Woolens ( metre) 3 3 3 3
Available time 3600 2400 4800
(in minutes)
Eg. 2. An animal feed company produce 200lbs of a mixture containing the ingredients and
costs Rs.3 per lbs and costs Rs. 8 per lbs. Not more than 80 lbs of can be used and
minimum quantity to be used for is 60 lbs. Find how much of each ingredient should be used if
the company wants to minimize the cost. Formulate LPP.
Answer:
Ingredients Cost per lbs (Rs.) Quantity allowed
3 80
8 60
Total 200
4 x=3
3 (0, 3)
. y=2
2
(4, 0)
0 1 2 3 4 5 y=0
x -axis
Note: We can find the point of intersection of two lines by solving the equations of the lines
Eg. Find the point of intersection of the lines + = 20 and 3 +2 = 48
Answer. The lines are + = 20 . . . (1) and 3 +2 = 48 . . . (2). Solving (1) and (2) we get
the point of intersection.
+ = 20 . . . (1)
3 +2 = 48 . . . (2).
+ = 20
Put = 0, then = 20 One point is (0, 20) 0 20
20 0
Put = 0, then = 20 Another point is (20, 0)
25 (0, 24)
𝑥 =0
20 A
15
𝑥 - axis
. B
10
(16, 0) C
O
0 5 10 15 20 25 =0
-axis
The feasible region is OABC. Coordinates of O, A, B, C are (0, 0), (0, 20), (8, 12), (16, 0).
To find the coordinates of B, solve equations 3 +2 = 48 and + = 20
+ = 20 . . . (1)
3 +2 = 48 . . . (2).
2 (1) gives 2 +2 = 40 . . . (3)
(2) – (3) gives =8
Substituting in (1) we get 8 + = 20 = 20 – 8 = 12. The point of intersection is (8, 12)
Points Z = 22 +18
O 0 0 0
A 0 20 0 + 18x20 = 360
B 8 12 22x8 + 18x12 =392
C 16 0 22x16 + 18x0 = 352
= 0, =0
= 0 is the –axis and = 0 is the -axis
+ = 450
0 450
Put = 0, then = 450. One point is (0, 450) 450 0
Put = 0, then = 450 Another point is (450, 0)
2 + = 600
Put = 0, then = 600 One point is (0, 600)
Put = 0, then 2 = 600, so = 300 Another point is (300, 0) 0 600
300 0
𝑥 =0
600
500
A
400
300 B
𝑥 - axis
.
200
100
C
O
0 100 200 300 400 500 =0
-axis
The feasible region is OABC. Coordinates of O, A, B, C are (0, 0), (0, 450), (150, 300), (300, 0).
To find the coordinates of B, solve equations + = 450 and 2 + = 600
+ = 450 . . . (1)
2 + = 600 . . . (2)
Points Z=3 +4
O 0 0 0
A 0 450 0 + 4x450 = 1800
B 150 300 3x150 + 4x300 = 1650
C 300 0 3x300+ 4x0 = 900
Z is highest for the point A. So the solution is = 0, = 450 and Z = 1800
Linear Programming Problem – Solution by Simplex method
Simplex method is a linear programming technique in which we start with a certain solution which is
feasible. We improve this solution in a number of consecutive steps until we arrive at an optimal
solution. For arriving at the solution of LPP by this method, the constraints and the objective function
are presented in a table known as simplex table.
The simplex method is an iterative (step by step) procedure in which we proceed in systematic
steps from an initial basic feasible solution to another basic feasible solution and finally arrive at an
optimal solution. The simplex algorithm consists of the following steps.
1. Find a trial basic feasible solution of the LPP
2. Test whether it is an optimal solution or not
3. If not optimal, improve the first basic feasible solution by a set of rules
4. Repeat the steps 2 and 3 till an optimal solution is obtained
Feasible solution
A feasible solution to a LPP is the set of values of the variables which satisfy all the constraints and
non-negative restrictions of the problem.
Optimal (Otimum) solution
A feasible solution to a LPP is said to be optimum if it optimizes the objective function Z of the
problem.
Basic feasible solution
A feasible solution to a LPP in which the vectors associated to non-zero variables are linearly
independent is called a basic feasible solution.
Slack variables
If a constraint has a sign then in order to make it an equality we have to add some variable to the
L.H.S. The variables which are added to the L.H.S of the constraints to convert them into equalities
are called the slack variables.
Eg. Consider the constraint 2 + 600. To convert the constraint into equation we add to
L.H.S then we have 2 + + = 600. Then is the slack variable.
Surplus variable
If a constraint has a sign then in order to make it an equality we have to subtract some variable
from the L.H.S. The variables which are subtracted from the L.H.S of the constraints to convert them
into equalities are called surplus variables.
Eg. Consider the constraint 2 + 600. To convert the constraint into equation we subtract to
L.H.S then we have 2 + - = 600. Then is the surplus variable.
To construct a simplex table
Simplex table consists of rows and columns. If there are m original variables and n introduced
variables (slack, surplus or artificial variables) then there will be 3 + m+ n columns in the simplex
table. First column (B) contains the basic variables. Second column (C) shows the coefficients of the
basic variables in the objective function. Third column ( ) gives the values of basic variables. Each
of next m+n columns contains coefficients of variables in the constraints, when they are onverted into
equations.
Basis (B). The variables whose values are not restricted to zero in the current basic solution, are listed
in the first column of the simple table known as basis.
Basic variables. The variables which are listed in the basis are called basic variables and others are
known as non- basic variables.
Vector. Any column or row of a simplex table is called a vector. In simplex table there is a vetor
associated with every variable. The vectors associated with the basic variables are unit vectors.
Unit vector. A vector with one element 1 and all other elements zero is a unit vector.
Net evaluation ( )
is the net profit or loss if one unit of is introduced.the row containing values is called net
evaluation row or index row. = - , where is the coefficient of variables in the objective
function and is the sum of the product of coefficients of basic variables in the objective function
and the vector .
Minimum ratio. Minimum ratio is the lowest non negative ratio in the replacing ratio column. The
replacing ratio column ( ) contains values obtained by dividing each element in ( ) by the
corresponding elements in the incoming vector.
Key column (incoming vector)
The column which has highest negative in a maximization problem or the highest positive in
the minimization problem, is called incoming vector.
Key row (outgoing vector)
The row which relates to the minimum ratio, is the outgoing vector.
Key element. Key element is the element of the simplex table which lies both in key row and key
column.
Iteration. Iteration means step by step process followed in simplex method to move from one basic
feasible solution to another.
Simplex algorithm.
Step 1. Formulate the problem into a LPP
Step 2. Convert the constraints into equations by introducing the slack variables or surplus variables
wherever necessary.
Step 3. Construct starting simplex table
Step 4. Conduct the test of optimality. This is done by computing the net evaluation = - . The
solution is not optimal if at least one is negative for maximization case. If at least one is positive
the solution is not optimal for minimization case. Otherwise the solution is optimal. If the solution is
not optimal we proceed to the next step
Step 5. Find incoming and outgoing vectors. The incoming vector corresponds to highest negative
for maximization cases and highest positive for minimizationcases. Outgoing vector
corresponds to minimum ratio. Minimum ratio is the lowest non negative ratio in the replacing ratio
column.
Step 6. The element which is at the intersection of incoming vector and outgoing vector is called the
key element. We mark this element in
There should be 1 at the position of key element. If it is not 1 then divide all the elements of the row ,
containing key element , by the key element. Then add appropriate multiples of the corresponding
elements of this changed row to the elements of all other rows. Now obtain the next simplex table
with the changes. Improve basic feasible solution can be read out from the simplex table. The
solution is obtained by reading B column and ( ) column together.
Step 7. Now test the above improved basic feasible solution for optimality as in step 4. If the solution
is not optimal then repeat steps 5 and 6 until an optimal solution is finally obtained.
Note. A minimization problem can be converted into maximization problem by changing the sign of
coefficients in the objective function. Eg. To minimize Z = 4 -2 + , we can
maximize Z’ = - 4 + 2 - subject to the same constraints.
Page C.52 Question 5.
Max. Z = 3 +2
s.t + 4
- 2
0, 0
Answer: Converting the constraint inequalities as equalities, by introducing the slack variables,
+ + = 4, - + =2
i.e + + +0 = 4 . . . (1) - +0 +1 = 2 . . . (2)
Then the objective function becomes, Z = 3 +2 +0 +0
values are 3, 2, 0, 0
B Repl. Ratio
(1) (2) (3) (4) (5) (6) (7) =
0 4 1 1 1 0 4 1=4
0 2 1 -1 0 1 2 1=2
0 0 0 0
3 2 0 0
= - -3 -2 0 0
Solution is not optimal as some are negative. Highest negative is -3 which relates to
Incoming vector is . Minimum ratio ( ) = 2. Outgoing vector is . key elment = 1
II Simplex table
B Repl. Ratio
=
0 2 0 2 1 -1 2 2=1
3 2 1 -1 0 1 2 -1 = - 2
3 -3 0 3
3 2 0 0
= - 0 -5 0 3
Solution is not optimal as some are negative. Highest negative is -5 which relates to
Incoming vector is . Minimum ratio ( ) = 1. Outgoing vector is . Key element = 2
2 1 0 1
3 3 1 0
3 2
3 2 0 0
= - 0 0
0 0 0 0
5 3 0 0
= - -5 -3 0 0
Solution is not optimal as some are negative. Highest negative is -5 which relates to
Incoming vector is . Minimum ratio ( ) = 2. Outgoing vector is . Key element = 5
II Simplex table
B Repl. Ratio
=
0 9 0 1 9 =
5 2 1 0
2 =5
5 2 0 1
5 3 0 0
= - 0 -1 0 1
Solution is not optimal as some are negative. Highest negative is -1 which relates to
3 0 1
5 1 0
5 3
5 3 0 0
= - 0 0
No negative . So the solution is optimal. The solution is = , =
Z=5 +3 =5 +3 = = = 12.36
Eg. Min. Z = -3 +2
s.t 3 - +3 7
-2 +4 12
-4 +3 +8 10
, , 0
Answer. This is a minimization problem. Convert it into a maximization problem.
Maximize Z’ = - +3 -2 (changing the sign of the coefficients)
Converting the constraint inequalities as equalities, by introducing the slack variables,
3 - +3 + = 7, - 2 +4 + = 12, - 4 +3 +8 + = 10
Then the objective function becomes, Z’ = - +3 -2 + +0 +0
values are -1, 3, -2, 0, 0, 0
0 0 0 0 0 0
-1 3 -2 0 0 0
= - 1 -3 2 0 0
Solution is not optimal as some are negative. Highest negative is -3 which relates to
Incoming vector is . Minimum ratio ( ) = 3. Outgoing vector is . Key elment = 4
II Simplex table
B Repl. Ratio
=
0 10 0 3 1 0 10 =4
3 3 1 0 0 0 3 =-6
0 1 0 8 0 1
1 =
3 0 0 0
-1 3 -2 0 0 0
= - 0 2 0 0
Solution is not optimal as some are negative. Highest negative is - which relates to
Incoming vector is . Minimum ratio ( ) = 4. Outgoing vector is . Key elment =
-1 4 1 0 0
3 5 0 1 0
0 11 0 0 11 1 1
-1 3
0
-1 3 -2 0
0 0
= - 0 0 0
Solution is not optimal as some are negative. Highest negative is -6M + 6 which relates to
Incoming vector is . Minimum ratio ( ) = 300. Outgoing vector is . Key elment = 5
II Simplex table (dropping
B Repl. Ratio
=
-M 900 0 -1 1
900 =
- M -6 - M M -M
-6 0 -M
-5 0
= - M+ 0 - M M 0
Solution is not optimal as some are negative. Highest negative is M+ , which relates to
-6 0 1
-5 1 0
-5 -6 1 1
-5 -6 0 0
= - 0 0 1 1
Solution is not optimal as some are negative. Highest negative is -2M + 8 which relates to
Incoming vector is . Minimum ratio ( ) = 60. Outgoing vector is . Key element = 1
-M -8 0 -M + 8 -M
-3 -8 0 0 -M
= - -M+3 0 0 -M + 8 0
Solution is not optimal as some are negative. Highest negative is - M + 3, which relates to
Incoming vector is . Minimum ratio ( ) = 80. Outgoing vector is . Key element = 1
III Simplex table
B Repl. Ratio
=
-M 60 0 0 -1 1 1 60 1 = 60
-3 80 1 0 1 0 0 80 0=
-8 60 0 1 0 -1 0 60 -1 = -60
-3 -8 M-3 -M + 8 -M
-3 -8 0 0 -M
= - 0 0 M -3 -M + 8 0
Solution is not optimal as some are negative. Highest negative is - M + 8, which relates to
Incoming vector is . Minimum ratio ( ) = 80. Outgoing vector is . Key element = 1
IV Simplex table
B
0 60 0 0 -1 1
-3 80 1 0 1 0
-8 120 0 1 -1 0
-3 -8 5 0
-3 -8 0 0
= - 0 0 5 0
Answer: Since all the constraints are equations only artificial variables are introduced. Introducing
the artificial variables, the constraints become,
+2 +3 + = 15
2 + +5 + = 20
+2 + + = 10
(the third equation does not require an artificial variable since the vector has the unit vector ( ),
as its coefficients)
Then the objective function becomes, Z = +2 +3 - -M -M
values are 1, 2, 3, -1, -M, -M
Starting simplex table
B Repl. Ratio
=
-M 15 1 2 3 0 1 0 15 3 = 5
-M 20 2 1 5 0 0 1 20 5=4
-1 10 1 2 1 1 0 0 10 1 = 10
-3M -1 -3M-2 -8M-1 -1 -M -M
1 2 3 -1 -M -M
= - -3M-2 -3M-4 -8M-4 0 0 0
Solution is not optimal as some are negative. Highest negative is -8M + 4 which relates to
Incoming vector is . Minimum ratio ( ) = 4. Outgoing vector is . Key elment = 5
B Repl. Ratio
=
-M 3 0 0 1 3 =
3 4 1 0 0 4 = 20
-1 6 0 1 0 6 =
+ - 3 -1 -M
3 -1 -M
1 2
= - - - 0 0 0
Solution is not optimal as some are negative. Highest negative is - which relates to .
Incoming vector is . Minimum ratio ( ) = . Outgoing vector is . Key element =
III Simplex table
B Repl. Ratio
=
2 1 0 0 = -15
1
3 0 0 =
0
-1 0 1 =
2 3 -1
2 3 -1
1
= - 0 0 0
Solution is not optimal as some are negative. Highest negative is , which relates to
Incoming vector is . Minimum ratio ( ) = . Outgoing vector is . Key element =
IV Simplex table
2 0 1 0
0 0 1
3
1 0 0
1
1 2 3 0
1 2 3 -1
= - 0 0 0 1
Maximum of Z = +2 +3 - = (1 ) + (2 ) + (3 ) – 0 = 15.
Unbounded solution
When a LPP does not have finite valued solutions, the solution is said to be unbounded. In graphic
method the feasible region will be unbounded. In simplex method, minimum ratio cannot be obtained.
Eg. Solve, Max. Z = 2 +
s.t - 2
2 - 3
, 0
Answer. Applying graphic method. Writing the constraints as equations,
- =2
2 - =3
= 0, =0
0 -2
= 0 is the –axis and = 0 is the -axis
2 0
- =2
Put = 0, then - =2 = - 2. One point is (0, -2)
Put = 0, then = 2. Another point is (2, 0)
2 - =3
Put = 0, then = -3 One point is (0,-3)
Put = 0, then = Another point is ( , 0)
0 -3
0
3
𝑥 =0
1
𝑥 - axis
.
0
1 2 3 -axis
-1
-2
-3
B Repl. Ratio
=
0 2 1 -1 1 0 2 1=2
0 3 2 -1 0 1 3 2 = 1.5
0 0 0 0
2 1 0 0
= - -2 -1 0 0
Solution is not optimal as some are negative. Highest negative is -2 which relates to
Incoming vector is . Minimum ratio ( ) = 1.5. Outgoing vector is . Key element = 2
II Simplex table
B Repl. Ratio
=
0 0 1 = -1
2 1 0 = -3
2 -1 0 1
2 1 0 0
= - 0 -2 0 1
Now both the values of are negative. There is no outgoing vector. The solution is unbounded.