You are on page 1of 60

CHAPTER

TWO

Linear Programming LP
Operations Research
by

FUAD MUSTEFA

12/24/2022 Fuad.M 2022 1


Introduction to Linear Programming
Linear Programming is that branch of mathematical programming
which is designed to solve optimization problems where all the
constraints as will as the objectives are expressed as Linear function .
Linear Programming is a technique for making decisions under
certainty i.e.; when all the courses of actions available to an
organization are known & the objective of the firm along with its
constraints are quantified.
LP is the analysis of problems in which a Linear function of a number
of variables is to be optimized (maximized or minimized) when whose
variables are subject to a number of constraints in the mathematical
inequalities.

12/24/2022 Fuad.M 2022 2


Intro cont…

From the above definitions, it is clear that:


LP is an optimization technique
It deals with the problem of allocation of
scarce sources
It generates solutions based on the feature
and characteristics of the actual problem or
situation.

12/24/2022 Fuad.M 2022 3


Intro cont…

Product-mix problems Investment planning problems

LP has been highly


successful in solving
the following types
of problems :

Blending strategy formulations Marketing & Distribution


and management.

12/24/2022 Fuad.M 2022 4


Intro cont…

• The objective is always the same


All LPP • Presence of constraints which limit the
have the extent to which the objective can be
following pursued/achieved.
properties • Availability of alternatives
in common • The objectives and constraints can be
expressed in the form of linear relation.

12/24/2022 Fuad.M 2022 5


Basic Assumptions of LP
• Decision or Activity Variables & Their
Inter-Relationship
• Finite Objective Functions
• Limited Factors/Constraints
• Presence of Different Alternatives
Basic • Non-Negativity Restrictions
Assumptions • Linearity Criterion
• Additive
• Mutually Exclusive Criterion
• Divisibility
• Certainty
• Finiteness.

12/24/2022 Fuad.M 2022 6


Application Areas of Linear
Programming

Military Applications Portfolio Selection


Agriculture Profit Planning & Contract.
 Environmental Protection. Traveling Salesmen
Facilities Location Problem
Product-Mix Media Selection/Evaluation
Production Staffing
Mixing or Blending Job Analysis
Transportation & Trans- Wages and Salary
Shipment Administration.

12/24/2022 Fuad.M 2022 7


LPP Formulation

Steps in Formulating LP Model


Step I Identification of the Decision Variables
Step II Identification of the Constraints
Step III formulate the Objective Function
Step IV formulate the LP Problem

12/24/2022 Fuad.M 2022 8


Example 1
3F furniture Ltd. manufactures Two products, Tables & Chair. Both
the products have to be processed through Two Machines Ml & M2
the total Machine-hours Available are: 200 hours of M1 and 400
hours of M2 respectively. Time in hours required for producing a
chair and a table on both the machines is as follows:

Machine Table Chair

M1 7 4

M2 5 5

Profit from the Sale of table is Birr 40 and that of a chair is Birr 30.
Required: formulate the LP Problem (LPP)?
12/24/2022 Fuad.M 2022 9
Example 1
Step I Identification of the decision variables.
Let x1 = Number of tables produced and X2 = Number of Chairs produced
Step II List down all the constraints :
A. Total time on machine M1 cannot exceed 200 hour
∴ 7X1+4X2≤200 and

B. Total time on machine M2 cannot exceed 400 hour


Step III. The objective function
∴ for maximizing the profit is
5X1+5X2≤400
given by.
Minimize Z= 40X1+30X2
Presenting the problem as LPP
Minimize Z= 40X1+30X2
subject to: 7X1+4X2≤200
5X1+5X2≤400 X1&X2≥0
12/24/2022 Fuad.M 2022 10
Example 2
2. Suppose that a machine shop has two different types of machines;
machine 1 and machine 2, which can be used to make a single
product .These machine vary in the amount of product produced
per hour, in the amount of labor used and in the cost of operation.
Assume that at least a certain amount of product must be produced
and we would like to utilize at least the regular labor force. How
much should we utilize in each machine in order to utilize total
costs and still meets the requirement? The resource used, the cost
and the required hour is given in the following table.
Machine 1 (X) Machine 2 (Y) Min required hours
Production/hr 20 15 100
Labor/hr 2 3 15
Operation Cost Birr25 Birr30
12/24/2022 Fuad.M 2022 11
Example 3

Alpha Limited company produces & sells 2 different products


under the brand name black & white. The profit per unit on these
products is Birr 50 & Birr 40 respectively. Both black & white
employ the same manufacturing process which has a fixed total
capacity of 50,000 man-hour. As per the estimates of the
marketing research department of Alpha Limited, there is a market
demand for maximum 8,000 units of Black & 10,000 units of
white. Subject to the overall demand, the products can be sold in
any possible combination. If it takes 3 hours to produce one unit
of black & 2 hours to produce one unit of white. Formulate the
above problem as a linear programming model?

12/24/2022 Fuad.M 2022 12


Assignment 5 Marks

3. An agriculturalist has a 125 acre farm. He produce onion,


tomato and potato. What ever he rises is fully sold in the
market. He gets Birr 5 for onion per kg, Birr 4 for tomato per
kg and Birr 5 for potato per kg. The average per acre yield is
1500kg of onion, 1800kg of tomato and 1200kg of potato. To
produce each 100kg of onion and tomato and 80kg potato, a
sum of Birr 12.5 has to be used for fertilizer. Labor required
for each acre to rise the crop is 6 man days for onion and
potato each and 5 man-days for tomato. A total of 500 man-
days of labor at a rate of Birr 40 per man-day are available.
Formulate this as LP model to maximize the agriculturist’s
total profit.

12/24/2022 Fuad.M 2022 13


Method for solving LPP

There are two types of finding a


solution for Linear programming
problems.
• Graphic solution and
• Simplex solution

12/24/2022 Fuad.M 2022 14


Graphical Method of solving Linear
Programming Problems
The graphic solution procedure is one of the methods of
solving two variable linear programming problems.

Steps in graphic solution method


Step I Defining the problem
Step II Plot the constraints Graphically
Step III Locate the solution space: Solution space or the
feasible region is the graphical area which satisfies all the
constraints at the same time. Such a solution point (x, y)
always occurs at the corner Points of the feasible Region the
feasible region is determined as follows:

12/24/2022 Fuad.M 2022 15


Graphic solution cont…
1. For "greater than" & "greater than or equal to" constraints,
the feasible region or the solution space is the area that lays
above the constraint lines.
2. For" Less Then" &" Less than or equal to" constraint, the
feasible region or the solution space is the area that lays
below the constraint lines.
Step IV Selecting the graphic solution technique
There are two graphic techniques to find solution;
a. Corner Point Method and
b. Iso-profit (or Iso-cost) method may be used

12/24/2022 Fuad.M 2022 16


Corner Point Method to find Solution for
Graphics Method

Since the solution point (x, y) always occurs at the corner


point of the feasible or solution space, identify each of the
extreme points or corner points of the feasible region by the
method of simultaneous equations.
By putting the value of the corner point's co-ordinates [e.g. (2,
3)] into the objective function, calculate the profit (or the cost)
at each of the corner points.
In a Maximize problem, the optimal solution occurs at that
corner point which gives the highest profit. In a minimization
problem, the optimal solution occurs at that corner point which
gives the lowest profit.

12/24/2022 Fuad.M 2022 17


Graphic solution Example 1

XYZ Ltd. Co. Wishes to purchase a maximum of 3600 units of two


types of product, A & B are available in the market. Product A
occupies a space of 3 cubic feet & cost Birr 9 whereas B occupies a
space of 1 cubic feet & cost Birr 13 per unit.

The budgetary constraints of the company do not allow spending


more than Birr 39,000. The total availability of space in the company
is 6000 cubic feet.

Profit margin of both the product A & B is Birr 3 & Birr 4


respectively. Formulate the above problem as a linear programming
model and solve it by using graphical method. You are required to
ascertain the best possible combination of purchase of A & B so that
the total profits are maximized.
12/24/2022 Fuad.M 2022 18
Number of unites of B
Graphic solution EG. Cont…

6000 3X+Y≤6000 (Storage area constraint)

3600 X+Y≤3600(Maximum unites constraint)


B(1300,2100)
3000 A1
9X+13Y≤3900(Budgetary constraint)

Feasible
region Number of unites o A
o(0, 0) C X
12/24/2022 2000 3600
Fuad.M 2022 3900/9
At corner points (O, A, B, C), find the profit value from the objective
function. Those points which maximize the profit are the optimal
point.

Corner point Coordinates Objective function Value


O (0,0) Z=0+0 0

A (0,3000) Z=0+4x3000 12,000

B (1300,2100) Z=3x1300 + 4 x2100 12,300

C (2000,0) Z=3 x 2000 + 0 6000

12/24/2022 Fuad.M 2022 20


2. Suppose that a machine shop has two different types of machines;
machine 1 and machine 2, which can be used to make a single
product .These machine vary in the amount of product produced
per hour, in the amount of labor used and in the cost of operation.
Assume that at least a certain amount of product must be produced
and we would like to utilize at least the regular labor force. How
much should we utilize in each machine in order to utilize total
costs and still meets the requirement? The resource used, the cost
and the required hour is given in the following table.

Machine 1 Machine 2 Minimum required hours


(X) (Y)
Product produced/hr 20 15 100
Labor/hr 2 3 15
Operation Cost Birr25 Birr30
Fuad.M 2022
12/24/2022 21
20X+15Y≥100

Y
Y=0
A (0, 20/3) 2X1 + 3X2 ≥ 15

Feasible Region
5
B (2.5, 3.33)
X2 =0

X
5 C (7.5, 0)
12/24/2022 Fuad.M 2022 22
Minimize.Z  25 X 130 X 2

Corner point Coordinates Objective function Value


A (0,20/3) Z=0+20/3×30 200

B (2.5, 3.33) Z=2.5×25+3.33x30 162.5

C (7.5, 0) Z=7.5x25+0 187.5

12/24/2022 Fuad.M 2022 23


Special Cases in Graphics Methods

The following are the major special cases in graphics solution


a. Alternative Optima
b. Infeasible Solution
c. Unbounded solution

a. Alternative Optimal solution


When the objective function is parallel to a binding constraint; (a
constraint that is satisfied in the equality sense by the optimal
solution), the objective function will assume the same optimal
value at more than one solution point, for this reason they are
called alternative optima.

12/24/2022 Fuad.M 2022 24


12/24/2022 Fuad.M 2022 25
Example :
The information given below is for the products A and B.

Machine hours per week Maximum available


Department Product A Product B per week
Cutting 3 6 900
Assembly 1 1 200
Profit per unit Birr 8 Birr 16

Assume that the company has a marketing constraint on selling


products B and therefore it can sale a maximum of 125 units of this
product.
Required:
a. Formulate the LPP of this problem?
b. Find the optimal solution?
12/24/2022 Fuad.M 2022 26
The LPP Model of the problem is:

Max.Z  8 X 116 X 2
Subjectto :
3 X 16 X 2 900
X 1 X 2 200
X 2  125
X1, X 2  0

12/24/2022 Fuad.M 2022 27


X2

200)
(0, X 1 X 2 200
(0,150) X2=125 Marketing
C (50, 125)
equation
B (0, 125) D (100,100)

Cutting: 3X1+6X2=900
FR X1=0

A (0, 0) (200, 0) (300, 0)


X1

12/24/2022 Fuad.M 2022 28


Infeasible Solution

Sometimes possible that the constraints may be inconsistent so that there


is no feasible solution to the problem. Such a situation is called
infeasibility.
Example:
Maximize Z=20X1+30X2
Subject to:
2X1+X2< 40
4X1+X2< 60
X1 > 30 and X1, X2 > 0

12/24/2022 Fuad.M 2022 29


Note: -In the ff graph, there is no common
point in the shaded area.
X2
X1=0

(0, 60) X1=30


4X1+X2= 60

(0, 40)

2X1+X2= 40

X2=0
X1

(15, 0) (20, 0) (30, 0)

12/24/2022 Fuad.M 2022 30


Unbounded Solution

When the value of decision variables in LP is permitted to


increase infinitely without violating the feasibility condition, then
the solution is said to be unbounded
Example:
Use the graphical method to solve the following LPP.
1. Maximize Z=3X1+4X2
Subject to:
X1-X2<-1==> -X1+X2>1 since the quantity solution is positive
-X1+X2<0

12/24/2022 Fuad.M 2022 31


X2 X1-X2 =-1

X1+X2 =0

1 Unbounded Feasible
region
Feasible Region
X1

12/24/2022 Fuad.M 2022 32


Maximize Z=3X1+2X2
Subject to:
X1-X2<1
X1+X2≥3
X2

A Unbounded
(0, 3) Feasible Region X1-X2=1

B (2, 1)
X1+X2=3

X1

12/24/2022 Fuad.M 2022 33


Simplex Method

The Simplex method is an iterative or “step by step” method or


repetitive algebraic approach that moves automatically from one
basic feasible solution to another basic feasible solution
improving the situation each time until the optimal solution is
reached at.
The Simplex method starts with a corner that is in the solution
space or feasible region and moves to another corner, the solution
space improving the value of the objective function each time
until optimal solution is reached at the optimal corner.

12/24/2022 Fuad.M 2022 34


Standard forms of (LP) problems

1. All the constraints should be expressed as equations by adding


slack or surplus and/or artificial variables.
2. The right hand side of each constraint should be made non-
negative; if it is not, this should be done by multiplying both
side of the resulting constraint by -1.
3. The objective function should be of the maximization type.

12/24/2022 Fuad.M 2022 35


. .
. .
. .

The standard form of LP problem is


expressed as follow;
Optimize (Maximize or Minimize) Z=
Subject to the linear constraint:

And

12/24/2022 Fuad.M 2022 36


Remarks; three types of additional variables, namely
•Slack variable (s)
•Surplus variable (-s), and
•Artificial variable (A)
Are added in the given LP problem to convert it in to the standard
form for the following reasons:
•These variables allow as converting inequalities in to equalities,
there by converting the LP problem in to a form that is amenable to
algebraic solution.
•These variables permit as to make a more comprehensive economic
interpretation of a final solution.
•Help us to get an initial feasible solution presented by the column of
the identity matrix.

12/24/2022 Fuad.M 2022 37


The summery of the extra variable to be added in the given LP
problem to convert it in to standard form is given in the
following table.
Types of Extra variable Coefficient of extra Presence of extra
constraint needed variables In the variable in initial
objective function solution mix
Max Z Min Z

0 0 Yes
Less than or A slack variable is
added
equal to ≤
0 0 No
Greater than A surplus variable
-M +M Yes
is subtracted and
or equal to (≥)
artificial variable is
added
Fuad.M 2022
12/24/2022
Only an artificial -M +M Yes 38
Equal to (=)
Simplex cont…
A slack variable represents unused resource, either in the form of
time on a machine, labor hour, money, warehouse space or any
number of such resources in various business problems.
Since variable yields no profit, therefore such variable are
added to the original objective function with zero coefficients.
A surplus variable represents amount by which solution values
exceed a resource. These variables are also called negative slack
variables.
Surplus variables carry a zero coefficient in the objective
function.

12/24/2022 Fuad.M 2022 39


Simplex cont…
The major steps and activities to solve LP model by using simplex
method
If we get more variables & less equation, we can set extra
variables equal to zero, to obtain a system of equal variables &
equal equations. Such solution is called basic solution.
The variables having positive values in a basic feasible solution
are called basic variable while the variables which are set equal
to zero, so as to define a corner point are called non-basic
variables.
Slack variables are the fictitious variables which indicate how
much of a particular resource remains unused in any solution
Column denotes the unit contribution margin.

12/24/2022 Fuad.M 2022 40


Row denotes the contribution margin lost if one unit is brought


into the solution

Row denotes the Net Potential contribution or the Net unit


margin potential, per unit.

12/24/2022 Fuad.M 2022 41


Simplex algorism (Maximization Case)

A Standard Maximization Problem is the one that


satisfies the following four conditions
1. The Objective function is to be maximized.
2. All the inequalities are of ≤ type.
3. All right hand constants are non-negative.
4. All variables are non-negative.

12/24/2022 Fuad.M 2022 42


The rules used under simplex method, for solving a
linear programming problem are as follows:-
1. Convert the given problem into Standard maximization Problem
2. Convert all ≤ constraints to equalities by adding a different slack
variable for each one of them.
3. Construct the initial simplex tableau with all slack variables in the
Basic Variables. The last row in the table contains the coefficient of
the objective function (row).
4. Test for optimality.
• If all the right hand side values are non-negative (called the
feasibility condition).
• If all elements of the last row, that is rows are non-positive
(called, the optimality condition). The current tableau contains
an optimal solution. Otherwise, go to the next step.

12/24/2022 Fuad.M 2022 43


Example: 1
Solve the problem using the simplex approach
Max.Z=300x1 +250x2
Subject to:
2x1 + x2 < 40 (Labor )
x1+3x2 < 45 (Machine)
x1 < 12 (Marketing)
Standard form
x1, x2 > 0 Max.Z=300x1 +250x2 + 0 s1 +0 s2+ 0 s3
St: 2 x1+x2 + s1 +0 s2+ 0 s3= 40
x1+3x2 +0s1 + s2+ 0 s3= 45
x1 + 0s1 + 0s2+ s3= 12
x 1 , x 2 , s 1 , s2 , s 3 > 0

12/24/2022 Fuad.M 2022 44


The initial FS table format

12/24/2022 Fuad.M 2022 45


The rules used under simplex method, for solving a linear
programming problem are as follows:-
1. Convert the given problem into Standard maximization Problem
2. Convert all ≤ constraints to equalities by adding a different slack
variable for each one of them.
3. Construct the initial simplex tableau with all slack variables in
the Basic Variables. The last row in the table contains the
coefficient of the objective function (row).
4. Determine whether the current tableau is optimal:
• If all the right hand side values are non-negative (called the
feasibility condition).
• If all elements of the last row non-positive (called, the optimality
condition).
12/24/2022 Fuad.M 46
5. If the current BASIC VRIABLES is not optimal,
determine, which non basic variable should become a
basic variable and, which basic variable should become
a non basic variable.
To find the new BASIC VRIABLES with the better
objective function value, perform the following
tasks:
Identify the entering variable: The entering
variable is the one with the largest positive value in
the Cj-Zj raw (In case of a tie, select the variable that
corresponds to the left most of the columns).
12/24/2022 Fuad.M 47
5. If the current BASIC VRIABLES is not optimal, determine,
which non basic variable should become a basic variable and,
which basic variable should become a non basic variable.
To find the new BASIC VRIABLES with the better objective
function value, perform the following tasks:
Identify the outgoing variable: The outgoing variable is the
one with smallest non-negative RHS column ratio (to find the
column ratios, divide the RHS column by the corresponding
entering variable non zero/–Ve column elements, wherever
possible). In case of a tie select the variable that corresponds
to the upper most of the tied rows.
Replacement Ratio (RR) = Solution Quantity (Q)
Note: RR>0 Corresponding values in pivot column
12/24/2022 Fuad.M 48
Generate the new tableau
Pivot-column selection rule. The column, under
which the largest value of Cj-Zj row value located.
Pivot-row selection rule. Find the ratio of quantity to
the corresponding pivot-column coefficient. The pivot-
row selected is the variable having the least RHS ratio
The element that lays at the intersection of the pivot
column and pivot row is called Pivot Element

Remark: Rows having negative or zero coefficients


in the pivot-column are to be neglected.
12/24/2022 Fuad.M 49
Up-dating rows. Each is obtained as the sum of the
products of the column coefficients multiplied by the
corresponding coefficient in the jth column (i.e.) the Quantity
column). It is then subtracted from row values to get
values. This pivoting is to be repeated till no positive
coefficients exist in the row or the optimal solution is known.

12/24/2022 Fuad.M 2022 50


6.
Repeat step 3-5 till optimum basic feasible solution is
obtained.
Or: repeat step 3-5 till no positive value occurs in the
Cj - Zj row.
Note:
Divide each element of the pivot row by the pivot
element to find new values in the key or pivot row.
Perform row operations to make all other entries for the
pivot column equal to zero.

12/24/2022 Fuad.M 51
Simplex algorism (Maximization P)

A Standard Maximization Problem is the one that


satisfies the following four conditions
1. The Objective function is to be maximized.
2. All the inequalities are of ≤ type.
3. All right hand constants are non-negative.
4. All variables are non-negative.

12/24/2022 Fuad.M 2022 52


2nd simplex tableau
Cj   300 250 0 0 0  
  BV X1 X2 S1 S2 S3 RHS
0 1 1 0 -2 R’1=R1-2R2
0 S1
16

0 S2 0 3 0 1 -1 R’2=R2-R3
33

300 X1 1 0 0 0 1 R’3=R3
12
  Zj 300 0 0 0 300 3600
  Cj - Zj 0 250 0 0 -300  

12/24/2022 Fuad.M 2022 53


3rd simplex tableau
Cj   300 250 0 0 0  
  SV X1 X2 S1 S2 S3 Q
0 0 1 -1/3 -5/3
0 S1 5

250 X2 0 1 0 1/3 -1/3 11


300 X1 1 0 0 0 1 12
  Zj 300 250 0 250/3 650/3 6350
  C j - Zj 0 0 0 -250/3 - 650/3  
Since all the Cj - Zj < 0 optimal solution is reached at.
Therefore, X1=12, X2=11, S1=5 and Max Z=6350

12/24/2022 Fuad.M 2022 54


Example 1.
Maximize Z = 40X1+35X2
Subject to:
2X1+3X2≤60 raw material constraint
4X1+3X2≤96 Labor hour constraint
X1&X2≥0
Solution:
Step one standardization of the problem

Maximize Z = 40X1+35X2+0S1+0S2
Subject to:
2X1+3X2+S1=60 raw material constraint
4X1+3X2+S2=96 Labor hour constraint
X1,X2,S1,S2≥0

12/24/2022 Fuad.M 2022 55


Step two obtaining the initial tableau and solution
Contribution margin
Cj 40 35 0 0 RHSV
BV
X1 X2 S1 S2 bi
Constant
variables
Basic

S1 0 2 3 1 0 60 values
S2 0 4 3 0 1 96
Zj 0 0 0 0
Cj-Zj 40 35 0 0
Test for optimality right hand side should be +Ve and the Cj-Zj
row should be –Ve. So the solution is not optimal.

12/24/2022 Fuad.M 2022 56


Step three identify the entering and leaving variable

Cj 40 35 0 0 RH Bi/EV
BV SV
X1 X2 S1 S2 bi

S1 0 2 3 1 0 60 30 Leaving
S2 0 4* 3 0 1 96 24 variable
Zj 0 0 0 0
Cj-Zj 40 35 0 0

4* is pivot point
Entering
variable (EV)

12/24/2022 Fuad.M 2022 57


Simplex table two

Cj 40 35 0 0 RH
BV SV
X1 X2 S1 S2 bi

S1 0 0 3/2 1 -1/2 12
X1 40 1 3/4 0 1/4 24
Zj 40 30 0 10 960
Cj-Zj 0 5 0 -10
The solution is not optimal because we have +ve value in Cj-Zj row

12/24/2022 Fuad.M 2022 58


Cj 40 35 0 0 RH Bi/EV
BV SV
X1 X2 S1 S2 bi
Leaving
S1 0 0 3/2* 1 -1/2 12 8 variable
X1 40 1 3/4 0 1/4 24 32
Zj 40 30 0 10 960
Cj-Zj 0 5 0 -10
3/2* pivot element

Entering
variable (EV)

12/24/2022 Fuad.M 2022 59


Simplex table 3
Cj 40 35 0 0 RHS
BV V
X1 X2 S1 S2 bi

X2 35 0 1 2/3 -1/3 8
X1 40 1 0 -1/2 1/2 18
Zj 40 35 10/3 25/3 1000
Cj-Zj 0 0 -10/3 -25/3
The solution is optimal because all the values of Cj-Zj row
is negative and zero and all the right hand side values are
positive

12/24/2022 Fuad.M 2022 60

You might also like