LPP_I
LPP_I
problem.
• An optimal solution represents the best possible outcome for a specific problem, such as
least cost, highest margin, or least time.
• Example: Manufacturing issues involve determining the optimal number of units to
produce or sell, aiming to maximize profits. This challenge arises when each product
requires a fixed amount of manpower, machine hours, and raw materials.
• Formation of linear programming problem, involves identifying:
• Decision Variables:
Variables such as x and y that determine the outcome of the linear programming
problem, representing the final solution.
• Objective Function:
Typically denoted as Z, it is a linear function that needs optimization based on given
conditions to achieve the final solution. Coefficients of the decision variables in the
objective function are also called as costs.
• Constraints:
Restrictions imposed on decision variables, limiting their values and influencing the
feasible solutions.
• Non-Negative Restrictions:
Imposed conditions that ensure decision variables (like x and y) are non-negative,
reflecting real-world limitations.
Note: A feasible solution of an LPP satisfies all the constraints, while an optimal solution is a special
case of a feasible solution that either maximizes or minimizes the objective function.
The general form of a linear programming problem is expressed as:
Objective Function: 𝑍 = 𝑎𝑥 + 𝑏𝑦
Constraints: 𝑐𝑥 + 𝑑𝑦 ≥ 𝑒, 𝑝𝑥 + 𝑞𝑦 ≤ 𝑟
Non-Negative Restrictions: 𝑥 ≥ 0, 𝑦 ≥ 0
Here, 𝑥 and 𝑦 serve as the decision variables in the given conditions.
Linear Programming Graphical Method
• In the process of solving linear programming problems (LPP), we begin by graphically plotting all
the inequalities corresponding to the constraints on an 𝑋𝑌 graph.
• The common region formed by the intersection of these plotted inequalities called as feasible
region (optimal region/ convex region).
• To determine the optimum solution, we calculate the objective function's value at each corner
point within this feasible region.
• By comparing these values, we can identify and establish the optimal solution for the given LPP,
because
• “Extreme values occur at the vertices of a concave, bounded, feasible region”
• Problem 01:
Maximize: 3𝑥 + 4𝑦
Subjected to constraints: 4𝑥 + 2𝑦 ≤ 80, 2𝑥 + 5𝑦 ≤ 180, 𝑥, 𝑦 ≥ 0 using graphical
method.
Solution:
Given constraints 4𝑥 + 2𝑦 ≤ 80 2𝑥 + 5𝑦 ≤ 180
⇒ 2𝑥 + 𝑦 ≤ 40
Replace inequality by equality ⇒ 2𝑥 + 𝑦 = 40 2𝑥 + 5𝑦 = 180
Find the 𝑥-intercept by taking 𝑦 = 0 𝑦 = 0 ⇒ x = 10 𝑦 = 0 ⇒ x = 90
𝑦-intercept by taking 𝑥 = 0 x = 0 ⇒ y = 40 x = 0 ⇒ y = 36
Draw the lines joining points 10,0 & 0,40 90,0 & 0,36
Shade the region of inequality by 4 0 + 2 0 ≤ 80 2 0 + 5 0 ≤ 180
checking (0,0) lies within the region. ⇒ 0 ≤ 80 ⇒ 0 ≤ 180
i.e., put 0,0 into the inequality; if it Satisfied Satisfied
satisfies the inequality then the Hence mark toward Hence mark toward
region will be toward the origin else 0,0 0,0
it will be on other side
Objective Function : z=3𝑥 + 4𝑦
Calculate 𝑧 value at each vertices and find the minimum and maximum value of 𝑧
𝐾(0,36) 𝑧(0,36) = 144
𝐿(2.5,3.5) 𝑧(2.5,35) = 147.5 𝑧 is maximum
𝑀(20,0) 𝑧(20,0) = 60
𝑂(0,0) 𝑧(0,0) = 0 𝑧 is minimum
• Problem 02:
Maximize: 8𝑥 + 5𝑦
Subjected to constraints: 2𝑥 + 𝑦 ≤ 500, 𝑥 ≤ 150, 𝑦 ≤ 250, 𝑥, 𝑦 ≥ 0 using
graphical method.
Solution:
Given constraints 2𝑥 + 𝑦 ≤ 500 𝑥 ≤ 150 𝑦 ≤ 250
Calculate 𝑧 value at each vertices and find the minimum and maximum value of 𝑧
𝐼(0,250) 𝑧(0,250) = 1250
𝐻(125,250) 𝑧(125,250) = 2250 𝑧 is maximum
𝐺(150,200) 𝑧(150,200) = 2200
𝐽(150,0) 𝑧(150,0) = 1200
• Problem 03:
Minimize: 3𝑥 + 2𝑦
Subjected to constraints: 𝑥 − 𝑦 ≤ 1, 𝑥 + 𝑦 ≥ 3, 𝑥, 𝑦 ≥ 0 using graphical method.
Solution:
Calculate 𝑧 value at each vertices and find the minimum and maximum value of 𝑧
𝐴(2,1) 𝑧(2,1) = 8
𝐻(0,3) 𝑧(0,3) = 6 𝑧 is minimum
Note:
As the columns corresponding to the basic variables 𝐴1 , 𝑠2 and 𝑠3 do not conform to the standard form, it implies that
other than the intersection of the 𝐴1 (and s2 , 𝑠3 ) row with the 𝐴1 (and s2 , 𝑠3 ) column, all entries above and below should
be zero. Here we can see 𝑀 in the last row. Eliminate 𝑀 from row operation
Step2: Eliminate 𝑀 in the objective function: 𝑅4′ → 𝑅4 − 𝑀𝑅1
Step3: Construct the table
Note: Since the value of the penalty 𝑀 is very big, we can assume 𝑀 value as 10( or 100, 1000 also) for our
convivence. Then − 3 + 2𝑀 = −23 and − 𝑀 − 1 = −9. −23 < −9 hence
− 3 + 2𝑀 is the smallest negative number in the last row
Basis 𝑥1 𝑥2 𝑠1 𝑠2 𝑠3 𝐴1 RHS Ratio
𝐴1 2 1 -1 0 0 1 2 1
𝑠2 1 3 0 1 0 0 3 3
𝑠3 0 1 0 0 1 0 4 -
Obj. Func −(3 + 2𝑀) − 𝑀−1 𝑀 0 0 0 −2𝑀
▪ −(3 + 2𝑀) is the smallest negative number in the last row
▪ Column corresponding to the number −(3 + 2𝑀) is the key column
▪ Find the ratio of RHS/Key column
▪ 1 is the smallest positive ratio (Don’t consider negative values)
▪ Row corresponding to the number 1 is the key row
▪ Intersection of key row and key column is the key element, here 2 is the key element.
▪ Leaving variable will be 𝐴1 and entry variable will be 𝑥1 , i.e., replace 𝐴1 in the first column by 𝑥1
▪ Now corresponding columns𝐴1 , 𝑠2 and 𝑠3 should form the identity matrix, hence
▪ The key element is 2 ( not equal to 1 then make the key element 1 by dividing entire key row by 2)
▪ Perform row operations to make all numbers above and below the key element become 0. (Note: Remove 𝑨𝟏 column as 𝑨𝟏
will be removed from the first column, this is applicable only for artificial variables)
▪ Here perform 𝑅1′ → 𝑅1 /2 ; 𝑅2′ → 𝑅2 − R1 ; 𝑅3′ → 𝑅3 ; 𝑅4′ → 𝑅4 + 3 + 2𝑀 𝑅1
Basis 𝑥1 𝑥2 𝑠1 𝑠2 𝑠3 RHS Ratio
𝑥1 1 0.5 -0.5 0 0 1
𝑠2 0 2.5 0.5 1 0 2
𝑠3 0 1 0 0 1 4
Obj. Func 0 2.5 -1.5 0 0 3
Basis 𝑥1 𝑥2 𝑠1 𝑠2 𝑠3 RHS Ratio
𝑥1 1 0.5 -0.5 0 0 1 -2
𝑠2 0 2.5 0.5 1 0 2 4
𝑠3 0 1 0 0 1 4
Obj. Func. 0 2.5 -1.5 0 0 3
Step1 : Introduce slack, surplus and artificial variables also penalty M in the objective function
Max 𝑍 = 3𝑥1 + 2𝑥2 − 0𝑠1 − 0𝑠2 − 𝑀𝐴1 -(1)
Subjected to 2𝑥1 + 𝑥2 + 𝑠1 = 2 -(2)
3𝑥1 + 4𝑥2 − 𝑠2 + 𝐴1 =12 -(3)
𝑥1 , 𝑥2 , 𝑠1 , 𝑠2 , 𝐴1 ≥ 0
Step2: Eliminate 𝑀 in the objective function: 1 + 𝑀 3
Note:
As the columns corresponding to the basic variables 𝑠1 and 𝐴1 do not conform to the standard form, it implies that other
than the intersection of the 𝑠1 (and 𝐴1 ) row with the 𝑠1 (and 𝐴1 ) column, all entries above and below should be zero.
Here we can see 𝑀 in the last row. Eliminate 𝑀 by row operation
Step2: Eliminate 𝑀 in the objective function: 𝑅3′ → 𝑅3 − 𝑀𝑅2
Step3: Construct the table
Note: Since the value of the penalty 𝑀 is very big, we can assume 𝑀 value as 10( or 100, 1000 also) for our
convivence. Then − 3 + 3𝑀 = −33 and − 2 + 4𝑀 = −42. −42 < −33 hence
− 2 + 4𝑀 is the smallest negative number in the last row
Basis 𝑥1 𝑥2 𝑠1 𝑠2 𝐴1 RHS Ratio
𝑠1 2 1 1 0 0 2 2
𝐴1 3 4 0 -1 1 12 3
Obj. Func −(3 + 3𝑀) − 2 + 4𝑀 0 𝑀 0 −12𝑀
▪ −(2 + 4𝑀) is the smallest negative number in the last row
▪ Column corresponding to the number −(2 + 4𝑀) is the key column
▪ Find the ratio of RHS/Key column
▪ 2 is the smallest positive ratio (Don’t consider negative values)
▪ Row corresponding to the number 2 is the key row
▪ Intersection of key row and key column is the key element, here 1 is the key element.
▪ Leaving variable will be 𝑠1 and entry variable will be 𝑥2 , i.e., replace 𝑠1 in the first column by 𝑥2
▪ Now corresponding columns 𝑥2 and 𝐴1 should form the identity matrix, hence
▪ The key element is 1 (if not equal to 1 then make the key element 1 by dividing entire key row by that key element)
▪ Perform row operations to make all numbers above and below the key element become 0.
▪ Here perform 𝑅2′ → 𝑅2 − 4R1 ; 𝑅3′ → 𝑅3 + 2 + 4𝑀 𝑅1
For some large value of 𝑀 say 10, 5𝑀 + 1 = 51 > 0, 4𝑀 + 2 = 42 > 0 and 𝑀 = 10 > 0. Hence, no negative number in
the last row, hence we obtained the optimal level. But 𝑨𝟏 is present in the first column, hence NO SOLUTION
Problem 03: Solve LP problem using big M method (Penalty method).
Min 𝒁 = 𝟐𝒙𝟏 + 𝟑𝒙𝟐
Subjected to 𝒙𝟏 + 𝒙𝟐 ≥ 𝟓
𝒙𝟏 + 𝟐𝒙𝟐 ≥ 𝟔
𝒙𝟏 , 𝒙𝟐 ≥ 𝟎
Step1 : Convert Min 𝑍 in to Maximization problem, then introduce slack, surplus and artificial variables also penalty M
in the objective function
Max Z ∗ = −𝑧 = −2𝑥1 − 3𝑥2 − 0𝑠1 − 0𝑠2 − 𝑀𝐴1 − 𝑀𝐴2 -(1)
Subjected to 𝑥1 + 𝑥2 − 𝑠1 + 𝐴1 = 5 -(2)
𝑥1 + 2𝑥2 − 𝑠2 + 𝐴2 = 6 -(3)
𝑥1 , 𝑥2 , 𝑠1 , 𝑠2 , 𝐴1 , 𝐴2 ≥ 0
Basis 𝑥1 𝑥2 𝑠1 𝑠2 𝐴1 𝐴2 RHS Ratio
𝐴1 1 1 -1 0 1 0 5 5
𝐴2 1 2 0 -1 0 1 6 3
Obj. Func 2 3 0 0 𝑀 𝑀 0
Step2: Eliminate 𝑀 in the objective function: 𝑅3′ → 𝑅3 − 𝑀𝑅1 − 𝑀𝑅2
Step3: Construct the table and follow the procedure of simplex method, we arrive at
Basis 𝑥1 𝑥2 𝑠1 𝑠2 𝐴1 𝐴2 RHS Ratio
𝐴1 1 1 -1 0 1 0 5 5
𝐴2 1 2 0 -1 0 1 6 3
Obj. Func 2 − 2𝑀 3 − 3𝑀 𝑀 𝑀 0 0 −11𝑀
Basis 𝑥1 𝑥2 𝑠1 𝑠2 𝐴1 𝐴2 RHS Ratio
𝐴1 1 1 -1 0 1 0 5 5
𝐴2 1 2 0 -1 0 1 6 3
Obj. Func 2 − 2𝑀 3 − 3𝑀 𝑀 𝑀 0 0 −11𝑀
Hence, there are no negative numbers in the last row, optimal solution is 𝑥1 = 4, 𝑥2 = 1 and 𝑀𝑎𝑥 𝑍 ∗ = −11 ⇒
𝑀𝑖𝑛 𝑍 = −𝑀𝑎𝑥 𝑍 ∗ ⇒11
2-phase Simplex Method
• The two-phase simplex method is another method to solve a given LPP involving some artificial variables. The
solution is obtained in two phases
Phase 1
• In this phase, we construct an auxiliary LPP leading to a final simplex table containing a basic feasible solution to
the original problem.
Step 1 Assign a cost –1 to each artificial variable and a cost 0 to all other variables and get a new objective
function Z* = – A1 – A2 – A3... where Ai are artificial variables.
Step 2 Write down the auxiliary LPP in which the new objective function is to be maximized, subject to the given
set of constraints.
Step 3 Solve the auxiliary LPP by simplex method until either of the following three cases arise:
(i) Max Z* < 0 and at least one artificial variable appears in the optimum basis at positive level.
(ii) Max Z* = 0 and at least one artificial variable appears in the optimum basis at zero level.
(iii) Max Z* = 0 and no artificial variable appears in the optimum basis.
In case (i), given LPP does not possess any feasible solution, whereas in cases (ii) and (iii) we go to phase II.
• Note: Whenever an artificial variable happens to leave in the first column, remove the artificial variable column
Phase II
Use the optimum basic feasible solution of phase I as a starting solution for the original LPP. Assign the actual
costs to the variable in the objective function and a zero cost to every artificial variable in the basis at zero level.
Delete the artificial variable column that is eliminated from the basis in phase I from the table. Apply simplex
method to the modified simplex table obtained at the end of phase I till an optimum basic feasible solution is
obtained or till there is an indication of unbounded solution.
Problem 01: Solve LP problem using two-phase simplex method
Min 𝒁 = −𝟐𝒙𝟏 − 𝒙𝟐
Subjected to 𝒙𝟏 + 𝒙𝟐 ≥ 𝟐
𝒙𝟏 + 𝒙𝟐 ≤ 𝟒 𝒙𝟏 , 𝒙𝟐 ≥ 𝟎
Write the given LPP in standard form
𝑀𝑎𝑥 𝑍 ∗ = 2𝑥1 + 𝑥2 − 0𝑠1 − 0𝑠2 − 𝐴1
STC 𝑥1 + 𝑥2 − 𝑠1 + 𝐴1 = 2
𝑥1 + 𝑥2 + 𝑠2 = 4 , 𝑥1 , 𝑥2 , 𝑠1 , 𝑠2 ≥ 0
Phase 1 : Write the Auxiliary equation 𝑀𝑎𝑥 𝑍 ∗∗ = −𝐴1
STC 𝑥1 + 𝑥2 − 𝑠1 + 𝐴1 = 2 (1)
𝑥1 + 𝑥2 + 𝑠2 = 4 , 𝑥1 , 𝑥2 , 𝑠1 , 𝑠2 ≥ 0
Basis 𝑥1 𝑥2 𝑠1 𝑠2 𝐴1 RHS Ratio
𝐴1 1 1 -1 0 1 2 2
𝑠2 1 1 0 1 0 4 4
Obj. Func 0 0 0 0 1 0
Columns of the basic variables does not form the identity matrix hence eliminate 1 using row operation: 𝑅3′ → 𝑅3 − 𝑅1
Now apply simplex algorithm to solve the obtained LPP
Basis 𝑥1 𝑥2 𝑠1 𝑠2 𝐴1 RHS Ratio
𝐴1 1 1 -1 0 1 2 2
𝑠2 1 1 0 1 0 4 4
Obj. Func -1 -1 1 0 0 -2
Basis 𝑥1 𝑥2 𝑠1 𝑠2 RHS Ratio
𝑥1 1 1 -1 0 2
𝑠2 0 0 1 1 2
Obj. Func 0 0 0 0 0
Since there are no negative numbers in the last row, table is in optimum state. Hence continue to phase 2
Phase 2
Remove the column 𝑨𝟏 and replace the costs of the original objective function in the last row of the table obtained
in phase 1
In Phase 2
Basis 𝑥1 𝑥2 𝑠1 𝑠2 RHS Ratio
1. Remove 𝐴𝑖 ’s columns
𝑥1 1 1 -1 0 2 2. Keep all the rows except
𝑠2 0 0 1 1 2 last row as it is and take the
coefficients of the original obj
Obj. Func -2 -1 0 0 0
function for the last row
Since 𝑥1 and 𝑠2 columns does not constitute the standard form, convert the table in to standard form, i.e., intersection
of 𝑥1 (and 𝑠2 ) row with 𝑥1 (and 𝑠2 ) column =1 and all the elements above and below are 0 by performing row
operation
𝑅3′ → 𝑅3 + 2𝑅1
Basis 𝑥1 𝑥2 𝑠1 𝑠2 RHS Ratio
𝑥1 1 1 -1 0 2 2
𝑠2 0 0 1 1 2 -
Obj. Func 0 1 -2 0 4
Here -2 is the smallest negative number
Columns of the basic variables does not form the identity matrix hence eliminate 1 using row operation: 𝑅4′ → 𝑅4 − 𝑅1
Now apply simplex algorithm to solve the obtained LPP
Basis 𝑥1 𝑥2 𝑥3 𝑠1 𝑠2 𝐴1 RHS Ratio
𝐴1 2 1 -6 0 0 1 20 10
𝑠1 6 5 10 1 0 0 76 12.66
𝑠2 8 -3 6 0 1 0 50 6.25
Obj. Func -2 -1 6 0 0 0 -20