1. OT - Linear Programming Problem [Repaired]
1. OT - Linear Programming Problem [Repaired]
TECHNIQUES
Course Instructor
Er. Suraj Shrestha
Assistant professor
Department of Electrical Engineering
17/6/2026 Asst. Prof. Suraj Shrestha, IOE-PAS(WRC), TU 1
Evaluation Scheme Evaluation Scheme
Internal 40 External 60
Attendance 5
Assignment 10
Assessment 20
Mini Project/Paper review 5
REFERENCE BOOKs
1. JK Sharma, Operation Research; Theory and Applications, Trinity
Publication.
2. Rao, Singiresu S. Engineering Optimization: theory and practice. John
Wiley & Sons, 2019.
3. Taha, Hamdy A. Operations research: an introduction. Pearson Education
India, 2013.
4. Prof. G Srinivasan, Operation Research: Principles and Applications,2010
17/6/2026 Asst. Prof. Suraj Shrestha, IOE-PAS(WRC), TU 2
1. Linear Programming Problem
Mathematical Formulation
Example 1
Product Mix Problem
A shop can make two types of sweets (A and B). Let x1 be the number packet of sweets A made Decision
they use two resources flour and sugar. To make one Let x2 be the number packet of sweets B made Variable
packet of A, they need 3Kg of flour and 3 kg of
sugar. To make one packet of B they need 3 Kg of Maximize Z 1000 x1 900 x2 Objective Function
flour and 4 Kg of sugar. They have 21 Kg of Flour Subject to
and 28Kg of sugar. These sweets are sold at Rs. 3 x1 3 x2 21
1000 and 900 per packet respectively. Find the best Constraints
3 x1 4 x2 28
product mix to maximize the revenue.
x1 , x2 0 Non Negativity Restrictions
portfolio have a risk rating of 4 and 9, resp. on a scale Inherited money; x1 x2 100000
of 0 to 10. Maximum allowed investment in each portfolio;
x1 75000, x1 75000
Since you wish to maximize your returns, you will not
Acceptable return; 0.1x1 0.2 x2 0.12( x1 x2 )
accept an average rate of return below 12% or a risk
Accetable risk factor; 4 x1 9 x2 6( x1 x2 )
above 6. Hence you face the important question… How
Step 4: Writing Non- Negativity restrictions
much should you invest in each portfolio? Formulate x1 , x2 0
this as an LPP.
17/6/2026 Asst. Prof. Suraj Shrestha, IOE-PAS(WRC), TU 9
Mathematical Formulation Example 6
The postal department is considering the purchase of
Now, The LPP is vehicles to pick up and deliver mail from various offices.
Maximize Z 0.1x1 0.2 x2 They are considering three types of vehicles. Thos cost of
each these are Rs. 5 lakhs, Rs. 10 lakhs and Rs. 8 lakhs per
Subject to
vehicle, respectively. These require a crew of 2, 4 and 1
x1 x2 100000, persons per day considering multiple shifts. They expect
x1 75000, x2 75000, these to run 60, 100 and 80 km per day. They expect that
0.1x1 0.2 x2 0.12( x1 x2 ), total distance to be covered by the vehicles per day would
be 2000km. Based on the fuel economy, the operating cost
4 x1 9 x2 6( x1 x2 ), per day for these vehicles are Rs. 200, Rs. 350 and Rs. 300
x1 , x2 0 per day. They have budget restriction of Rs. 1.6 Crore and
have 80 people available as crew. Formulate a model to
minimize the operating cost.
Now, The LPP is
Minimize Z 200 x1 350 x2 300 x3
Subject to 5 x 10 x 8 x 160, ( Budget )
1 2 3
2 x1 4 x2 x3 80, (Crew)
60x1 100 x2 80 x3 2000
17/6/2026 x1 , x2 , x3 0, and integers
Asst. Prof. Suraj Shrestha, IOE-PAS(WRC), TU 10
Example 7 Step 1: Identifying Decision Variables
A manufacturer produces three models I, II and III of a Let x1 , x2 and x3 be the number of production of
certain product using raw material A and B. the following each model.
table gives data for the problem:
Step 2: Writing Objective Function
To Maximize total Price or profit.
Z 30 x1 20 x2 50 x3
Demand
Step 4: Writing Non- Negativity restrictions
X 11 X 21 X 31 X 41 175 X ij 0
X 12 X 22 X 32 X 42 125
X 13 X 23 X 33 X 43 150
X 14 X 24 X 34 X 44 250
X 15 X 25 X 35 X 45 200
17/6/2026 Asst. Prof. Suraj Shrestha, IOE-PAS(WRC), TU 16
Now, The LPP is
Supply
Minimize Z 275 X 350 X 425 X 225 X 150 X
11 12 13 14 15
X 11 X 12 X 13 X 14 X 15 300
300 X 21 325 X 22 450 X 23 175 X 24 100 X 25
X 21 X 22 X 23 X 24 X 25 250
250 X 31 350 X 32 475 X 33 200 X 34 125 X 35
X 31 X 32 X 33 X 34 X 35 150
325 X 41 275 X 42 400 X 43 250 X 44 175 X 45 X 41 X 42 X 43 X 44 X 45 200
Subject to
X ij 0
Demand
X 11 X 21 X 31 X 41 175
X 12 X 22 X 32 X 42 125
X 13 X 23 X 33 X 43 150
X 14 X 24 X 34 X 44 250
X 15 X 25 X 35 X 45 200
1. Linearity: The Objective function and constraints are linear. The profit from
Feasible Region: Common region of graph where all constraints are satisfied.
Feasible Solution: Values of Decision variable which satisfy all the constraints.
Optimal Solution: Best Feasible solution for most favorable value of objective function.
x1 , x2 0
4. Leaving Var
CBj x1 x2 x3 x4 RHS(Bj) (ratio)
3x1 2 x2 12 (xBj)
x1 , x2 0 0 x3 1 1 1 0 5 5/1=5
5. Pivot Element
Variable with maximum positive cj-zj
enters
17/6/2026 Variable
Asst. Prof. Suraj Shrestha, IOE-PAS(WRC), TU with minimum ratio Leaves. 36
Simplex table
Cj 6 5 0 0
CBj Basis x1 x2 x3 x4 RHS(Bj) ?
0 x3 1 1 1 0 5 5/1=5
0 x4 3 2 0 1 12 12/3=4
Zj 0 0 0 0 0
Cj -Zj 6 5 0 0 Minimum
ratio
0 x3 0 1/3 1 -1/3 1 1 1/3=3 R1new R1old R2 new 1 1 1 0 : 5 1 2 / 3 0 1 / 3 : 4
Zj 6 4 0 2 24
Cj -Zj 0 1 0 -2
5 x2 0 1 3 -1 3 R1new R1old 3
6 x1 1 0 -2 1 2 R2 new R2 old 2 / 3 R1new
1 2 / 3 0 1/ 3 : 4 2 / 3 0 1 3 1 : 3
Zj 6 5 3 1 27
1 0 2 1 : 2
Cj -Zj 0 0 -3 -1
Here all cj-zj ≤0, we have reached to optimal solution.
17/6/2026
The Optimal values are x1=2, x2=3. Max Z=27.
Asst. Prof. Suraj Shrestha, IOE-PAS(WRC), TU 37
Example 11 Maximize Z = 6x1 8 x2
subject to
x1 x2 10
2x1 3 x2 25
x1 5 x2 35
x1 , x2 0
Solution:
Writing given LPP in Standard form
Maximize Z = 6x1 + 8x2 + 0.x3 + 0.x4 + 0.x5
Subject to
x1 + x2 + x3 = 10
2x1 + 3x2 + x4 = 25
x1 + 5x2 + x5 = 35
x1 , x2, x3, x4 0
• Since artificial variable are not the part of problem, they should not be part of
solution. We give small contribution of artificial variable to objective function.
ii. For each “=“ type constraints, add only artificial variable (required to obtain
basic feasible solution.)
2. In objective function, assign a very high (Negative coefficient) penalty for each
artificial variable and assign zero “0” for each surplus variable.
3. Apply Simplex method to above formulated LPP and derive the optimal solution.
Cj -Zj 0 -M 0 -
Max W = 0.x1+0.x2+…..+[Link]-a1-a2-….-am
(-1) is the price added for each of the artificial variable a1,a2,,….,am
0 price is assigned to each of the variables x1,x2,…,xn including slack and surplus
variables.
3. Apply Simplex method to above formulated LPP and derive the optimal solution.
17/6/2026 Asst. Prof. Suraj Shrestha, IOE-PAS(WRC), TU 45
Two Phase Method contd.
Phase II
1. When iteration of phase I ends, then we go to phase II to obtain the optimum value
of the objective function of the original problem.
2. Assign actual co-efficient of the variable including slack and surplus variables and
zero coefficient value to any artificial variable present in the basis of the last table
of phase I. Also remove the artificial variables which are not present in the basis of
last table of Phase I.
Cj-Zj -15/4 0 0 0 -M
Here all Cj – Zj 0, algorithm terminates.
The optimal solution is, x1 = 0, x2 =3/2, Zmax = 15/2
17/6/2026 Asst. Prof. Suraj Shrestha, IOE-PAS(WRC), TU 50
Simplex table
Termination conditions Cj 4 3 0 0
a. Degeneracy CBj Basis x1 x2 x3 x4 RHS
Example 15 0 x3 2 3 1 0 8 8/2 =4
Maximize Z = 4x1 3 x2 0 x4 3 2 0 1 12 12/3= 4
subject to
Zj 0 0 0 0 0
4x1 3 x2 8
3x1 2 x2 12
Cj - Z j 4 3 0 0
x1 , x2 0 0 x3 0 5/3 1 -2/3 0 X R1newR1old -2 R2new
Solution: 4 x1 1 2/3 0 1/3 4 4/(2/3)= 6 R2new1/3R2old
Maximize Z = 4x1 3 x2 0.x3 0.x4 Zj 4 8/3 0 4/3 16
subject to Cj - Z j 0 1/3 0 -4/3
2x1 3 x2 x3 =8 R1new3/5R1old
3 x2 0 1 3/5 -2/5 0
3x1 2 x2 + x4 12
4 x1 1 0 -2/5 3/5 4 R2new1R2old -2/3 R1new
x1 , x2 , x3 , x4 0
Zj 4 3 1/5 6/5 16
Cj - Z j 0 0 -1/5 -6/5
Maximize Z = 4x1 3 x2
Zj 0 0 0 0 0
subject to Cj - Zj 4 3 0 0
8x1 6 x2 25 4 x1 1 3/4 1/8 0 25/8 25/8*4/3 R1new1/8 R1old
= 25/6
3x1 6 x2 15 0 x4 0 7/4 -3/8 1 45/8 45/14 R2newR2old - 3R1new
x1 , x2 0
Zj 4 3 1/2 0 25/2
Solution: Cj - Zj 0 0 -1/2 0
Maximize Z = 4x1 3 x2 0.x3 0.x4
4 x1 1 0 2/7 -3/7 5/7 R1newR1old – 3/4R2new
subject to
8x1 6 x2 x3 = 25 3 x2 0 1 3/4 4/7 45/14 R2new4/7 R2old
3x1 6 x2 + x4 15 Zj 4 3 1/2 0 25/2
x1 , x2 , x3 , x4 0 Cj - Zj 0 0 -1/2 0
It looks as though the simplex algorithm seems to be getting into an infinite loop, although the optimal solution has been
found. This phenomenon is called alternate optimum. All non basic Cj – Zj 0 , at least one non basic Cj – Zj = 0, can
enter basis.
17/6/2026 Asst. Prof. Suraj Shrestha, IOE-PAS(WRC), TU 53
c. Unboundedness Simplex table
Cj 4 3 0 0
Example 17
CBj Basis x1 x2 x3 x4 RHS (Bj)
Maximize Z = 4x1 3 x2
0 x3 1 -6 1 0 5 5
subject to
x1 6 x2 5 0 x4 3 0 0 1 11 11/3
3x1 11 Zj 0 0 0 0 0
x1 , x2 0 Cj - Z j 4 3 0 0
Solution: 0 x3 0 -6 1 -1/3 4/3 X R1newR1old – R2new
Maximize Z = 4x1 3 x2 0.x3 0.x4
4 x1 1 0 0 1/3 11/3 X R2new1/3R2old
subject to
x1 6 x2 x3 =5 Zj 4 0 0 4/3 44/3
3x1 + x4 11 Cj - Z j 0 3 0 -4/3
x1 , x2 , x3 , x4 0
Here, x2 can enter the basis, but we are unable to fix the leaving variable,
because all co-efficient entering column are 0. the algorithm terminates,
cause unable to find leaving variable.
This phenomena is called unboundedness, indicating x2 can take any value.
Some Results:
Primal Problem Dual Problem Conclusions
Feasible Solution Feasible Solution Finite optimal solution for both exists.
-2x1 3 x2 5 Zj -1 -7 0 1 -9
Cj -Zj -3 0 0 -1
- x1 7 x2 9
21/11 - - 7/3
x1 , x2 0
Writing given LPP in Standard form -4 x1 1 0 -7/11 3/11 8/11 R1new 7 / 11 R2 new
Maximize Z* =-Z=- 4x1 7 x2 0.x3 0.x4 -7 x2 0 1 -1/17 -20/119 145/119 R2 new R2 old 1/ 7 R1new
1 1
-4 35/17 -177/7 7 1 0 7 : 9 / 7
subject to Zj -7 8/17
1 7 3
1 0 : 8 / 17
-2x1 3 x2 x3 5 -35/17 7
Cj -Zj 0 0 -8/17 11 11
0 1 1 / 17 20 / 119 : 145 / 119
- x1 7 x2 x4 9
x1 , x2 , x3 , x4 0
17/6/2026 Asst. Prof. Suraj Shrestha, IOE-PAS(WRC), TU 60
Example 20 Minimize Z = 7x1 5 x2 Cj -7 -5 0 0
x1 x2 4 0 x3 -1 -1 0 0 -4
5x1 2 x2 10 0 X4 -5 -2 0 1 -10
x1 , x2 0 Zj 0 0 0 0
Solution:
Cj - Z j -7 -5 0 0
Above LPP can be written as
Maximize Z* =-Z=- 7x1 5 x2 7/5 5/2 - -
x1 , x2 0 Cj - Z j 0 -11/5 0 7/5
Writing given LPP in Standard form - 11/5 7/5
Maximize Z* =-Z=- 7x1 5 x2 0.x3 0.x4 -5 x2 0 1 -5/3 1/3 10/3 R1new-5/3R1old
subject to -7 X1 1 0 2/3 -1/3 2/3 R2newR20ld -2/5R1new
-2x1 3 x2 x3 4 Zj -7 -5 11/3 2/3 -64/3
- 5x1 2 x2 x4 10 Cj - Z j 0 0 -11/3 -2/3
x1 , x2 , x3 , x4 0
Here, Cj – Zj 0 and RHS are positive, algorithm terminates.
The optimal values, X1 = 2/3, X2 = 10/3, Minimum Z = 64/3
17/6/2026 Asst. Prof. Suraj Shrestha, IOE-PAS(WRC), TU 61
Example 21 Maximize Z = 4x1 x2 5 x3 Dual Simplex table
subject to
Cj 4 -1 5 0 0 0
3x1 4 x2 5 x3 30
CBj Basis x1 x2 x3 x4 x5 x6 RHS(Bj)
5x1 8 x2 7 x3 40
4x1 6 x2 5 x3 36 0 x4 3 4 5 1 0 0 30
x1 , x2 , x3 0 0 x5 -5 -8 -7 0 1 0 -40
The objective of sensitivity analysis is to reduce computational effort considerably; which arises when
some error may appear in the data and requires the solving of problem again and again from beginning.
This will help the calculation in the erroneous problem usable for the solution of correct problem.
Following variations will be studied for post
Effect of these variations in LPP are;
optimality analysis;
Optimal solution remain unchanged i.e.
Variation in cost vector “c”
basic variable and their value remain
Variation in requirement vector “b unchanged.
Variation in element of matrix “A” Basic variable remain the same but these
Addition or deletion of new variable value have been changed
Addition or deletion of new constraints The basic solution changes entirely.
Asst. Prof. Suraj Shrestha, IOE-PAS(WRC), TU 64
17/6/2026