Linear Programming For MBA Students
Linear Programming For MBA Students
Linear Programming For MBA Students
©Prof. R N Bhattacharya
2
Contents
1. Steps in Developing a Linear Programming (LP) Model
2. Properties of LP Models
3. Basic Assumptions in LP
4. LP Solutions: Four Cases
5. Graphical Method
6. Special Situation in LP
7. Simplex Method
8. Big M Method
9. Two Phase Method
10. Duality in Linear Programming Problems
11. Introduction to Sensitivity Analysis
©Prof. R N Bhattacharya
3
1) Formulation
2) Solution
©Prof. R N Bhattacharya
4
Properties of LP Models
©Prof. R N Bhattacharya
5
Basic Assumptions in LP
o Proportionality
o The contribution to the objective function from each decision variable is
proportional to the value of the decision variable
o The contribution of each decision variable to the LHS of each constraint
is proportional to the value of the decision variable
o Additivity
o The contribution to the objective function for any decision variable is
independent of the values of the other decision variables
o The contribution of a decision variable to LHS of each constraint is
independent of the values of other decision variables
o Divisibility
o Each decision variable is allowed to assume fractional values. If we
actually can not produce a fractional number of decision variables, we
use IP
o Certainty
o Each parameter is known with certainty
©Prof. R N Bhattacharya
6
Graphically,
o In the unique optimal solution case, isoprofit line last hits a point (vertex -
corner) before leaving the feasible region.
o In the alternative optimal solutions case, isoprofit line last hits an entire line
(representing one of the constraints) before leaving the feasible region.
o In the infeasible case, there is no feasible region.
o In the unbounded case, isoprofit line never lose contact with the feasible
region
©Prof. R N Bhattacharya
7
©Prof. R N Bhattacharya
8
Other Limitations:
• Make no more than 450 chairs
• Make at least 100 tables
©Prof. R N Bhattacharya
9
Decision Variables:
Let
X1 = Number of tables to make
X2 = Number of chairs to make
Objective Function: Maximize Profit
Maximize 7 X1 + 5 X2
Constraints
• Have 2400 hours of carpentry time available
3 X1 + 4 X2 < 2400(hours)
• Have 1000 hours of painting time available
2 X1 + 1 X2 < 1000 (hours)
More Constraints: Non negativity:
• Make no more than 450 chairs Cannot make a negative number of
X2 < 450 chairs or tables
• Make at least 100 tables X1 > 0
X1 > 100 X2 > 0
©Prof. R N Bhattacharya
10
Model Summary
Maximize 7 X1 + 5 X2 (profit)
Subject to the constraints:
3 X1 + 4 X2 < 2400 (carpentry hrs)
2 X1 + 1 X2 < 1000 (painting hrs)
X2 < 450 (max # chairs)
X1 > 100 (min # tables)
©Prof. R N Bhattacharya
11
Steps
• Step 3 : Test all corner points to see which yields maximum profit.
©Prof. R N Bhattacharya
12
X2
Carpentry Constraint Line
3 X1 + 4 X2 < 2400
Intercepts
(X1 = 0, X2 = 600) Infeasible
600 > 2400 hrs
(X1 = 800, X2 = 0)
3X
1 +
4X
2 =
24
00
Feasible
< 2400 hrs
0
0 800 X1
©Prof. R N Bhattacharya
13
X2
1000
Painting Constraint Line
2 X1
2 X1 + 1 X2 = 1000
+1
X2
Intercepts 600
=1
(X1 = 0, X2 = 1000)
000
(X1 = 500, X2 = 0)
0
0 500 800 X1
©Prof. R N Bhattacharya
14
X2
Max Chair Line 1000
X2 = 450
Feasible
Region
0
0 100 500 800 X1
©Prof. R N Bhattacharya
X2
7X
Objective Function Line
1
+5
7 X1 + 5 X2 = Profit
X2
=4
500
,04
0
Optimal Point
(X1 = 320, X2 =
7X
400
360)
1
+5
X2
7X
300
=2
1
,80
+5
0
X2
200
=2
,10
0
100
0
0 100 200 300 400 500 X 1
X2
Additional Constraint New optimal point
Need at least 75 more 500 X1 = 300, X2 = 375
chairs than tables
X2 > X1 + 75
Or 400 X1 = 320
X2 – X1 > 75 X2 = 360
Now infeasible
300
200
100
LP Characteristics
• Corner Point Property: An optimal solution must lie at one or more corner
points
• Optimal Solution: The corner point with the best objective function value is
optimal
©Prof. R N Bhattacharya
18
Special Situation in LP
Example: x < 10
x < 12
Example: x < 10
x > 15
©Prof. R N Bhattacharya
Special Situation in LP
3. Alternate Optimal Solutions – when there is more than one optimal solution.
Note that if there are more than one optimal solution, there will be infinite number
of optimal solutions.
X2
Max 2X1 + 2X2
2X
10
Subject to:
1
+
X1 + X2 < 10
2X
All points on Blue
2
X1 < 5
=
20
X2 < 6 6 segment are optimal
X1, X2 > 0
0
0 5 10 X1
Special Situation in LP
X2 t ion n
c
Max 2X1 + 2X2 ri e lutio
Subject to: D so
2X1 + 3X2 > 6 2 of
X1 , X 2 > 0
0
0 1 2 3 X1
21
Exercise
Alpha ltd. produces two products X and Y each requiring same production
capacity. The total installed production capacity is 9 tones per days. Alpha Ltd. Is
a supplier of Beta Ltd. Which must supply at least 2 tons of X & 3 tons of Y to
Beta Ltd. Every day. The production time for X and Y is 20 machine hour pr units
& 50 machine hour per unit respectively the daily maximum possible machine
hours is 360 profit margin for X & Y is Rs. 80 per ton and Rs. 120 per ton
respectively. Formulate as a LP model and use the graphical method of
generating the optimal solution for determining the maximum number of units of
X & Y, which can be produced by Alpha Limited.
©Prof. R N Bhattacharya
22
Note that the region of feasible solution shown in the following figure is bounded by
the graphs of the Linear equalities:
x 1+ x2 =9, x 1=2, x2 = 3 and 20x1 + 50x2 =360, and by the coordinates axes.
©Prof. R N Bhattacharya
23
©Prof. R N Bhattacharya
24
Simplex Method
©Prof. R N Bhattacharya
25
Simplex Method – Introduction
o Note that in the example considered of the graphical method, the optimal
solution occurred at a vertex (corner) of the feasible region. In fact it is true
that for any LP the optimal solution occurs at a vertex of the feasible region.
o This fact fact is the key to the simplex algorithm for solving LP's.
o The Simplex algorithm for solving LPP was developed by Dantzig in the late
1940’s and since then a number of different versions of the algorithm have been
developed. One of these later versions, called the revised simplex algorithm
(sometimes known as the "product form of the inverse" simplex algorithm) forms
the basis of most modern computer packages for solving LP's.
o Steps:
1. Convert the LP to standard form
2. Obtain a basic feasible solution (bfs) from the standard form
3. Determine whether the current bfs is optimal. If it is optimal, stop.
4. If the current bfs is not optimal, determine which nonbasic variable should
become a basic variable and which basic variable should become a
nonbasic variable to find a new bfs with a better objective function value
5. Go back to Step 3.
©Prof. R N Bhattacharya
26
• Related Concepts:
Standard form: all constraints are equations and all variables are
nonnegative
©Prof. R N Bhattacharya
27
Painting time 8 4 64
(hrs/table)
©Prof. R N Bhattacharya
28
• The Model:
©Prof. R N Bhattacharya
29
©Prof. R N Bhattacharya
30
Starting simplex table
a0 s1 6 12 1 0 120 120/12 = 10
b0 s2 8 4 0 1 64 64/4 = 16
O0 z -200 -240 0 0 0
a0 s1 6 12 1 0 120 120/12 = 10
b0 s2 8 4 0 1 64 64/4 = 16
O0 z -200 -240 0 0 0
Leaving variable
Pivot row = lowest value
Pivot column = lowest in V/C
value in z row ©Prof. R N Bhattacharya
32
Simplex table – Iteration 1
Make the pivot number = 1 and the vales of all other cells in pivot column = zero
through elementary operations
10-
½-(½)x1 = 1-(½)x0 1/12 – 0- ½)x
a2 x2 (½)x4= a2=a1 – (½)b2
0 =1 (½) x (-1/18) (1/6)
8
Big M Method
©Prof. R N Bhattacharya
35
a0 A 2 1 -1 0 0 1 2
b0 s2 1 3 0 1 0 0 3
c0 s3 0 1 0 0 1 0 4
O0* z -3 1 0 0 0 M 0
O0 = O0* - M a0
O0 z -3 – 2M 1-M M 0 0 0 -2M
The initial operations removes M from the Z row of artificial variable vector using
formula O0 = O0* - M a0. This gives us the starting table, as shown in next slide .
©Prof. R N Bhattacharya
37
a0 A 1 -1 0 0 1 2 2/2=1
2
b0 s2 1 3 0 1 0 0 3 3/1=3
4/0
c0 s3 0 1 0 0 1 0 4 Ignore
O0 z -3 – 2M 1-M M 0 0 0 -2M
Most negative
• Artificial Variable:
The idea of using artificial variable calls for adding a non negative variable
to the left side of each equation that has no obvious starting basic variable.
• However, since such artificial variables have no physical meaning from the
standpoint of the original problem (hence the name ‘artificial’), the procedure
will be valid only if we force these variables to be zero when the optimum is
reached.
• Hence, in the optimal table (optimal table = all coefficients in the objective
function are non negative), if the artificial variable remained in the ‘basis’
(basis = the variables appearing in the BV column as Basic Variable) with a
positive value, it means there is no feasible solution to the problem.
• There are two methods based on the idea of artificial variables. The first is
the Big M method, and the second is called the Two Phase Technique.
©Prof. R N Bhattacharya
39
Min Z = 4 x1 + x2
Subj.To. : 3x1 + x2 = 3
x1 + 2 x2 =< 4
x1, x2 > 0
Is written as :
Min Z = 4 x1 + x2 + 0 S1 – M A
Subj.To. 3x1 + x2 + A = 3
x 1 + 2 x 2 + s1 = 4
x1, x2 > 0 ©Prof. R N Bhattacharya
40
©Prof. R N Bhattacharya
41
Two Phase Method
• The effect of the original coefficient ‘4’ is now too small relative to the large
number created by the multiple of M.
• The dangerous outcome is that the variables x1, x2 etc. may be treated as
having zero coefficients in the objective function.
• The Two Phase Method is designed to alleviate this difficulty. Although the
artificial variables are added in the same manner, the use of the constant M
is eliminated by solving the problem in two phases.
©Prof. R N Bhattacharya
42
Two Phase Method
Phase 1
3. Go to Phase 2.
4. Otherwise, if the minimum is positive (I.e. max. is –ve), the problem has
no feasible solution, hence STOP.
Phase 2
Use the optimum basic solution of phase 1 as a starting point for the
original problem. ©Prof. R N Bhattacharya
43
Min Z = 4 x1 + x2
Subj To 3 x1 + x2 = 3 ……(1) Introduce Artificial Variables A1 into
equation 1, Artificial variable A2 and
4 x1 + 3 x2 > 6 …(2) surplus variable s1 into equation 2 and
x1 + 2 x2 < 4 ……(3) slack variable s2 into equation 3.
x1, x2 > 0
We have : The new objective function to
3 x1 + x2 + A1 =3 ……………….(1) be MINIMIZED is the sum of
the artificial variables.
4 x1 + 3 x2 – s1 + A2 = 6 ……….(2)
Thus Min A = A1 + A2
x1 + 2 x2 + s2 = 4 ……………..(3)
From (1) A1 = 3 – 3 x1 – x2
From (2) A2 = 6 – 4 x1 – 3 x2 + s1
Substituting, we have the new objective function is ©Prof. R N Bhattacharya
44
Using Simplex method to solve this Phase 1 problem, after two iterations we get the
following optimal simplex table:
x2
Label BV x1 A1 A2 s1 s2 Val
x1
a2 1 0 3/5 -1/5 1/5 0 3/5
Opt. Solution to Phase 1:
x1= 3/5, x2=6/5, s2= 1
x2
b2 0 1 -4/5 3/5 -3/5 0 6/5
Max A* = 0 = (-Min A) = 0
O2 A* 0 0 1 1 0 0 0
©Prof. R N Bhattacharya
46
Phase 2
• Step 1
With the help of the optimal table of phase 1, write the equivalent constraint
equations, noting that the optimal table is nothing but equations written in detached
coefficient form. Thus we have:
• Step 2
Since artificial variables have served their purpose in phase 1, rewrite the constraints
neglecting the artificial variables. This gives:
x1 + (1/5)s1 = 3/5
x2 - (3/5)s1 = 6/5
s1 + s2 =1
©Prof. R N Bhattacharya
47
Phase 2
• Step 3
Since x1 and x2 are in the basis, eliminate them from objective function by
using the constraint equations.
The constraint equations give:
x1 = 3/5 – (1/5)s1 and x2 = 6/5 + (3/5)s1
Substituting these in objective function, we have the following modified
obj.fn.:
©Prof. R N Bhattacharya
Phase 2 simplex table 48
Most -ve
x1 (3/5) / (1/5)
a0 1 0 1/5 0 3/5
=3
(6/5) / (-3/5) =
b0 x2 0 1 -3/5 0 6/5 -ve value so
neglect it
c0 s2 0 0 1 1 1 1/1 = 1
O0 Z* 0 0 -1/5 0 -18/15
c1 s1 0 0 1 1 1 C1 = c0
All values in row O1 are non-negative, hence the optimal ©Prof. R N Bhattacharya
solution is x1= 2/5, x2=9/5, s1=1,s2=0, Min Z = - Max Z* = 17/5
49
©Prof. R N Bhattacharya
50
• In either case the final table of the dual problem will contain both the
solution to the dual problem and the solution to the original problem.
• The solution of the dual problem is readily obtained from the original
problem solution if the simplex method is used.
©Prof. R N Bhattacharya
51
Considerations:
• If a constraint in Primal has an equal sign, the corresponding Dual
Variable is Unrestricted.
• If a Primal is a Maximization (or Minimization) Problem, the
corresponding Dual is Minimization (or Maximization).
• The sign of a Dual Variable is same as its Primal Constraint if it is a Dual
Maximization.
• The sign of a Dual Variable is opposite of its Primal Constraint if it is a
Dual Minimization.
©Prof. R N Bhattacharya
52
©Prof. R N Bhattacharya
53
©Prof. R N Bhattacharya
54
Primal-1 Dual-1
Max Z = 200 X1 + 240 X2 Min C = 120 y1 + 64 y2
S.T. 6 X1 + 12 X2 < 120 S.T 6 y1 + 8 y2 > 200
8 X1 + 4 X2 < 64 12 y1 + 4 y2 > 240
X1, X2 > 0 y1, y2 > 0
Primal-2 Dual-2
Max Z = 40 X1 + 60 X2 Min C = 2000 y1 + 1000 y2
S.T. 3 X1 + 2 X2 < 2000 S.T 3 y1 + y2 > 40
X1 + 2 X2 < 1000 2 y1 + 2 y2 > 60
X1, X2 > 0 y1, y2 > 0
©Prof. R N Bhattacharya
55
Understanding Duality
©Prof. R N Bhattacharya
56
• For example, since 6 hrs of construction and 8 hrs of painting time are
needed to produce one unit of X1, the valuation of these two resources, if
they are to be rented out, would be 6 y1 + 8 y2, and this total rental value
must be > 200 (which is the profit obtained from Type 1 furniture).
• Also, we can not have any negative rents per hour, hence y1, y2 >0
©Prof. R N Bhattacharya
57
BV X1 X2 X3 X4 S1 S2 S3 Val
X1 1 5/7 0 -5/7 10/7 0 -1/7 50/7
S2 0 -6/7 0 13/7 -61/7 1 4/7 325/7
X3 0 2/7 1 12/7 -3/7 0 1/7 55/7
©Prof. R N Bhattacharya
58
Suppose we decide to set X2= 1. The shadow cost (3/7) in the Z row under the
variable X2 tells us that the value of Z would decrease by 3/7
Again, the shadow price of S1 is 13/7. It indicates that if the first scarce resource
(I.e. the first constraint) can somehow be improved by one unit (i.e. the RHS of
the first constraint is increased by 1 unit) this will improve the profit level by 13/7.
Note however that since S2 is in the basis of the opt. table, any improvement in
the second resource (second constraint) will not improve the profit. This is
evident from the value of the shadow cost for S2 being equal to zero as above.
©Prof. R N Bhattacharya
59
Find the solution of the dual model from the solution of the primal model when the primal is:
Max Z = 5 X1 + 70 X2
Subj. to 3 X1 + 2 X2 < 2000
x1 + 2 x2 < 1000 , X1, X2 > 0
The final simplex table is:
©Prof. R N Bhattacharya
60
©Prof. R N Bhattacharya
61
Sensitivity Analysis
©Prof. R N Bhattacharya
62
Max Z = 3 X1 + 4 X2 + X3 + 7 X4
Subj. to 8 X1 + 3 X2 + 4 X3 + X4 < 7 Requirement
2 X1 + 6 X2 + X3 + 5 X4 < 3 Vectors
X1 + 4 X2 + 5 X3 + 2 X4 < 8
Xi > 0 I = 1,2,3,4
©Prof. R N Bhattacharya
63
BV X1 X2 X3 X4 S1 S2 S3 Val
Final Optimal Table
X1 1 9/38 1/2 0 5/38 -1/38 0 16/19
X4 0 21/19 0 1 -1/19 8/38 0 5/19
S3 0 59/38 9/2 0 -1/38 -15/38 1 126/19
Z 0 169/38 1/2 0 1/38 53/38 0 83/19
©Prof. R N Bhattacharya
64
©Prof. R N Bhattacharya
65
©Prof. R N Bhattacharya