OR Chapter 2 PDF
OR Chapter 2 PDF
infotesfish@gmail.com
History of LP
linear programs.
DEFINITION
Optimization
Characteristics of Optimization Problems
One or more decisions
Restrictions or constraints
Objective
maximizes profits
Decision variables
X1 , X2 , X3 , … , Xn
e.g. the quantities of different products
Index n = the number of product types
Constraints
– a less than or equal to constraint : f(X1 , X2 , X3 , … , Xn) < b
– a greater than or equal to constraint : f(X1 , X2 , X3 , … , Xn) > b
– an equal to constraint : f(X1 , X2 , X3 , … , Xn) = b
Objective
– MAX(or MIN) : f(X1 , X2 , X3, …, Xn)
Mathematical formulation of an
optimization problem
Subject to:
f(X1 , X2 , X3 , … , Xn) < bm
f(X1 , X2 , X3 , … , Xn) = bm
1. Proportionality
2. Additivity
3. Continuity
4. Certainty
5. Finite choices
6. Non-negativity
ADVANTAGES OF LINEAR PROGRAMMING
Components of LPM:
Decision variables,
Model constraints,
Maximize profit
Minimize cost
x1 = bags of Super-gro
x2 = bags of Crop-quick
where
2x1 + 12x2 ≥ 24
x1, x2 ≥ 0
LP:
Graphical method
Solution of Linear Programming Problems
and then putting x2=0 to find the value of x1. Then draw the line for the
lines are drawn for all the constraints, identify the feasible polygon (area)
by shading the area below the line for the constraint < and shading above
Step III. Identify the extreme points of the feasible polygon and
name the Corners.
2x1 + 4x2 = 48
X1 X2
∴ 2x1= 48 or x1 =24
0 12
24 0 ∴ 4x2 = 48 or x2 = 12
Feasible
region
contd
Step III. Both the constraints are to be satisfied
simultaneously, therefore, OACD becomes the region of
feasible solution. This is also known as feasible polygon.
– On line OA, point A give maximum profit, on line OD, point D gives
maximum profit.
contd
Step IV. Evaluate the objective function Z= 8x1 + 6x2 for all points of
feasible region i.e. O,A,C,D.
(from graph)
60
50
Letting X1 and solving for X2
40
Let’s first consider labor constraint line first
30
1(0)+2X1=40 20
X2= 20 10
1X1+2(0)=40 X1
0 50 60
10 20 30 40
X1=40 (40,20) X2
The constraint area for clay
Then, let’s consider clay constraint 60
4(0)+3X2=120 50
40
X2=40
30
4X1+3(0)= 120 20
X1=30 10
(30, 40) 0
X1
10 20 30 40 50 60
Contd
The feasible solution area is an area on the graph that is
bounded by the constraint equations.
X2
60
50
40
Common area to both constraints
30
20
10
X1
0 10 20 30 40 50 60
The Optimal Solution Point
50
40
30
4X1+3X2=120
A
20
10
B 1X1+2X2=40
C X1
0 10 20 30 40 50 60
Calculate the value of each corner (O, A, B and C) to get
the optimal solution
Max Z= $40X1+$50X2
50
40
30
4X1+3X2=120 Optimum solution
A
20 The optimal solution is
the best feasible solution.
10
B 1X1+2X2=40
C X1
0 10 20 30 40 50 60
LP: Cost Minimization
x1 =1, x2=2
We draw the line with these coordinates and get line I drawn in the graph
passing through origin.
Now, convert constraint (ii) in equality
x1 + 4x2 = 80
When x1 =0, x2=20
X2 =0, x1=80
We draw the line II (80, 20) as shown in graph.
Now, convert constraint (iii) in equality
0.9x1 + 0.8x2 =40
When x1 =0, x2=50
X2 =0, x1=44.4
We draw line III (44.4, 50) as shown in graph.
contd
contd
Animals need:
X1 X2 X1 X2
0 14 X1 X2
0 12
7 0 12 0 0 6
18 0
12
10
2X1+X2= 14
B
8
4 C
2X1+X2= 14
2
D
0 X1
2 4 6 8 7 10 12 14 16 18
Optimum solution
Simplex
method
Simplex method of solving LP
When a large number of variables (more than 2) are involved
in a problem, the solution by graphical method is difficult/ not
possible.
– The simplex method provides an efficient technique which can be
are provided by the corner points and that too not all of them.
7. Variable Mix: The values of the column that contains all the variables
in the solution.
8. Basis: The set of variables which are not set to zero and figure in the
column of "Product Mix" are said to be in the 'Basis'.
12. Cj - Zj = ∆j or Index Row: The row containing net profit or loss resulting
from introducing one unit of the variable in that column in the solution. A
positive number in the ∆j row would indicate an algebraic reduction or
increment in the objective function if one unit of the variable of that column is
introduced in the basis.
13. Pivot -Column: The column with the largest positive number in Cj -
Zj row in a maximization problem or the smallest number in a
minimization problem is called Pivot column. This indicates the variable
entering the solution in the next iteration by replacing an appropriate
variable.
14. Pivot Row: When we work out the ratio of quantities bi's and the
elements of the Pivot column, we get the last column of the simplex table.
The outgoing variable to be replaced by the entering variable (decided
by the key row) would be the one with the smallest positive value of the
ratio column.
15. Pivot Element: The element at the point of intersection of
the key column and the key row is called the Pivot element.
Constraints (linear)
.........................
When the constraints are of the type < bi, then to convert the it into
equality we need adding some variable (not constant) this is normally
done by adding variables such as S1, S2. . . . . Sn, which are called slack
variables. In physical sense, these slack variables represent unused
resources, the slack variables contribute nothing towards the objective
function and hence their coefficients in the objective function are to be
zeros.
Thus, to illustrate the above concept,
This is done to achieve unit matrix for the constraints. But artificial
variables can not figure in the solution as there are artificially added
variables and have no significance for the objective function. These
variables, therefore, are to be removed from the solution.
Standardization/Tableau Form/
Characteristics:
All constraints are expressed in the form of equalities or equations.
All right hand sides are non-negative
All variables are non-negative
2. Develop an initial simplex tableau
v. The last column at the right is called the quantity column. It refers
to the right hand side values (RHS) of the constraints.
vi. There are two more rows at the bottom of the tableau. The first
raw is a Zj-row. For each column the Zj – value is obtained by
multiplying each of the number of the column by their respective row
coefficient in column C. The last row is Cj-Zj row.
The values in this row are also calculated column by
column. For each Column, the value in row Zj is subtracted
form the Cj value in the top row.
3. Interpreting the initial simplex tableau
tableau.
5. Determining the leaving variable: the leaving variable is
identified as the one with the smallest non-negativity ratio for
quantity divided by respective positive pivot columnar
entries. The row of the leaving variable is pivot row.
(b) Compute the, Pivot row with reference to the newly entered
variable by dividing the old row quantities by the key element.
(c) new values for the other rows. In the revised simplex table,
all the other rows are recalculated as follows.
Now there are five variables and three equations and hence to obtain the
solution, any two variables will have to be assigned zero value. Moreover, to get a
feasible solution, all the constraints must be satisfied.
Unit Cj 8 16 0 0 0 Ratio
profit
BV Q X1 X2 S1 S2 S3 Q/aij
(Zj)
0 S1 200 1 1 1 0 0 200/1=200
0 S2 125 0 1 0 1 0 125/1=125 LV
EV
Key No.
Where: EV= entering variable (Key column)
LV= leaving variable (key row)
Entering variable
Since Cj - Zj is maximum at 16, i.e., profit is more for each unit for x2
variable, we introduce x2 into the solution. It is the marked as key column and
x2 becomes the entering variable. Dividing Quantities (bi's) by the
corresponding key elements of each row, we obtain the ratio (Q/aij) column
such as for row S1, it is 200 ÷ 1 = 200, S2= 125 and S3=150.
Leaving variable
The leaving variable is, the row which has least ration (Q/aij), here, S2 has 125
ratio which small compare to other BV, it will be replaced by X2.
Now each of the elements of the Key row is divided by Key element to
get x2 row in the new table. Thus we get the key row as follows:
Unit profit Q X1 x2 S1 S2 S3
16 125/1 0/1 1/1 0/1 1/1 0/1
125 0 1 0 1 0
Zj Cj 8 16 0 0 0
variable Q x1 x2 s1 s2 S3
0 S1 75 1 0 1 -1 0
16 X2 125 0 1 0 1 0
0 S3 150 3 0 0 -6 1
Zj 2000 0 16 0 16 0
Cj-Zj 8 0 0 -16 0
Key row
0 S3 150 3 0 0 -6 1 150/3=50
Zj 200 0 16 0 16 0
0
Cj-Zj 8 0 0 -16 0
Key
column
Now each of the elements of the Key row is divided by Key element to
get x2 row in the new table. Thus we get the key row as follows:
Unit profit Q X1 x2 S1 S2 S3
8 150/3 3/3 0/3 0/3 -6/3 1/3
50 1 0 0 -2 1/3
8 X1 50 1 0 0 -2 1/3
Zj 2400 8 16 0 0 8/3
Cj-Zj 0 0 0 0 -8/3
Now, all the values of ∆j being zero or negative, suggesting that the
solution is optimal and Z = 2,400 for x1 = 50 and x2 = 125. S1 indicates
surplus.
Home work
Maximize Z = 30x1 + 40x2
Subject to, 60x1 + 120x2 < 12,000
8x1 + 5x2 < 600
3x1 + 4x2 < 500
x1, x2 > 0
Answer
X = 200/11
1
X =1000/11
2
Profit= 46,000/11
Class work
Maximise Z = 10x1 + 15 x2 + 20 x3
S.T.
10 x1+ 5x2 + 2x3 ≤ 2,700
5x1 + 10x2 + 4x3 ≤ 2,200
1x1 + 1x2 + 2x3 ≤ 500 and
All 1x,x2 andx3 are ≥ 0
simplex table I
Zj Cj 60 80 0 0 M M Ratio
BV Q x1 x2 s1 s2 A1 A2
M A1 900 20 30 -1 0 1 0 45
M A2 1200 40 30 0 -1 0 1 30
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
simplex table I
Zj Cj 4 2 0 0 M M Ratio
BV Q x1 x2 s1 s2 A1 A2
M A1 3 3 1 0 0 1 0 1
M A2 6 4 3 -1 0 0 1 6/4
0 S2 3 1 2 0 1 0 0 3
Zj 9M 7M 4M -M 0 M M
Cj-Zj 4-7M 2-4M M 0 0 0
X1= Q X1 X2 S1 S2 A2
3 3 1 0 0 0
3/3 3/3 1/3 0/3 0/3 0/3
new row= 1 1 1/3 0 0 0
New row= old row – corresponding coefficient new tableau
in pivot column X row value
Zj Cj 4 2 0 0 M Ratio
BV Q x1 x2 s1 s2 A2
4 X1 1 1 1/3 0 0 0 3
M A2 2 0 5/3 -1 0 1 6/5
0 S2 2 0 5/3 0 1 0 6/5
Zj 4+2M 4 4/3+5/3M -M 0 M
Cj-Zj 0 2-5M/3 M 0 0
Select near to
the top
X2= Q X1 X2 S1 S2
2 0 5/3 -1 0
2/5/3 0/5/3 5/3/5/3 -1/5/3 0/5/3
new row= 6/5 0 1 -3/5 0
New row= old row – corresponding coefficient new tableau
in pivot column X row value
These special types include problems with more than one optimal
solution, infeasible problems, problems with unbounded solutions,
problems with ties for the pivot column or ties for the pivot row, and
problems with constraints with negative quantity values.
Multiple optimal solution
40
Profit @ corner B
30
A and C is equal
20
(1200)
10
B
FR
C
10 20 30 40 50
An infeasible solution
Multiple optimal solution
The three constraints do not overlap to form a feasible solution area.
Because no point satisfies all three constraints simultaneously, there is no
solution to the problem.
X1= 4
8
X2=6 C
6
B
4
4X1+2X2=8
2
A
C
2 4 6 8 10
An unbounded problem
the model
8
x1, x2≥0
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
Cj-Z 0 0 0 10 -40/3
Shadow price
From the above tableau; the shadow prices are $ 0 for S1,
$10 for S2 and $40/3 for S3. This tells us that if the amount
Cj 60 50 0 0 0
Zj Bv Q X1 X2 S1 S2 S3
0 S1 24 0 0 1 6 -16/3
60 X1 9 1 0 0 -1 -1/3
50 X2 4 0 1 0 -1 2/3
Zj 740 60 50 0 10 40/3
Cj-Zj 0 0 0 -10 -40/3
Solution
1. Recall the original value of the resources
Original value constraints S1 S2 S3
100 S1 1 6 -16/3
22 S2 0 -1 -1/3
39 S3 0 -1 2/3
2. ratio = Q/respective slack values
S1= 24/1= 24 S2= 24/6= 4 S3= 24/-16/3= -4.5
9/0= undefined 9/-1= -9 9/-1/3= -27
4/0= undefined 4/-1= -4 4/2/3= 6
3. Find the range of feasibility
2
Example:
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
Subject to:
x1, x2≥0
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
Cj-Z 0 0 0 10 -40/3
Shadow price
From the above tableau; the shadow prices are $ 0 for S1, $10
there are upper and lower limits, i.e. allowable increase and
decrease.
Range of Feasibility (Right hand side range)
Step 2. identify the smallest +ve ratio and –ve ratio closest to zero
Step 3. find the upper limit or allowable increase and lower limit
or allowable decrease (range of feasibility)
Cj 60 50 0 0 0
Zj Bv Q X1 X2 S1 S2 S3
0 S1 24 0 0 1 6 -16/3
60 X1 9 1 0 0 -1 -1/3
50 X2 4 0 1 0 -1 2/3
Zj 740 60 50 0 10 40/3
Cj-Zj 0 0 0 -10 -40/3
Solution
1. Recall the original value of the resources
Original value constraints S1 S2 S3
100 S1 1 6 -16/3
22 S2 0 -1 -1/3
39 S3 0 -1 2/3
2. ratio = Q/respective slack values
S1= 24/1= 24 S2= 24/6= 4 S3= 24/-16/3= -4.5
9/0= undefined 9/-1= -9 9/-1/3= -27
4/0= undefined 4/-1= -4 4/2/3= 6
3. Find the range of feasibility
Two cases
1. Range of insignificance
the range over which the non basic variables objective function coefficient can
change without making these variables entering in the solution
2. Range of optimality
the range over which the objective function coefficient of basic variables can
change without changing the optimal values i.e. without changing basic and non
basic variables but change the optimal function value.
Steps for 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
0 1 0 -1 2/3
∞ ∞ ∞ -10 40
Example:
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