Linear Programming II
Linear Programming II
Linear Programming
Linear programming problem (LPP): Formulation
Text Book Example 1: Consider a small foundry which specializes in the production of iron
castings. For the sake of simplicity, assume that the foundry specializes in producing two types
of castings — casting A and casting B. Because of a strong consumer demand for these
products, it is assumed that the foundry can sell as many units as it produces. The profit is Rs.70
and Rs.40 for each unit of casting A and casting B respectively. The foundry manager should
decide the quantity of these castings to be produced each week so as to maximize the total
profit. Production of castings requires certain resources like raw materials, labor and foundry
capacity. The requirements and their availabilities are given in the following table:
Per unit Per unit Weekly
Resources requirement of A requirement of B availability
Raw Material 1 2 kg 1 kg 120
Raw Material 2 0.8 kg 0 kg 40
Labour 3 man-days 2 man-days 200 man-days
Foundry Storage
Capacity 4 Square feet 3 Square feet 360 Sq.ft.
Vishal Mishra (IBS, Hyderabad)
Linear Programming
Linear programming problem (LPP): Formulation
Text Book Example 1: Let A and B be the quantities of each type of castings produced per
week
Linear Programming
Linear programming problem (LPP): Graphical Solution
Text Book Example 1: Let A and B be the quantities of each type of castings produced per
week
Constraints
2 A + 1 B < = 120
0.8 A + 0 B <= 40
3 A + 2 B <= 200
4 A + 3 B <= 360
A, B >= 0
Vishal Mishra (IBS, Hyderabad)
Linear Programming
Linear programming problem (LPP): Graphical Solution
Text Book Example 1:
Corner Points
P(0,0)
Q(50,0)
T(0,100)
R(? )
S(? )
Vishal Mishra (IBS, Hyderabad)
Linear Programming
Linear programming problem (LPP): Graphical Solution
Text Book Example 1:
Corner Points
P(0,0)
Q(50,0)
T(0,100)
R(50, 20)
S(40, 40)
Vishal Mishra (IBS, Hyderabad)
Linear Programming
Linear programming problem (LPP): Graphical Solution
Text Book Example 1:
Max. 70 A + 40 B
Corner Points
P(0,0) Objective function value: 0
Q(50,0) Objective function value: 3500
T(0,100) Objective function value: 4000
R(50, 20) Objective function value: 4300
S(40, 40) Objective function value: 4400
Vishal Mishra (IBS, Hyderabad)
Linear Programming
Linear programming problem (LPP): Maximization Problem
Example: A start-up pet food bakery has two key bakery items to offer to their customers i.e.,
vegetarian cookies and non-vegetarian cookies. The production of these two items requires
processing in two key sections: Kitchen and Packaging. One kg of vegetarian cookies requires 2
hrs in preparation (i.e., in kitchen) and 60 minutes in packaging. While, one kg of non-
vegetarian cookies requires 2.5 hrs in kitchen and 30 minutes in packaging. The total time
available is 35 hours per week in kitchen and 15 hours per week in packaging section. The profit
per kg of vegetarian cookies is INR 200 and for a kg of non-vegetarian cookies is INR 225*.
What is the quantity of each type of cookies that this start-up should produce in a week in
order to maximize its profits?
Objective Function:
Maximize 200 V + 225 N
Objective Function:
Maximize 200 V + 225 N
Variable Cells
Cell Name Original Value Final Value Integer
$G$9 Unknowns V 0 13.33333333 Contin
$H$9 Unknowns N 0 3.333333333 Contin
Constraints
Cell Name Cell Value Formula Status Slack
$I$12 C1 35 $I$12<=35 Binding 0
$I$13 C2 15 $I$13<=15 Binding 0
Vishal Mishra (IBS, Hyderabad)
But sometimes 1). One need not solve the problem again and/or 2) Find out the impact of the
above changes from some of the output values (that excel-solver provides).
Vishal Mishra (IBS, Hyderabad)
Note that objective function itself can be seen as an equation of a straight line. One can write
Maximize K = 200 V + 225 N
OR
N = K/225 – 200V/225
(Similar to Y = C + m X
OR yො = b0 + b1 X )
Note: Slope
Graphical Illustration
Vishal Mishra (IBS, Hyderabad)
Total % (increase/decrease): 40
So, in this case the optimal solution point will remain same (i.e. 13.33, 3.33).
Vishal Mishra (IBS, Hyderabad)
Constraint 1 written as
Equality i.e.,
2 V + 2.5 N = 35 OR
N = 35/2.5 – 2V/2.5
Note: Intercept
Graphical Illustration
Vishal Mishra (IBS, Hyderabad)
Example: If RHS of C1 (hrs in kitchen) increases by 10 and that of C2 (hrs in packaging) decreases by 4.
% increase (C1): (10/40)*100 = 25
% decrease (C2): (4/8)*100 = 50
Total % (increase/decrease): 75
Since this is less than 100%, the shadow price do not change. Thus the new optimal solution value will
be 3416.66 + (10*83.33) – (4*33.33) = 4116.67 (of course, at a new optimal solution point other than R
(13.33, 3.33)).
Vishal Mishra (IBS, Hyderabad)
Reduced Cost: This comes into play when one finds that it is not optimal to have a
variable play a role in the final/optimal solution (having a zero value). Reduced cost is
the amount by which the contribution from a variable should improve (increase for
maximization and decrease for minimization) so as to make its value non-zero in the
optimal solution.
Vishal Mishra (IBS, Hyderabad)
Such that,
0.4 A + 0.5 B + 0.5 C <= 20
0.0 A + 0.1 B + 0.1 C <= 4
0.6 A + 0.3 B + 0.3 C <= 21
A, B, C >= 0
Vishal Mishra (IBS, Hyderabad)
Variable Cells
Cell Name Original Value Final Value Integer
$G$6 Unknowns A 0 25 Contin
$H$6 Unknowns B 0 0 Contin
$I$6 Unknowns C 0 20 Contin
Constraints
Cell Name Cell Value Formula Status Slack
$J$10 OFV 2 $J$10<=$L$10 Not Binding 2
$J$11 OFV 21 $J$11<=$L$11 Binding 0
$J$9 OFV 20 $J$9<=$L$9 Binding 0
Vishal Mishra (IBS, Hyderabad)
Constraints
Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$J$10 OFV 2 0 4 1E+30 2
$J$11 OFV 21 11.11111111 21 9 9
$J$9 OFV 20 83.33333333 20 6 6
Vishal Mishra (IBS, Hyderabad)
Min. 3 A + 5 B
S.t
1 A + 3 B >= 6
2 A + 2 B >= 8
A, B >= 0
Vishal Mishra (IBS, Hyderabad)
Min. 3 A + 5 B
S.t
1 A + 3 B >= 6
2 A + 2 B >= 8
A, B >= 0
Corner points:
P(0,4)
Q(3,1)
R(6,0)
Vishal Mishra (IBS, Hyderabad)
S.t
1 A + 3 B >= 6 Variable Cells
Cell Name Original Value Final Value Integer
2 A + 2 B >= 8 $H$8 Unknowns A 0 3 Contin
$I$8 Unknowns B 0 1 Contin
A, B >= 0
Constraints
Cell Name Cell Value Formula Status Slack
$J$10 C1 OFV 6 $J$10>=$L$10 Binding 0
$J$11 C2 OFV 8 $J$11>=$L$11 Binding 0
Vishal Mishra (IBS, Hyderabad)
Keeping other things constant, If the coefficient for A changes such that its value is
between 1.67 and 5 (based on allowable increase/decrease), the optimal solution point
(i.e., Q: 3,1) doesn’t changes. If the coefficient value goes beyond this range the optimal
solution point may change. keeping all the other aspect of the problem constant.
Variable Cells
Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$H$8 Unknowns A 3 0 3 2 1.333333333
$I$8 Unknowns B 1 0 5 4 2
Vishal Mishra (IBS, Hyderabad)
Keeping other things constant, If the coefficient for B changes such that its value is
between 3 and 9 (based on allowable increase/decrease), the optimal solution point
(i.e., Q: 3,1) doesn’t changes. If the coefficient value goes beyond this range the optimal
solution point may change. keeping all the other aspect of the problem constant.
Variable Cells
Final Reduced Objective Allowable Allowable
Cell Name Value Cost Coefficient Increase Decrease
$H$8 Unknowns A 3 0 3 2 1.333333333
$I$8 Unknowns B 1 0 5 4 2
Vishal Mishra (IBS, Hyderabad)
Constraints
Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$J$10 C1 OFV 6 1 6 6 2
$J$11 C2 OFV 8 1 8 4 4
Vishal Mishra (IBS, Hyderabad)
Sunk Cost: It is the cost that will be incurred irrespective of the value of the decision
variables. i.e., it is not affected by the decision made (like fixed cost).
Relevant Cost: It is the cost that depends on the decision made. Its amount will vary
according to the value of the decision variables (like variable cost).
Degeneracy: A condition, when the shadow price becomes zero for one of the binding
constraints. It does not affect the interpretation of changes within the range. However,
a change beyond the range does not necessarily means that a different solution will be
optimal. Practically, this means that one needs to solve the problem again when such a
change happens.
Vishal Mishra (IBS, Hyderabad)
Linear Programming
Linear programming problem (LPP): Formulation
Text Book Example 2: A farmer is advised to utilize at least 900 kg of mineral A and 1200 kg
of mineral B to increase the productivity of crops in his fields. Two fertilizers, F1 and F2 are
available at a cost of Rs.60 and Rs.80 per bag. If one bag of F1 contains 20 kg of mineral A and
40 kg of mineral B, and one bag of F2 contains 30 kg each of mineral A and B, then how many
bags of F1 and F2 should the farmers use to fulfill the requirement of both the types of minerals
at an optimum low cost?
Vishal Mishra (IBS, Hyderabad)
Linear Programming
Linear programming problem (LPP): Formulation
Text Book Example 2: Let X and Y be the number of bags of each type of fertilizers produced
Linear Programming
Linear programming problem (LPP): Formulation
Text Book Example 2: Let X and Y be the number of bags of each type of fertilizers produced
Constraints
20 X + 30 Y > = 900
40 X + 30 Y > = 1200
X, Y >= 0
Vishal Mishra (IBS, Hyderabad)
Linear Programming
Linear programming problem (LPP): Formulation
Corner points
P(45,0)
R(0, 40)
Q(? )
Vishal Mishra (IBS, Hyderabad)
Linear Programming
Linear programming problem (LPP): Formulation
Corner points
P(45,0)
R(0, 40)
Q(15, 20)
Vishal Mishra (IBS, Hyderabad)
Linear Programming
Linear programming problem (LPP): Formulation
Corner points
P(45, 0) Objective function value: 2700
R(0, 40) Objective function value: 3200
Q(15, 20) Objective function value: 2500
Vishal Mishra (IBS, Hyderabad)
Linear Programming
Linear programming problem (LPP): Formulation
Text Book Example 3: Consider a firm producing batteries for cars and trucks. Each car battery
costs Rs.400 in materials and machine time plus Rs.200 in wages and each truck battery costs
Rs.650 in materials and machines plus Rs.150 in wages. The selling prices of a car and a truck
battery are Rs.700 and Rs.1,000 (per unit) respectively. The firm is able to sell as many units as
it can produce and it wants to plan its next months’ production. The firm has 2,100 hours of
machine time and 1,000 hours of assembly time available in the next month. The production of
each car battery requires 10 hours of machine time and 10 hours of assembly time. The
production of each truck battery requires 30 hours of machine time and 10 hours of assembly
time. The firm arrived at a forecast of the cash balance of Rs.72,000, which can be used to meet
the expenses of materials and machine time and wages. Assume that the payment for
materials/machine time and wages has to be made in the month and the firm cannot get any
more cash. With these production and financial constraints, the firm has to determine the
product mix which will give maximum profit next month.
Vishal Mishra (IBS, Hyderabad)
Linear Programming
Linear programming problem (LPP): Formulation
Text Book Example 3: Let the number of car batteries produced are C and the number
of truck batteries produced are T.
Linear Programming
Linear programming problem (LPP): Formulation
Text Book Example 3: Let the number of car batteries produced per month are C and
the number of truck batteries produced per month are T.
Constraints,
10 C + 30 T <= 2100 (Machine Time)
10 C + 10 T <= 1000 (Assembly Time)
600 C + 800 T <= 72000 (Due Wages/costs Payment)
C , T >= 0
Vishal Mishra (IBS, Hyderabad)
Linear Programming
Linear programming problem (LPP):
Text Book Example 3: Let the number of car batteries produced per month are C and
the number of truck batteries produced per month are T.
Corner points,
P (0,0)
Q(100,0)
S(0,70)
R(? )
Vishal Mishra (IBS, Hyderabad)
Linear Programming
Linear programming problem (LPP):
Text Book Example 3: Let the number of car batteries produced per month are C and
the number of truck batteries produced per month are T.
Corner points,
P (0,0)
Q(100,0)
S(0,70)
R(45,55)
Vishal Mishra (IBS, Hyderabad)
Linear Programming
Linear programming problem (LPP): Formulation
Corner points,
Linear Programming
Linear programming problem (LPP): Formulation
Practice Problem: An investor wants to invest the money of a client in three possible
options i.e., real estate, bank fixed deposit (FD) and bonds. The money the client
earmarked for this exercise is up to INR 20 lakhs. The research data of the investor
shows that the returns from the three avenues is estimated to be 7%, 5% and 8%
respectively. The client has specified that the investment in real estate can not be more
than 5 lakhs. In addition she has also instructed that the money invested in bank FD
should be at least 50% of the total money invested in real estate and bond. Finally,
another condition is that the total investment in bank FD and bond should be at least
50% of the total money invested. For the purpose of maximizing the return on
investment, formulate the aforementioned as an LPP and find out the optimal solution .
Vishal Mishra (IBS, Hyderabad)
Linear Programming
Linear programming problem (LPP):
If R, F and B are the amounts invested in the three options, then
Objective function:
Max 0.07R + 0.05F + 0.08B
Constraints,
1R + 1F + 1B <= 20
1R + 0F + 0B <= 5
0.5R – 1F + 0.5B <= 0 since, F >= 0.5 (R + B)
0.5R – 0.5F -0.5B <= 0 since (F+B) >= 0.5 (R + F + B)
R, F, B >= 0
Vishal Mishra (IBS, Hyderabad)
Linear Programming
Linear programming problem (LPP): Formulation
Practice Problem: A company into the manufacturing of industrial generators has got
two plants in two cities in southern India (say A and B) from where it intends to supply
the goods at three locations that serve as hubs (distribution centres) say P, Q and R. The
monthly production capacity at the three plants and the forecasted requirement
(demand) at the three hubs is given in the following table. Also given are the
transportation costs (say, in thousands of rupees). The operations manager want to find
out the quantity to be shipped from each plant (source) to each hub (destination) with
the objective to minimize the total cost. Develop a linear programming model for this
situation.
Plants Capacity (units)
Cost per unit
A 20
B 30 Destination
P Q R
Hubs Requirement (units) Source A 8 5 10
P 25
B 14 7 9
Q 10
R 15
Vishal Mishra (IBS, Hyderabad)
Linear Programming
Linear programming problem (LPP): Network flow type of problem
Practice Problem: A company into the manufacturing of industrial generators has got
two plants in the two cities in southern India (say A and B) from where it intends to
supply the goods at three locations that serve as hubs (distribution centres) say P, Q and
R. The monthly production capacity at the three plants and the forecasted requirement
(demand) at the three hubs is given in the following table. Also given are the
transportation costs (in thousands of rupees). The operations manager want to find out
the quantity to be shipped from each plant (source) to each hub (destination) with the
objective to minimize the total cost. Develop a linear programming model for this
situation.
Hint (the unknown): let Xij be the optimum number of units to be transported from
source i to destination j. Since there are two sources i will take two values, say 1,2 and
since there are 3 destinations j will take 3 values, say 1,2,3.
Vishal Mishra (IBS, Hyderabad)
Linear Programming
Linear programming problem (LPP): Network flow type of problem
Vishal Mishra (IBS, Hyderabad)
Linear Programming
Linear programming problem (LPP): Network flow type of problem
Vishal Mishra (IBS, Hyderabad)
Linear Programming
Linear programming problem (LPP): Formulation of network flow type of problem
Non-negativity constraints:
Xij >= 0 (for i = 1,2 and j = 1,2,3)
Vishal Mishra (IBS, Hyderabad)
Linear Programming
Linear programming problem (LPP): Formulation of network flow type of problem