Unit 2 Notes
Unit 2 Notes
2. A company produces two types of items P and Q that require gold and silver. Each unit of type P
requires 4g silver and 1g gold while that of Q requires 1g silver and 3g gold. The company can produce
8g silver and 9g gold. Suppose each unit of type P brings a profit of ₹44 and that of type Q, ₹55. Give
the mathematical formulation for the problem to determine the number of units of each type that the
company should produce to maximise the profit.
3. A company manufactures two products X and Y, each of which requires three types of processing.
The length of time for processing each unit and the profit per unit are given in the following table:
4. A company produces soft drinks and has a contract requiring that a minimum of 80 units of chemical
A and 60 units of chemical B go into each bottle of the drink. The chemicals are available in a prepared
mix from two different suppliers. The supplier X1 has a mix of 4 units of A and 2 units of B that costs
₹10, and the supplier X2 has a mix of 1 unit of A and 1 unit of B that costs ₹4. How many mixes from
the company X1 and company X2 should the company purchase to honour contract requirement and
yet minimise cost?
The value of the objective function at each of these extreme points is as follows:
Extreme Point
Objective function value
Coordinates Lines through Extreme Point
Z=x1+2x2
(x1,x2)
5→x1≥0
O(0,0) 1(0)+2(0)=0
6→x2≥0
1→x1≤80
A(80,0) 1(80)+2(0)=80
6→x2≥0
1→x1≤80
B(80,33.33) 1(80)+2(33.33)=146.67
3→5x1+6x2≤600
3→5x1+6x2≤600
C(60,50) 1(60)+2(50)=160
4→x1+2x2≤160
2→x2≤60
D(40,60) 1(40)+2(60)=160
4→x1+2x2≤160
2→x2≤60
E(0,60) 1(0)+2(60)=120
5→x1≥0
The maximum value of the objective function Z=160 occurs at 2 extreme points.
Solution to problem 5:
Problem is
MAX z = 8 x + y
subject to
x + y ≤ 40
2 x + y ≤ 60
and x,y≥0;
Hint to draw constraints
Treat it as x+y=40
⇒(0)+y=40
⇒y=40
⇒x+(0)=40
⇒x=40
x 0 40
y 40 0
The half plane containing the origin is the region of the solution set of the inequation x+y≤40
Treat it as 2x+y=60
⇒2(0)+y=60
⇒y=60
⇒2x+(0)=60
⇒2x=60
⇒x=602=30
x 0 30
y 60 0
The half plane containing the origin is the region of the solution set of the inequation 2x+y≤60
The value of the objective function at each of these extreme points is as follows:
Extreme Point
Objective function value
Coordinates Lines through Extreme Point
z=8x+y
(x,y)
3→x≥0
O(0,0) 8(0)+1(0)=0
4→y≥0
2→2x+y≤60
A(30,0) 8(30)+1(0)=240
4→y≥0
1→x+y≤40
B(20,20) 8(20)+1(20)=180
2→2x+y≤60
1→x+y≤40
C(0,40) 8(0)+1(40)=40
3→x≥0
The maximum value of the objective function z=240 occurs at the extreme point (30,0).
Hence, the optimal solution to the given LP problem is : x=30,y=0 and max z=240.
Graph:
Answer: x = 6, y = 12 , z = 240
Solution to problem 9: Graph
Simplex method
The Simplex method is a widely used algorithm for solving Linear Programming Problems (LPP)
where the objective is to maximize or minimize a linear objective function subject to linear
constraints. Here’s a detailed breakdown of the Simplex method, including some clarifications and
steps:
Terminology
1. Basic Variables: Variables that are included in the current solution and correspond to the
columns with the identity matrix in the tableau. They have coefficients of 1 in their respective
equations and 0 in the other equations.
2. Non-Basic Variables: Variables that are not included in the current solution. Their
coefficients can be positive, negative, or zero in the equations.
3. Slack, Surplus, and Artificial Variables:
o Slack Variables: Added to constraints of the form ≤ to convert them into equalities.
For example, if the constraint is x1+x2≤10, we add a slack variable s1 to get
x1+x2+s1=10
o Surplus Variables: Subtracted from constraints of the form ≥ to convert them into
equalities. For instance, for the constraint x1+x2≥10, we subtract a surplus variable s2
to get x1+x2−s2=10.
o Artificial Variables: Introduced when converting inequalities into equalities,
especially when the constraints cannot be converted into standard form directly. For
example, in a constraint x1+x2≥10, after subtracting the surplus variable, if we need
to use a method like the Big M method or Two-Phase method, artificial variables a1
may be introduced to handle infeasibility.
Simplex Method Steps
1. Determine a Starting Basic Feasible Solution:
o Start with an initial feasible solution where all constraints are satisfied. This usually
involves setting the non-basic variables to zero and solving for the basic variables.
2. Select an Entering Variable:
o In a maximization problem, the entering variable is the non-basic variable with the
most negative coefficient in the objective function (Z-row) of the tableau.
o In a minimization problem, it is the non-basic variable with the most positive
coefficient in the Z-row.
Question that can arise in your mind: Why do we choose the most positive entry in the bottom row?
Answer: The most positive entry in the bottom row represents the largest coefficient in the objective
function - the coefficient whose entry will increase the value of the objective function the quickest.
3. Select a Leaving Variable:
o Determine which basic variable will leave the basis. This is done by finding the
smallest non-negative ratio of the right-hand side (RHS) values to the pivot column
values (while ensuring the denominator is strictly positive).
Question Why do we find quotients, and why does the smallest quotient identify a row?
Answer: When we choose the most positive entry in the bottom row, we are trying to increase the
value of the objective function by bringing in the variable x1x1. But we cannot choose any value
for x1. The purpose of computing the quotients; using the quotients to identify the pivot element
guarantees that we do not violate the constraints
4. Perform Pivot Operations:
o Pivot Row: a) Replace the leaving variable with the entering variable in the basic
column. b) Normalize the pivot row by dividing it by the pivot element (the element
in the pivot row and pivot column). c) Update all other rows by subtracting the
product of the pivot column coefficient and the new pivot row from each row to
maintain feasibility.
Answer As we have mentioned earlier, the simplex method begins with a corner point and then
moves to the next corner point always improving the value of the objective function. The value of the
objective function is improved by changing the number of units of the variables. We may add the
number of units of one variable, while throwing away the units of another. Pivoting allows us to do
just that.
5. Repeat:
o Continue the process until no further improvements can be made. For a maximization
problem, this is when all coefficients in the Z-row are non-negative. For a
minimization problem, it’s when all coefficients are non-positive.
6. Terminate:
o The algorithm terminates when the optimal solution is reached (i.e., no further
entering variables can improve the objective function) or when the problem is
deemed infeasible or unbounded.
Iteration-
Cj 5 4 0 0 0 0
1
Min
Ratio
B CB x1 x2 S1 S2 S3 S4 XB
XB/x1
S1 0 6 4 1 0 0 0 24 24/6=4→
S2 0 1 2 0 1 0 0 6 6/1=6
S3 0 -1 1 0 0 1 0 1 ---
S4 0 0 1 0 0 0 1 2 ---
Z=0 Zj 0 0 0 0 0 0
Cj-Zj 5↑ 4 0 0 0 0
Positive maximum Cj-Zj is 5 and its column index is 1. So, the entering variable is x1.
Minimum ratio is 4 and its row index is 1. So, the leaving basis variable is S1.
Iteration-
Cj 5 4 0 0 0 0
2
Min Ratio
B CB x1 x2 S1 S2 S3 S4 XB
XB/x2
x1 5 1 0.67 0.17 0 0 0 4 4/0.67=6
S2 0 0 1.33 -0.17 1 0 0 2 2/1.33=1.5→
S3 0 0 1.67 0.17 0 1 0 5 5/1.67=3
S4 0 0 1.00 0.00 0 0 1 2 2/1=2
Z=20 Zj 5 3.33 0.83 0 0 0
Cj-Zj 0 0.67↑ -0.83 0 0 0
Positive maximum Cj-Zj is 0.67 and its column index is 2. So, the entering variable is x2.
Minimum ratio is 1.5 and its row index is 2. So, the leaving basis variable is S2.
Max Z=21
Solution:
Iteration-1 Cj 3 5 4 0 0 0
Min Ratio
B CB x1 x2 x3 S1 S2 S3 XB
XB/x2
S1 0 2 3 0 1 0 0 8 8/3=2.67→
S2 0 0 2 5 0 1 0 10 10/2=5
S3 0 3 2 4 0 0 1 15 15/2=7.5
Z=0 Zj 0 0 0 0 0 0
Cj-Zj 3 5↑ 4 0 0 0
Positive maximum Cj-Zj is 5 and its column index is 2. So, the entering variable is x2.
Minimum ratio is 2.6667 and its row index is 1. So, the leaving basis variable is S1.
Positive maximum Cj-Zj is 4 and its column index is 3. So, the entering variable is x3.
Minimum ratio is 0.9333 and its row index is 2. So, the leaving basis variable is S2.
Iteration-3 Cj 3 5 4 0 0 0
Min Ratio
B CB x1 x2 x3 S1 S2 S3 XB
XB/x1
x2 5 0.67 1 0 0.33 0 0 2.67 2.67/0.67=4
x3 4 -0.27 0 1 -0.13 0.2 0 0.93 ---
S3 0 2.73 0 0 -0.13 -0.8 1 5.93 5.93/2.73=2.17→
Z=17.0667 Zj 2.27 5 4 1.13 0.8 0
Cj-Zj 0.73↑ 0 0 -1.13 -0.8 0
Positive maximum Cj-Zj is 0.7333 and its column index is 1. So, the entering variable is x1.
Minimum ratio is 2.1707 and its row index is 3. So, the leaving basis variable is S3.
Iteration-4 Cj 3 5 4 0 0 0
B CB x1 x2 x3 S1 S2 S3 XB Min Ratio
x2 5 0 1 0 0.37 0.20 -0.24 1.22
x3 4 0 0 1 -0.15 0.12 0.10 1.51
x1 3 1 0 0 -0.05 -0.29 0.37 2.17
Z=18.6585 Zj 3 5 4 1.10 0.59 0.27
Cj-Zj 0 0 0 -1.10 -0.59 -0.27
Iteration-
Cj 4 3 0 0 0 0
4
Min
B CB x1 x2 S1 S2 S3 S4 XB
Ratio
x2 3 0 1 -1 2 0 0 600
S3 0 0 0 -1 1 1 0 200
x1 4 1 0 1 -1 0 0 200
S4 0 0 0 1 -2 0 1 100
Z=2600 Zj 4 3 1 2 0 0
Cj-Zj 0 0 -1 -2 0 0
Max Z=2600
Iteration-
Cj 2 3 0 0 0
4
B CB x1 x2 S1 S2 S3 XB
x1 2 1 0 -1.3333 3.3333 0 80
S3 0 0 0 -2.1333 1.3333 1 8
x2 3 0 1 2.6667 -1.6667 0 40
Z=280 Zj 2 3 5.3333 1.6667 0
Cj-Zj 0 0 -5.3333 -1.6667 0
Final Tableau:
Iteration-
Cj 3 5 4 0 0 0
3
B CB x1 x2 x3 S1 S2 S3 XB
S1 0 0.8 0 0 1 -0.6 0 2
x2 5 0.4 1 0 0 0.2 0 2
x3 4 0.55 0 1 0 -0.1 0.25 2.75
Z=21 Zj 4.2 5 4 0 0.6 1
Cj-Zj -1.2 0 0 0 -0.6 -1
References:
https://math.libretexts.org/Bookshelves/Applied_Mathematics/Applied_Finite_Mathematics_(Sekhon
_and_Bloom)/04%3A_Linear_Programming_The_Simplex_Method/4.02%3A_Maximization_By_Th
e_Simplex_Method
The interpretation of the rate of change (increase or decrease) in the value of the objective function
depends on whether the LP problem is a maximization or minimization problem. Specifically:
• The shadow price for a less than or equal to (≤) type constraint will always be positive. This
is because increasing the right-hand side resource value cannot decrease the value of the
objective function.
• The shadow price for a greater than or equal to (≥) type constraint will always be negative.
This is because increasing the right-hand side resource value cannot increase the value of the
objective function.
There is no need to solve both LP problems separately. Solving one LP problem is equivalent to solving
the other simultaneously. Hence, if the optimal solution to one problem is known, the optimal solution
of the other can also be obtained from the cj – zj row. In some cases, solving the dual LP problem can
significantly reduce computing time.
MANAGERIAL SIGNIFICANCE OF DUALITY
The study of dual LP problem provides information about the value of the resources. Thus, a thorough
economic analysis is required to decide whether additional units of any resource are needed. If yes, then
how much cost per unit is required to be paid for any resource.
The significance of the study of dual is summarized as follows:
(i) The right-hand side of the constraint in primal LP problem represents the amount of a resource
available and the associated dual variable value is interpretated as the maximum amount likely to be
paid for an additional unit of this resource.
(ii) The maximum amount that should be paid for one additional unit of a resource is called its shadow
price (also called simplex multiplier).
(iii) The total shadow price (or marginal value) of the resources equals the optimal value of objective
function.
(iv) The value of the ith dual variable represents the rate at which the primal objective function value
will increase by increasing the right-hand side (resource value) of constraint i, assuming that all other
data remain unchanged.
Remark When the cost of a resource is sunk (cost that is incurred no matter irrespective to the value
the dual variables). When the cost of a resource vary with the value of decision variables the shadow
price represents the extra cost likely to be paid for one unit of the resource.
Dual Variables:
• y1 represents the shadow price of Resource 1.
• y2 represents the shadow price of Resource 2.
Assuming the dual problem is solved and yields:
• y1=2
• y2=3
Interpretation of Shadow Prices
• Shadow Price of Resource 1: 2
o Meaning: If the availability of Resource 1 is increased by 1 unit, the optimal profit of
the company will increase by $2. In other words, the company would be willing to pay
up to $2 for an additional unit of Resource 1 to maximize its profit.
• Shadow Price of Resource 2: 3
o Meaning: If the availability of Resource 2 is increased by 1 unit, the optimal profit of
the company will increase by $3. Thus, the company would be willing to pay up to $3
for an additional unit of Resource 2 to maximize its profit.
Remark
• Sunk Cost: If the cost of obtaining Resource 1 or Resource 2 is a sunk cost (i.e., it has already
been incurred and does not change with the availability), the shadow prices still represent how
much additional profit can be gained from increasing the availability of these resources.
• Variable Cost: If the cost of resources varies with the quantity available, the shadow price
provides the additional amount that should be paid for one more unit of the resource, reflecting
the extra cost likely to be incurred for obtaining additional units.
In this example, the shadow prices help in understanding the value of resources and guide decision-
making about whether it’s worthwhile to invest in increasing the availability of resources to boost profit.
ADVANTAGES OF DUALITY
1. It is advantageous to solve the dual of a primal that has a less number of constraints because the
number of constraints usually equals the number of iterations required to solve the problem.
2. This avoids the necessity for adding surplus or artificial variables and solves the problem quickly
(the technique is known as the primal-dual method ). In economics, duality is useful in the formulation
of the input and output systems. It is also useful in physics, engineering, mathematics, etc.
3. The dual variables provide an important economic interpretation of the final solution of an LP
problem.
4. It is quite useful when investigating changes in the parameters of an LP problem (the technique is
known as the sensitivity analysis).
5. Duality is used to solve an LP problem by the simplex method in which the initial solution is
infeasible (the technique is known as the dual simplex method).