Download as pdf or txt
Download as pdf or txt
You are on page 1of 132

By Fanta T

Chapter Two
Linear Programming

By: Fanta T (PhD Candidate)


- ftarikumisera@yahoo.com
Email

Mob. 0924464113
1
By Fanta T

Introduction

• Linear programming- developed by Kantorovich in 1939

and extended by G. Dantzig in 1947

• The original name, "programming in a linear structure,"

which was later shortened to "linear programming.“

• Programming- “planning or optimization”

• LP- Planning with linear models

2
By Fanta T

Meaning of LP

• LP is a mathematical technique for choosing the best

alternative from the a set of feasible alternatives.

• It is the most commonly applied form of constrained

optimization, which is harder than uncontained optimization

3
By Fanta T

….

• Linear Programming (LP) is a field of management


science that finds most efficient way of using limited
resources to achieve the objectives of a business.

Optimization

4
By Fanta T

LP is the favorite tools of OR’s

• Simple: easy to manipulate

• Easy to understand: easy to explain

• Robust: strong (good enough for every thing)

5
By Fanta T

Main elements LP
 Decision variables –value of unknown variables
Goal- to find values of the variable that provide a best value of the objective function

 Objective function- mathematical expression that combines the variables to

express your goal.


•Represent profit, efficiency, yield, cost etc

•Requirement: maximize or Minimize objective function

 Constraints- a mathematical expression that combine the variables to

express limits on the possible solutions

 Variable bound- Right hand side (rhs) or quantity, budget

6
By Fanta T

Expressing optimization problems mathematically

• 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) Z : f(X1 , X2 , X3, …, Xn) 7
By Fanta T

Mathematical formulation of an optimization


problem

MAX(MIN) : f(X1 , X2 , X3 , … , Xn)

Subject to:
f(X1 , X2 , X3 , … , Xn) < b1

f(X1 , X2 , X3 , … , Xn) > bk

f(X1 , X2 , X3 , … , Xn) = bm

note : n variables, m constraints

8
By Fanta T

STEPS IN FORMULATION OF LP PROBLEMS

There are three basic steps in formulation of LPM


Step 1 : define the decision variables
how many x1, x2, x3……xn to produce
Step 2 : define the objective function
maximize profit or minimize a cost
Step 3 : define the constraints
resources available to produce something

9
By Fanta T

Example
• An electronic firm is undecided at the most profitable mix
for its products. The products manufactured are
transistors, resistors and carbon tubes with a profit of
(per 100 units) $ 10, $6 and $4 respectively. To produce
a shipment of transistors containing 100 units requires 1
hour of engineering, 10 hours of direct labor and 2 hours
of administrative service. To produce 100 units of
resistors requires 1 hour, 4 hours and 2 hours of
engineering, direct labor and administrative time
respectively. For 100 unit of carbon tubes it needs 1
hour, 6 hours and 5 hours of engineering, direct labor
and administrative time respectively. There are 100
hours of engineering time, 600 hours of direct labor and
300 hours of administrative time available. Formulate the
corresponding LPP.
10
By Fanta T

Solution
• Let X1- 100 units of transistors
• X2- 100 units of resistors
• X3- 100 units of carbon 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.
11
By Fanta T

formulated LPP is

12
By Fanta T

Class Work

• DeReal international, produces wooden doors and chairs. Each

doors sells for $27, uses $10 of raw materials and takes $14 of
labor& overhead costs. Each chairs sells for $21, uses $9 of raw
materials, and takes $10 of overhead costs. Each doors needs 2
hours finishing and 1 hour carpentry; each chairs needs 1 hour
finishing and 1 hour carpentry. Raw materials are unlimited, but
only 100 hours of finishing and 80 hours of carpentry are available
each week. Demand for chairs is unlimited; but at most 40 doors
can be sold each week. How many of each should be made each
week to maximize profits.
13
By Fanta T

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
The farmer's field requires at least 16 pounds of nitrogen and 24 pounds of
phosphate. Super-gro costs $6 per bag, and Crop-quick costs $3. The farmer
wants to know how many bags of each brand to purchase in order to minimize
14
the total cost of fertilizing.
By Fanta T

Cont’d
• Decision Variables

x1 = bags of Super-gro
x2 = bags of Crop-quick
The Objective Function
minimize Z = $6x1 + 3x2
where
$6x1 = cost of bags of Super-gro
$3x2 = cost of bags of Crop-quick

15
By Fanta T

Cont’d

16
By Fanta T

Class work
• A Farmer is mixing two types of food, Brand X
and Brand Y, for his cattle. If each serving is
required to have 60 grams of protein and 30
grams of fat, where Brand X has 15 grams of
protein and 10 grams of fat and costs 80
cents per unit, and Brand Y contains 20 grams
of protein and 5 grams of fat and costs 50
cents per unit. Formulate LPM

17
By Fanta T

LP Solutions

18
By Fanta T

Solution of Linear Programming Problems

• The linear programming problems can be solved to


determine optimum strategy by two methods-
Graphical and Simplex method.

19
By Fanta T

A. GRAPHICAL METHOD

• 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.

20
By Fanta T

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 below the line for the constraint <
and shading above the line for the constraint > type).

21
By Fanta T

Cont’d

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.

NB: an optimum solution to the LP is always at corner point.

22
By Fanta T

A. Maximization Problem

Maximization Problem ==>Maximize Z with inequalities of


constraints in < form.
Example:
Consider two models of color TV sets; Model A and B, are
produced by a company to maximize profit. The profit
realized is $300 from A and $250 from set B. The limitations
are;
a. availability of only 40hrs of labor each day in the
production department.
b. a daily availability of only 45 hrs on machine time.
c. ability to sale 12 set of model A.
 How many sets of each model will be produced each day
so that the total profit will be as large as possible?

23
By Fanta T

Maximization Problem…
Resources used per unit
Constraints Model A Model B Maximum Available hrs.
(X1) (X2)

Labor hr. 2 1 40
Machine hr. 1 3 45
Marketing hr. 1 0 12
Profit $300 $250
Solution
1. Formulation of mathematical modeling of LPP
Max Z=300X1 +250X2
St:
2X1 +X2< 40
LPP Model
X1 +3X2< 45
X1 < 12
X1, X2 > 0

24
By Fanta T

Maximization Problem…
2. Convert constraints inequalities into equalities
2X1 +X2 = 40
X1 +3X2= 45
X1 = 12
3. Draw the graph by intercepts
2X1 +X2 = 40 ==> (0, 40) and (20, 0)
X1 +3X2= 45==> (0, 15) and (45, 0)
X1 = 12==> (12, 0)
X1, X2 =0

X2
X1=0
40 X1=12

15
B

Feasible C (12, 11)


Region X2=0
X1
D
A 12 20 45

25
By Fanta T

Maximization Problem…
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

Corners Coordinates MaxZ=300 X1 +250X2


A (0, 0) $0
B (0, 15) $3750
C (12, 11) $6350
D (12, 0) $3600

Interpretation:
12 units of product A and 11 units of product B should be produced so that the total profit will be $6350.

26
By Fanta T

Maximization Problem (Exercise)


Exercise:
 A manufacturer of light weight mountain tents makes two
types of tents, REGULAR tent and SUPER tent. Each
REGULAR tent requires 1 labor-hour from the cutting
department and 3labor-hours from the assembly
department. Each SUPER tent requires 2 labor-hours from
the cutting department and 4 labor-hours from the
assembly department .The maximum labor hours available
per week in the cutting department and the assembly
department are 32 and 84 respectively. Moreover, the
distributor, because of demand, will not take more than 12
SUPER tents per week. The manufacturer sales each
REGULAR tents for $160 and costs$110 per tent to make.
Where as SUPER tent ales for $210 per tent and costs
$130 per tent to make.
27
By Fanta T

Maximization Problem (Exercise)…


Required:
 Formulate the mathematical model of the problem.
 Using the graphic method, determine how many of each
tent the company should manufacture each week so as to
maximize its profit?
 What is this maximum profit assuming that all the tents
manufactured in each week are sold in that week?

Answer
• The manufacturer should produce and sale 20 REGULAR
tents and 6 SUPERS tents to get a maximum weekly profit
of $1480.

28
By Fanta T

B. Minimization Problem
Minimize C= 50x1 + 20x2
Subject to
2x1 – x2> 0
x1 + 4x2 > 80
0.9x1 + 0.8x2 >40

x1 ,x2 > 0

29
By Fanta T
Solution:

• The first step is skipped as LP problem is already

formulated. We will follow other steps simultaneously.


In constraint (i) 2x1 –x2 > 0 there is no constant value,
hence it must pass through the origin. First convert it
into equality.

2x1 –x2 = 0 . Now give x1 any arbitrary value.

When x1 =0, x2=0

x1 =1, x2=2

x1 =2, x2=4 and so on.


30
By Fanta T
Cont’d

• 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.

31
By Fanta T

Cont’d

32
By Fanta T
Cont’d

• For feasible area we need to examine all the three

constraints equations (Note, all are > type)

• In equation (i) if we move vertically upward, meaning x1=o

and x2 increasing, the equation becomes negative or less


than, which is not permitted. Hence feasible area should be
on RHS.

• In equation (ii), the feasible area should be above the line

because it is greater than the sum of x1 and x2.

• Similarly in equation (iii) it is on the RHS therefore feasible

area (region) is indicated by three rows or shading and


33
extends up to infinity.
By Fanta T

Cont’d
• Now we have to find out different values of Z at different

corner points, B,C,E by finding out their coordinates (x1, x2)


then putting them in objective function Z. The point which
gives the minimum value is the answer.

At corner B x1=16,x2=32 therefore Z= 1440

At corner C x1=34.4,x2=11.4 therefore Z= 1948

At corner E x1=80,x2=0 therefore Z= 4000

From the above we can see that minimum value of Z is at


point B where x1=16 and x2 =32 and hence it is the answer.
34
By Fanta T

Class Work
• A Farmer is mixing two types of food, Brand X
and Brand Y, for his cattle. If each serving is
required to have 60 grams of protein and 30
grams of fat, where Brand X has 15 grams of
protein and 10 grams of fat and costs 80
cents per unit, and Brand Y contains 20 grams
of protein and 5 grams of fat and costs 50
cents per unit.
• Find the solution using graphical method.

35
By Fanta T

B. Simplex
Algorithm
36
By Fanta T

Simplex method of solving LP

• Geometric (graphical method) of solving LPP is useful

only for problems involving two DVs and relatively few


problem constraints.

• What happen when we need more DVs and more

problem constraints?

• We use an algebraic method called the simplex method,

which was developed by George B Dantzig in 1947.

37
Cont’d….
By Fanta T

• The simplex Algorithm is an iterative procedure for

finding the optimal solution that comes from the corner


points of the feasible region.

• Simplex algorithm considers only those feasible

solutions which are provided by the corner points and


that too not all of them. It is very efficient algorithm.

• The technique also has the merit to indicate whether

a given solution is optimal or not.

• formulated by G. Dantzig in 1947.

38
By Fanta T

Basic terms in simplex


approach
• Standard Form: linear relationships of objective
function and constraints, making RHS of constraints
as equal produces standard form, whereas the
inequality situation is called canonical form
• Slack/surplus and Artificial Variables: these are
generally designated as S1, S2 . . . . etc. and A1, A2 etc.
respectively
• Slack variables indicate unused capacity of a
constraint added in ‘≤’ constraints
• Slack variables represent the unused resources
between the left-hand side and right-hand side of 39
each inequality.
By Fanta T

Basic terms in simplex approach …


• Artificial variables are imaginary variables added in ‘=‘ & ≥
constraints to have the standard form
• Simplex Table: A table used for calculations during
various iterations of the simplex procedure, is called
Simplex table

40
By Fanta T

Basic terms in simplex


approach …
 Basic variables are selected arbitrarily with the restriction
that there be as many basic variables as there are
equations. The remaining variables are non-basic variables.
x1  2 x2  s1  32
3x1  4 x2  s2  84

 This system has two equations, we can select any two of


the four variables as basic variables. The remaining two
variables are then non-basic variables. A solution found by
setting the two non-basic variables equal to 0 and solving
for the two basic variables is a basic solution. If a basic
solution has no negative values, it is a basic feasible
solution.
41
By Fanta T

Example
• Max Z = 6X1 + 8X2
• S.t 5X1 + 10X2 ≤ 60
4X1 + 4X2 ≤ 40
X1, X2 >= 0

The Standard form of the LPM:


• Max Z = 6X1 + 8X2 + 0S1 + 0S2
• S.t 5X1 + 10X2 + S1 = 60
4X1 + 4X2 + S2 = 40
X1, X2, S1, S2, ≥ 0
• Since slack does not provide any real contribution to the
obj. fun, each slack variable is assigned a coefficient of
zero in the objective function
42
By Fanta T

Initial simplex tableau

43
By Fanta T

Interpretation

• Cj = the coefficient of the variables in the objective function in


the standard form.
• Cb = the coefficient of basic variables in the obj. fun.
• X1, X2, ..Xn = decision variables .
• S1, s2, Sn = basic variables (slack).
• a11, a12,… coefficient of DV in the constraint set.
• 1, 0, 1 are coefficient of basic variables in the constraints set.
• RHSV = the right hand side value of the constraints.

44
By Fanta T

..cont
• Cj - Zj = 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 index 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
• 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.

45
By Fanta T

…cont
• Pivot Row: it is the ratio of quantities divided by of
the Pivot column which indicates the outgoing variable
to be replaced by the entering variable. This would be
the one with the smallest positive value of the ratio
column

• Pivot Element: The element at the point of intersection


of the key column and the key row is called the Pivot
element

46
By Fanta T
A. Simplex Algorithm - Maximization problem

Example:

47
By Fanta T

Steps in Simplex Method

• Step 1: Write the problem in Standard form


• Max Profit = $70T + $50C + 0S1 + 0S2

• Subject to:
•2T + 1C + 1S1 + 0S2 = 100
•4T + 3C + 0S1 + 1S2 = 240
•T, C, S1, S2 ≥ 0

48
By Fanta T

Step 2: develop Initial Simplex Tableau

49
By Fanta T

Interpretation for Initial simplex tableau


• The number in the first row represent the coefficients in the first
constraint and the numbers in the second row is the coefficients
in the second constraint
• Initial solution is T = 0 and C= 0 a, So, S1 = 100 and S2 = 240,
max of Z = 0
• The two slack variables are the initial solution mix where the
values are found in the Quantity column
• The Substitution Rates:
• The coefficient of the constraint equations are the substitution rates
• Using variable T, to produce 1table; 2 units of S1 and 4units of S2 have to
be removed from the solution, has to be consumed
• Using variable C: to produce 1 chair; 1 unit of S1 and 3units of S2 should
be consumed or removed from the solution mix
• The slack variables should make an identify matrix

50
By Fanta T

Cj - Zj
• The Cj – Zj number in each column represents the net
profit that will result from introducing 1 unit of each
DV
• It is computed by subtracting the Zj total for each
column from the Cj value at the very top of that
variable's column
• Obviously with a profit of $0, the initial solution is not
optimal
• By examining the numbers in the Cj – Zj row in the
table, we can see that the total profits can be increased
by $70 for each unit of T and $50 for each unit of C
• A negative number in Cj – Zj row would tell us that the
profits would decrease if the corresponding variables
were added to the solution mix 51
By Fanta T

Step 3: Determining Entering and leaving variables


• Determining the entering variable: For a maximization
problem; the entering variable is identified as the one
which has the largest positive value in Cj-Z row. The
column which corresponds to the entering variable in
the simplex tableau is called pivot column.
• In a minimization problem, the entering variable is
identified as the one which has the largest negative Cj-Z
row value in the simplex tableau.
• 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
52
• The number at the intersection of the pivot row and
By Fanta T

The Second simplex Tableau

• All the pivot column elements except the pivot


number (has to be 1) should be changed to Zero by
applying row operation

53
By Fanta T

…cont
2 1 1 0 100
Divide all the pivot row by the pivot number i,e,. By 2
1 0.5 0.5 0 50
Apply row operation to change the pivot column elements to be zero,
keeping that the pivot number to be one
The operation is applicable to all of the row elements
Row operation: -4R1 + R2 = R2
-4 -2 -2 0 -200
4 3 0 1 240
When you sum up the above two rows using the operation the resulting
R2 value will be:
0 1 -2 1 40
54
By Fanta T

The Resulting simplex is:

55
By Fanta T

Interpretation of the 2nd simplex table


• The current solution is 50 tables and zero chairs generates a
profit of $3500
• T is a basic variable and C is a non-basic variable here
• Slack variable S2 is the unused time in the carpentry dep’t and
is in the basis.. Its value implies there is 40 hours of unused
carpentry time remaining.
• Slack variable S1 is non basic and it means no unused time in
the painting dep’t

56
By Fanta T

…continued
• The substitutions:
• In column C, if 1 unit of C is added to the current solution,
0.5 unit of T and 1 unit of S2 must be given up
• Because these are marginal rate of substitution, so only 1
more unit of S2 is needed to produce 1 chair
• In column S1, the substitution rates means that if 1 hour of
slack painting time is added to produce a chair, 0.5 less of
a table will be produced
• Cj – Zj row is important for two reasons:
• First, it indicates whether the current solution is optimal –
when there are no positive values in the bottom row, an
optimal solution to a maximization LP has been reached
• Second, we use it to determine which variable will enter
the solution mix
57
By Fanta T

Developing the Third Simplex tableau

58
By Fanta T

Developing the Third Simplex tableau

59
By Fanta T

Optimal solution
• Therefore, optimal solution is reach now
because all the elements in the last row is zero
and negative and hence:
• T = 30units
• C= 40 units and
• Max Profit = $4100

• S1 = 0 and S2 = 0

60
By Fanta T

Exercise

• Max Z = 60X1+ 50X2


Subject to
4X1+10X2 ≤ 100
2X1 + X2 ≤ 22
3X1 + 3X2 ≤ 39
X1, X2 >=0

61
By Fanta T

Standard form of the


LPP is as follows:

62
By Fanta T

Determining the Entering and


Exiting Variables

Select the leaving variable as the one that has the smallest nonnegative
ratio of quantity divided by substitution rate.

63
By Fanta T

Completed Second Tableau

Interpreting the Second Tableau


At this point, variables s1, x1, and s3 are in solution. Not only are
they listed in the basis, they also have a 0 in row C – Z. The solution
at this point is s1 = 56, x1 = 11, and s3 = 6.
Note, that x2 and s2 are not in solution. Hence, they are each equal
to zero. The profit at this point is $660, which is read in the
Quantity column in row Z. Also, note that each variable in solution
has a unit vector in its column.

64
By Fanta T

Determining the Entering


and Exiting Variables

65
By Fanta T

Completed Third Tableau

Interpreting the Third Tableau


In this tableau, all of the values in the bottom row are either negative or
zero, indicating that no additional potential for improvement exists.
Hence, this tableau contains the optimal simplex solution, which is
s1 = 24
x1 = 9
x2 = 4

66
By Fanta T

Class work
• Maximize Z = 30x1 + 40x2
Subject to, 60x1 + 120x2 < 12,000
8x1 + 5x2 < 600
3x1 + 4x2 < 500
x1, x2 > 0
Answer
X1= 200/11
X2=1000/11
Profit= 46,000/11

67
By Fanta T

Simplex Algorithm-
Minimization problem

68
By Fanta T

B. Simplex Algorithm- Minimization problem


• Some of the important aspects of minimization problem

1.Artificial variables have no economic significance

• Introduced only to bring in the standard form of simplex

method.

• Need be removed from the solution as soon as they

become non-basic.

2. Since these variables are added for computation purpose


only,

• ensure their zero value in the optional solution.


69
• This can be done by assigning very large penalty (+M) for
By Fanta T

Cont’d…

3. If artificial variables cannot be removed from the


solution, then the solution so obtained is said to be
Non-Feasible. This would indicate that the resources
of the system are not sufficient to meet the expected
demand.

4. Equality Constraints also can be handled by using


artificial variables to obtain initial solution.

70
By Fanta T

Cont’d…

• Big M-Method

• In this method, we assign the coefficients of the

artificial variables, as a very large positive penalty i.e.,


+M therefore called Big M-method.

71
By Fanta T

Cont’d…
• The Big M-method for solving LP problem can be

adopted as follows:

Step 1 : The standard simplex table can be obtained by


subtracting a surplus variable and adding an
artificial variables.

• Slack variables are assigned zero coefficients and

artificial variables assigned +M coefficients in the


objective function.

Step 2: We obtain initial basic feasible solution by


assigning zero value to the decision and slack 72
By Fanta T

Cont’d…
Step 3: Initial basic feasible solution is obtained in the
form of the simplex table as above and then values of ∆j
= Cj - Zj are calculated.

If ∆j ≥0, then the optimal solution has been obtained.

If ∆j< 0, then we select the largest negative value of ∆j

and this column becomes the key column indicating the


entering variable.

73
By Fanta T

Cont’d…

Step 4: Determine the key row as in case of


maximisation problem i.e., selecting the lowest positive
value of the ratio Q or bi/aij, obtained by dividing the
value of quantity bi by corresponding element of the key
column.

74
By Fanta T

Cont’d…
• Step 5: Repeat steps 3 and 4 to ensure optimal

solution with no artificial variable in the solution. If at


least one artificial variable is present in the basis with
zero value and coefficient of M in each Cj - Zj values is
negative, the LP problem has no solution. This basic
solution will be treated as degenerate.

• A tie for the pivot row is broken arbitrarily and can lead

to degeneracy.

75
By Fanta T

Cont’d…

• If at least one artificial variable is present in the

basis with positive value, and coefficient of M in each


Cj - Zj values is non-negative, then LP problem has
no optimal basic feasible solution. It is called
pseudo-optimum solution.

76
By Fanta T

Example
• Food A contains 20 units of vitamin X and 40 units of

vitamin Y per gram. Food B contains 30 units each of


vitamin X and Y. The daily minimum human
requirements of vitamin X and Y are 900 and
1200units respectively. How many grams of each type
of food should be consumed so as to minimise the
cost, if food A costs 60 cents per gram and food B
costs 80 cents per gram.

77
By Fanta T

Solution:

• LPP formulation is as follows

Min. Z = 60x1+ 80x2 (Total Cost)

Subject to, 20x1 + 30x2 > 900 (Vitamin X Constraint)

40x1 + 30x2 > 1,200 (Vitamin Y Constraint)


and x1, x2 > 0

78
By Fanta T

Cont’d…

• Adding slack and artificial variables, we get

Min. Z = 60x1 + 80x2 + 0S1 + 0S2 + MA1 + MA2

Subject to, 20x1 + 30x2 – S1 + A1 = 900

40x1 + 30x2 - S2 + A2 = 1,200

and x1, x2, S1, S2, A1, A2 > 0

79
By Fanta T

Initial non-optimal solution is written as follows:

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 2100M 60M 60M -M -M M M


Cj-Zj 60-60M 80-60M M M 0 0

Since ∆j = 60 – 60M is the lowest, x1 becomes the


entering variable, similarly Ratio bi/aij = 30 is
lowest positive value, hence it goes out. 80
By Fanta T

Simplex table II
Zj Cj 60 80 0 0 M Ratio
BV Q x1 x2 s1 s2 A1 Q/aij
M A1 300 0 15 -1 1/2 1 20
60 X1 30 1 3/4 0 -1/40 0 40

Zj 1800+300M 60 45+15M -M -3/2+1/2M M


Cj- 0 35-15M M (3-M)/2 0
Zj

Since ∆j = 35 – 15M is the lowest, x1 becomes the


entering variable, similarly Ratio bi/aij = 20 is
lowest positive value, hence it goes out. 81
By Fanta T

Initial non-optimal solution is written as follows:


Simplex table III

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

Zj 2500 60 80 -7/3 -1/3


Cj- 0 0 7/3 1/3
Zj

Since ∆j = zero and positive value, hence this the


solution.
82
By Fanta T

Class Work
By Fanta T

Solution

84
By Fanta T

Initial Tableau

• X1 – entering variable and A2 – the leaving variable


and the Pivot element is 8
• Row operation:
• New R2 = 1/8 *Old R2 to make the pivot element ONE
• New R1 = -3 * New R2 + Old R1 to make the pivot column elements
ZERO except the key element
By Fanta T

Second Tableau

• X2 – entering variable and A1 – exiting variable and


key element is 9/2
• Row operation:
• New R1 = 2/9 * Old R1 to make the pivot element ONE
• New R2 = -1/2 * New R1 + Old R2 to make the pivot
column elements ZERO except the key element
By Fanta T

Third Tableau

• Do we reach at optimal? Yes, b/c in case of


minimization, if all the C-Z row are zero and positive,
it indicates optimality is attained
• Therefore, X1 = 20/3 X2 = 8/3 S1 = 0 S2
=0
• and Min Z = 212/3
By Fanta T

Mixed constraints

88
By Fanta T

Mixed constraints

89
By Fanta T

Initial non-optimal solution is written as follows:

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

90
Cont’d…
By Fanta T

• 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

row A2, Q= 6-(4x1) = 2 S2, Q= 3-(1x1)= 2


X1= 4-(4x1)=0 X1= 1-(1x1)=0
X2= 3-(4x1/3)=5/3 X2= 2-(1x1/3)=5/3
S1= -1-(4x0)= -1 S1= 0-(1x0)=0
S2= 0-(4x0)= 0 S2= 1-(1x0)=1
A2= 1-(4x0)= 1 A2= 0-(1x0)=0

91
By Fanta T

Revised simplex table II

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

92
Cont’d…
By Fanta T

• 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

row X1, Q= 1-(1/3x6/5) = 9/15 S2, Q= 2-(5/3x6/5)= 0


X1= 1-(1/3x0)= 1 X1= 0-(5/3x0)= 0
X2= 1/3-(1/3x1)= 0 X2= 5/3-(5/3x1)= 0
S1= 0-(1/3x-3/5)= 1/5 S1= 0-(5/3x-3/5)=1
S2= 0-(1/3x0)= 0 S2= 1-(5/3x0)= 1

93
By Fanta T

Optimal solution simplex table III


Zj Cj 4 2 0 0
BV Q x1 x2 s1 s2
4 X1 9/15 1 0 1/5 0
2 X2 6/5 0 1 -3/5 0
0 S2 0 0 0 1 0
Zj 72/15 4 2 -2/5 0
Cj-Zj 0 0 0 0

This is the optimal solution, with X1= 3/5


X2= 6/5
and
total cost= 72/15
94
By Fanta T

Irregular types of LPP


• The basic simplex solution of typical maximization and

minimization problems has been shown in this chapter.


However, there are several special types of atypical linear
programming problems.

• For irregular problems the general simplex procedure does

not always apply.

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
95 with
By Fanta T

Multiple optimal solution

40

Profit @ corner B
30

A and C is equal
20

(1200)
10

B
FR
C
10 20 30 40 50 96
By Fanta T

An infeasible solution

97
By Fanta T

Cont’d…
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 98
By Fanta T

An unbounded problem

• In some problems the feasible solution area formed by

the model constraints is not closed. In these cases it is


possible for the objective function to increase indefinitely
without ever reaching a maximum value because it never
reaches the boundary of the feasible solution area.

• In an unbounded problem the objective function can

increase indefinitely because the solution space is not


closed.

99
By Fanta T

An unbounded solution
But unlimited profits are
not possible in the real
world; unbounded
solution, like an infeasible
solution, atypically reflects
an error in defining the
problem or in formulating
10

the model
8

The objective function is


6
4

shown to increase without


2

FR bound; thus, the solution is


2 4 6 8 10 never reached 100
By Fanta T

post optimality analysis

• Sensitivity analysis
• Duality

• Carried out after the optimal


solution is found
• Is begins with the final simplex
tableau
101
By Fanta T

Sensitivity analysis

• Examination of the impacts of changes of parameters

on the optimal solution.

• i.e. change of coefficient of the constraints, change of

coefficient of the objective function, change of quantity


of RHS values.

• Starts with the final tableau of the LPP (simplex

tableau)

102
By Fanta T

Example: 1. a change in the RHS of a


constraints
 Shadow prices: ==>How much should a firm be willing to
pay to make additional resources available?
 Shadow prices signify the change in the optimal value of
the objective function for 1 unit increases in the value of
the RHS of the constraint that represent the availability of
scarce resources.
 The negative of the number of Cj - Zj row in its slack
variable columns provide as with shadow prices. Or:
shadow prices are found in the Zj row of the final simplex
tableau in the slack variable columns.
 RHS ranging is the range over which shadow prices
remain valid.

103
By Fanta T

• The LPM of the micro computer problem above is:

Max Z: 60x1+50x2

Subject to:

Assembly time: 4X1+10x2≤100

Inspection time: 2x1+x2≤22

Storage space: 3x1+3x2≤39

x1, x2≥0

104
By Fanta T

Cont’d…
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
105
By Fanta T

• From the above tableau; the shadow prices are $ 0 for S1,

$10 for S2 and $40/3 for S3.

• for example, an increase of S1 by one unit will resulted

increment of objective value by $10.

• Similarly the opposite is true, i.e. decrease of 1 unit of S1

will be resulted in reduction of objective value by $0.

• But to what extent this change hold true?

• Because we can’t increase or decrease the constraint

infinitely, there are upper and lower limits, i.e. allowable


106
increase and decrease.
By Fanta T

Range of Feasibility (Right hand side range)

• The range of feasibility is the range over which the

RHS value of a constraint can be changed and still


have the same shadow prices.

107
By Fanta T

Range of feasibility

• The range within which resources/constraints can

changed having the proportionate change in objective


value

108
By Fanta T

Steps
Step 1. compute the ratio (feasibility ratio) quantity

respective slack value =


Q/S

both –ve and +ve ratio are considered

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
Closest to zero
or allowable decrease (range of feasibility)

Upper
Forlimit= the original
both max value - negative ratio
and min problems
109
By Fanta T

Determine the range of feasibility for each of the constraints in the ff


LPP, whose final tableau

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

110
By Fanta T

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 111
By Fanta T

3. Find the range of feasibility

Constrai Origina Lower limit Upper limit Range of


nts l value feasibility
S1 100 100-24= 76 100+∞ 76-∞
S2 22 22-4= 18 22+4= 26 11-26
S3 39 39-6 = 39+4.5= 43.5 33-43.5
33
Therefore:

Constraint one (assembly line): 100-24 up to 100+∞= 76-∞

Constraint two (inspection time): 22-4 up to 22-4= 18-26

Constraint three (storage space): 39-6 up to 39+4.5= 33-43.5


112
By Fanta T

Interpretation
First constraint:
Each hour decrease in assembly time will decrease the current profit by Birr 0 (i.e no
effect-indicated by shadow price) as long as the decrease is up to 24 hours. But if the
assembly time decreases by more than 24 hours (or if the total available assembly time is
lower than 76 hours), the current shadow price will no longer be valid. That is, the profit
will be affected. But available assembly time can increase indefinitely (=allowable
increase is ∞ ) without affecting the current profit level.
Second constraint:
Similarly, Each hour increase or decrease in inspection time will increase or decrease the
current profit by $10, respectively as long as the total inspection time is between 18 and
26 hours. Out side the range of feasibility, the current shadow price ($10) will not be valid.
Third constraint:
Each cubic feet increase or decrease in storage space results in an increase or
decrease, respectively, of profit by $13.33 (i.e 40/3) as long as the total storage space is
between 33 and 43.5 cubic feet.
113
By Fanta T

Example 2. A change of coefficient of objective function

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.

114
By Fanta T

Steps for range of optimality

For both max and min problems

115
By Fanta T

Example
Cj 60 50
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

• Determine the range of insignificant for S2 and

the range of optimality for decision variables

116
By Fanta T

Solution

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

• Upper limit= 60+40= 100 ∞ ∞ ∞ 10 -20

• Lower limit= 60-10= 50 • Upper limit= 50+10= 60

• Range of optimality of X1(1st DV)= 50-100 • Lower limit= 50-20= 30

• Range of optimality of X2(2nd DV)=


30-60

117
By Fanta T

EXERCISE:
Solve the following LPP using simplex method. A firm that
manufactures both lawn mowers and snow blowers:
X1 =the number of lawn mowers
X2 =the number of snow blowers
Max.Z=$30x1+$80x2
Subject to:
2 x1+4x2 < 1000 Labor hours available
6x1 + 2x2 < 1,200 pound of steel available
x2 < 20 snow blower engine available
x 1, x 2 > 0
a. What is the best product mix? What is the optimal profit?
Answer:
x1=193.33 , x2=20 and profit =$7399.9 118
By Fanta T

b. What are the shadow prices? When the optimal solution has
been reached, which resource has the highest marginal value?
Answer:
The shadow price for 1 additional labor=$0
The shadow price for 1 additional pound of steel=$5.01
The shadow price for 1 additional snow blowers engine made
available =$70.01
Thus, snow blower engine have the highest marginal value at
the optimal solution.

119
By Fanta T

c. Over what range in each of the RHS values are


these shadows valid?
Answer:
The shadow price for labor hours is valid from 466.66
hours to an infinite.
The shadow price for pounds of steel is valid from 40
pounds up to 2800pounds
The shadow price for snow blower engines ranges from 0
engines up to 180 engines
d. What are the ranges over which the objective
function coefficients can vary for each of the two
decision variables? 120
By Fanta T

Duality
• The mirror image of LPP

A given LPP has two forms


1.The Primal: the original LP Model

2.The Dual: alternative

How to convert the primal to its dual and vice versa?


Maximization objective of the primal= minimization objective
of the Dual.

121
By Fanta T

DUALITY
Every LPP has another LPP associated with it,
which is called its dual.
The first way of starting a linear problem is called
the primal of the problem.
The second way of starting the same problem is
called the dual.
 The optimal solutions for the primal and the dual
are equivalent, but they are derived through
alternative procedures.

122
By Fanta T

Primal-Dual Relationship
Primal Dual
Objective is minimization Objective is maximization and vice versa

> type constraints < type constraints

No of columns No of rows

No of rows No of columns

No of decision variables No of constraints

No of constraints No of decision variables

Coefficient of Object function RHS value

RHS value Coefficient of Object function

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 of
scars resources used. 123
Example: 1 By Fanta T

Write the duals to the


following problems
a. Max.Z=5x1+6x2
Subject to:
2x1+3x2 < 3000 (Labor
constraint)
5x1 + 7x2 < 1000 (Machine
constraint)
Solution
x1 Represent
+ x2 < primal (Market
5000in the conventional table as follows
constraint)
Dual variables x 1 x 2 Constraints

x1, xu 2 > 0 2
1 3 < 3000
u2 5 7 < 1000
u3 1 1 < 500

MaxZ 5 6
By referring the above table, dual for this can
be stated as: 124
By Fanta T

MinZ*=3000 u1 +1000 u2 +500 u3


St:
2u1+5u2 + u3> 5
3u1+7u2 + u3> 6
u1, u 2 , u 3> 0
Note:
For maximizing, all constraints must be brought to “<”
form
For minimizing, all constraints must be brought to “>”
form 125
By Fanta T
b. Max.Z=60x1+50x2
Subject to:
2x1+4x2 < 80
3x1 + 2x2 < 60
x1 < 15
2x2 < 36
x1, x2 > 0
Solution
Primal is represented in the table as follows:

Dual variables x1 x2 Constraints


u1 2 4 < 80
u2 3 2 < 60
u3 1 0 < 15
u4 0 2 < 36
MaxZ 60
The dual form is: 50
MinZ*=80 u1 +60u2 +15u3+36u4
St::
2u1+3u2 + u3 > 60
4u1+2u2 + u4 > 50
u1, u2 , u3, u4 > 0

126
By Fanta T

C. Obtain the dual problem of the following primal LPP


Min.Z=x1+2x2
Subject to:
2x1+4x2 < 160
x1 - x2 = 30
x1 > 10
x1, x2 > 0
Solution
Rule:
• 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.
• Transform the < type constraint to a > type constraint by multiplying the
constraint by -1.
• Write the = type constraint equivalent to two constraints of the type > and <.
The standard primal LPP so obtained is:
Min.Z=x1+2x2
Subject to:
-2x1-4x2 > -160
x1 - x2 > 30
-x1 + x2 > -30
x1 > 10
x1, x2 > 0
127
By Fanta T

 Let u1, u2 , u3, and u4 be the dual variables corresponding to the four
constraints in given order, then the dual of the given primal problem can
be 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
u1, 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.

128
By Fanta T

Example: 2
• The doctor advises a patient visited him that the patient is weak

in his health due to shortage of two vitamins, i.e., vitamin X and

vitamin Y. He advises him to take at least 40 units of vitamin X

and 50 units of Vitamin Y everyday. He also advises that these

vitamins are available in two tonics A and B. Each unit of tonic A

consists of 2 units of vitamin X and 3 units of vitamin Y. Each

unit of tonic B consists of 4 units of vitamin X and 2 units of

vitamin Y. Tonic A 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
129
patient has to fulfill the need of vitamin by consuming A and B
By Fanta T

Cont’d…

• If we solve and get the solution of the primal problem, we

can read the answer of dual problem from the primal


solution.

Primal problem: Dual Problem:

Min C= 3X1+ 2.5X2 Max Z= 40Y1+ 50Y2

st: 2X1+ 4X2 ≥40 St: 2y1+ 3y2 ≤3

3X1+ 2X2 ≥50 4y2+ 2y2


≤2.50
130
X1, X2≥0 Y1, Y2 ≥0.
By Fanta T
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- 0 0 3/16 7/8 M-3/16 M-7/8
Zj
Answer: X1= 15 X2= 2.5 cost= 51.25

Solution to dual (maximization)


CJ 40 50 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- 0 0 -15 -5/2
Zj
131
Answer: Y1= 3/16 Y2= 7/8 profit= 51.25
By Fanta T

The END!

132

You might also like