Or Ch -2 Linear Programming
Or Ch -2 Linear Programming
Chapter Two
INTRODUCTION TO LINEAR PROGRAMMING
Optimization
5
Decision variables
X1 , X2 , X3 , … , Xn
e.g. the quantities of different
products
Index n = the number of
product types
f(X1 , X2 , X3 , … , Xn) < b
Constraints f(X1 , X2 , X3 , … , Xn) > b
– a less than or equal to constraint :
f(X1 , X2 , X3 , … , Xn) = b
– a greater than or equal to constraint :
– an equal to constraint :
Objective
Subject to:
f(X1 , X2 , X3 , … , Xn) < b1
f(X1 , X2 , X3 , … , Xn) = bm
note : n variables, m
constraints
STEPS IN FORMULATION OF LP PROBLEMS
9
tubes Z= 10X1+6X2+4X3
each product will requires
X1+X2+X3
10X1+4X2+6X3
2X1+2X2+5X3
But the total time available for engineering, direct labour and
administrative services is 100, 600 and 300 hours respectively.
12
A minimization model example
A farmer is preparing to plant a crop in the spring and needs to
fertilize a field. There are two brands of fertilizer to choose from,
Super-gro and Crop-quick. Each brand yields a specific amount of
nitrogen and phosphate per bag, as follows:
Chemical contribution
Brand Nitrogen (lb/bag) Phosphate (lb/bag)
super-gro 2 4
Crop-quick 4 3
where
LP Solutions
17
Solution of Linear Programming
Problems
The linear programming problems can be
solved to determine optimum strategy by
two methods- Graphical and Simplex
method.
A. GRAPHICAL METHOD 18
Graphical method is suitable when there are only two
decision variables.
Models with three decision variables can be graphed in
three dimensions, but the process is quite cumbersome, and
Models of four or more decision variables cannot be
graphed at all.
STEPS IN GRAPHICAL METHOD
Step I.
Formulate the LP Problem as explained in the previous class.
Step II.
Convert the inequalities in to equalities to obtain graphical form of
the
constraints.
(Draw the line of each constraint, first putting x1=0 to find the value of x2 and
then putting x2=0 to find the value of x1. Then draw the line for the values of
x1 and x2 which represents the particular constraint. Once the lines are drawn
for all the constraints, identify the feasible polygon (area) by shading the area
19
below
> type).the line for the constraint < and shading above the line for the
Cont’d
20
Step III.
Identify the extreme points of the feasible polygon and name the Corners.
Step IV.
Evaluate the objective function Z or C for all points of feasible region.
Step V.
In case of maximizing objective function Z, the corner point of feasible
region giving the maximum value of Z becomes the value of decision
variables. Similarly in minimizing case, the point of minimum value of C
gives the answer.
Labor hr. 2 1 40
Machine hr. 1 3 45
Marketing hr. 1 0 12
Solution
1. Formulation of mathematical modeling of LPP
Max Z=300X1 +250X2
St:
2X1 +X 2 < 40
X 1 +3X2< 45 LPP Model
X1 <
12
X1 , X2 >0
Maximization
23
Problem…
2.Convert constraints inequalities into
equalities 2X1 +X 2 = 40
X 1 +3X2= 45
X1 = 12
3. Draw the graph by intercepts
2X1 +X 2 = 40 ==> (0, 40) and (20, 0)
X 1 +3X2= 45==> (0, 15) and (45, 0)
X1 = 12==> (12, 0)
X1 , X2 =0
X2
X =0
1
2X1 +X 2 = 40
40 X1=12
15
B
X 1 +X 2 = 45
Feasible C(12,
Region 11) X 2 =0
X1
D
A 12 20 45
Maximization Problem… 24
4. Identify the feasible area of the solution which satisfies all constrains.
5.Identify the corner points in the feasible region A (0, 0), B (0, 15), C
(12, 11) and D (12, 0)
6. Identify the optimal point
7. Interpret the result
Interpretation:
12 units of product A and 11 units of product B should be produced so that the total profit will be $6350.
25
x1 =1, x2=2
B. Simplex
Algorithm
32
simplex
Artificial approach
variables …imaginary
are variables added ≥
toinhave the standard
‘=‘ & formconstraints
Simplex Table: A table used for
calculations during various iterations of the
simplex procedure, is called Simplex table
Example 36
– S1 = 0 and S2 = 0
Exercis 55
e
Max Z = 60X1+ 50X2
Subject to
4X1+10X2 ≤ 100
2X1 + X2 ≤ 22
3X1 + 3X2 ≤ 39
X1, X2 >=0
Standard form of 56
the LPP is as
follows:
Determining the Entering
57
and Exiting Variables
Select the leaving variable as the one that has the smallest nonnegative
ratio of quantity divided by substitution rate.
58
Completed Second
Tableau
200/11 X =1000/11
2
Profit= 46,000/11
62
Simplex Algorithm-
Minimization problem
B. Simplex Algorithm- Minimization
problem 63
Some of the important aspects of minimization problem
follows:
M A1 300 0 15 -1 1/2 1 20
60 X1 30 1 3/4 0 -1/40 0 40
Zj Cj 60 80 0 0
BV Q x1 x2 s1 s2
80 X2 20 0 1 -1/15 1/30
60 X1 15 1 0 1/20 -1/20
77
Initial
Tableau
• SENSITIVITY ANALYSIS
• DUALITY
Subject to:
x1, x2≥0
Cont’d 90
…
Basis Cj 60 50 0 0 0 Quantit
X1 X2 S1 S2 S3 y
S1 0 0 0 1 6 -16/3 24
X1 60 1 0 0 1 -1/3 9
X2 50 0 1 0 -1 2/3 4
Z 60 50 0 10 40/3 740
Shadow price
From the above tableau; the shadow prices are $ 0 for S1, $10
Therefore:
Third constraint:
Range of optimality
X1 Cj-Zj 0 0 0 -10 -40/3
X1 values in the
tableau 1 0 0 1 -1/3 X2 Cj-Zj 0 0 0 -10 -40/3
∞ ∞ ∞ -10 40 0 1 0 -1 2/3
No of columns No of rows
No of rows No of columns
Duality Advantage
1. The dual form provides an alternative form
2. The dual reduces the computational difficulties associated with some formulation
3. The dual provides an important economic interpretation concerning the value
scars of
resources used. 108
Example: 1
Write the duals to the following problems
a. Max.Z=5x1+6x2
Subject to:
2x1+3x2 < 3000
(Labor
constraint) < 5000 (Market
x1 + x2
5x1 +x7x
1, 2 <x2constraint)
>0
1000
So lu tio n
(Machine
constraint)
Represent primal in the conventional table as follows
Dual variables x1 x2 Constraints
u1 2 3 < 3000
u2 5 7 < 1000
u3 1 1 < 500
MaxZ 5 6
< 15
2x2
Dual variables x1 x2 Constraints
< 36
u 2 4 < 80
x11,
u2 3 2 < 60
x2u3> 0 1 0 < 15
u4
Solution 0 2 < 36
MaxZis
Primal 60 50
represented
Theindual form is:
the tableMinZ*=80
as u1 +60u2 +15u3+36u4
follows:
St::
2u1+3u2 + u3
u1, u>2 60
, u4 >
u3,
4u1+2u2 +0
u4
C. Obtain the dual problem of the following primal LPP
Min.Z=x1 +2x2
Subject to:
112
2x1+4x2 < 160
x1 - x2 = 30 x1
>
10
x1,
x2 > 0
Solution
Rule:
1. For a maximization primal
with all < type constraints
there exists a minimization
dual problem with all > type constraints and vice versa. Thus, the inequality sign is reversed
in all the constraints except the non-negativity conditions.
2. Transform the < type constraint to a > type constraint by multiplying the
constraint by -1.
3. Write the = type constraint equivalent to two constraints of the type > and <.
The standard primal LPP so obtained is:
Min.Z=x 1 +2x 2
Subject to:
-2x1-4x2 > -160
x1 - x2 > 30
Let u1, and u4 be the dual variables corresponding to the four
constraints in
u3,
given order, then the dual of the given primal
113
problem can be
u2 ,
formulated as follows:
MaxZ*=-160 u1+30 u2-30 u3+10 u4
St:
-2u1+ u2- u3+ u4 < 1
-4u1- u2+ u3 <2
u1, u2 , u3, u4 >0
Let u= u2-u3, then the above dual problem reduces to the form:
MaxZ*=-160 u1+30 u2-30 u3+10
St:
-2u1+ u+ u4 < 1
-4u1-u <2
u 1, u4 > 0, u unrestricted in sign
Here it may be noted that the second constraint in the primal
is equality. Therefore, the corresponding dual u2 should be unrestricted in
sign.
The doctor advises a patient visited him that the patient is weak in
and Bare available in the medical shop at a cost of ETB 3 per unit of
A and ETB 2.50 per unit of B. The patient has to fulfill the need of
114
vitamin by consuming A and B at a minimum cost.
If we solve and get the solution of the primal problem, we can
read the answer of dual problem from the primal solution.
115
Solution to primal (minimization)
CJ 3 2.5 0 0 M M
Zj Bv Q X1 X2 S1 S2 A1 A2
2.5 X2 5/2 0 1 -3/8 1/4 3/8 -1/4
3 X1 15 1 0 1/4 -1/2 -1/4 1/2
Zj 51.25 3 2.5 -3/16 -7/8 3/16 7/8
Cj-Zj 0 0 3/16 7/8 M-3/16 M-7/8
CJSolution to
40 dual 50
(maximization)
0 0
Zj Bv Q Y1 Y2 S1 S2
50 Y2 7/8 0 1 1/2 -1/4
40 Y1 3/16 1 0 -1/4 3/8
Zj 51.25 3 2.5 15 5/8
Cj-Zj 0 0 -15 -5/2
117