You are on page 1of 45

OPERATIONS RESEARCH

Linear Programming

Dr. Arunkumar O N,
Assistant Professor,
Symbiosis Institute of Operations Management,
Constituent of Symbiosis International (Deemed University), Pune.
Email: arunon27@gmail.com
Session 4

2
Simplex Method

3
 Linear Programming:
 Simplex Method

4
Simplex Method
Most real-life problems when formulated as an LP model
have more than two variables and therefore need a more
efficient method to suggest an optimal solution for such
problems.
A procedure called, simplex method is used for solving
such problems.
This method was developed by G B Dantzig in 1947.
Simplex method examines corner points of the feasible
region, using matrix row operations, until an optimal
solution is found.

5
Standard Form of an LP Problem
The standard form of the LP problem should have the
following characteristics:
 All the constraints should be expressed as equations by
adding slack or surplus and / or artificial variables.
 The right hand side of each constraint should be made
non-negative (if not). This is done by multiplying both
sides of the resulting constraint by -1.
 The objective function should be of maximization type.

6
Standard Form of an LP Problem
 The standard form of the LP problem expressed as:
Optimize (Max or Min) Z = +++…++0+ 0+…+
Subjected to linear constraints
+++…++=
+++…++=
.
.
.
+++…++=
and , ,…, , ≥ 0.

7
Standard Form of an LP Problem
 This standard form of the LP problem can also be
expressed in the compact form as follows:
Objective function
Optimize (Max or Min) Z = +
Subject to the linear constraints
+ = ; i = 1,2,…,m (constraints)
and , ≥ 0, for all i and j (Non-negativity conditions)

8
 In matrix notations the standard form is expressed as:
Optimize (Max or Min) Z = cx+0s
Subject to linear constraints
Ax + s = b, and x,s ≥ 0
Where
c = (, …, ) is the row vector
x=
b=
s=
A is the mxn matrix of coefficients, of variables in the
constraints

9
Remarks: Any LPP (max or mini) may have
 No feasible solution
A unique optimum feasible solution
More than one feasible optimum solution
A feasible solution for which the objective function is
unbounded
 Any minimization LP problem can be converted into an
equivalent maximization problem by changing the sign of ’s
in the objective function. That is,
Minimize = maximize
 Any constraint expressed by equality (=) sign may be
replaced by two weak inequalities. For Example,
+++…++= is equivalent to
+++…++≤ and
10 +++…++≥
Remarks: Any LPP (max or mini) may have
 Three types of additional variables, namely
 Slack variables (s)
 Surplus variables (-s) and
 Artificial variables (A)
 are added in the given LP problem to convert it into
standard form for the following reasons:
a) These variables allow us to convert inequalities into
equalities, thereby converting the given LP problem into
its standard form. Such form will help in getting solution
of the LP problem
b) These variables helps decision-makers to draw economic
interpretation from the final solution.
c) These variables are used to get an initial feasible solution
represented by the columns of the identity matrix.
11
Remarks:
The summary of additional variables to be added in the
given LP problem in order to convert it into standard
form is given in Table:
Coefficient of Additional
Variables in the
Objective Function Presence of
Types of Extra Variable Additional
Constraint Needed Variables in the
Max Z Min Z solution

Less than or A slack variable is


0 0 Yes
Equal to (≤) added
A surplus variable 0 0 No
Greater than is subtracted, and an
or Equal to artificial variable is
added -M +M Yes
Only an artificial
Equal to (=) -M +M Yes
variable is added
12
Remarks:
Slack Variable:
A slack variable represents an unused resource, either in the
form of time an a machine, labour hours, money, warehouse
space, etc.
Since these variables don’t yield any profit, therefore such
variables are added to the objective function with zero
coefficients.
Surplus Variable:
A surplus variable represents the amount by which solution
values exceed a resource.
These variables are also called negative slack variables.
Surplus variables, like slack variables carry a zero
coefficient in the objective function.

13
Definitions
Basic solution
Basic Feasible solution
Degenerate solution
Cost vector

14
Simplex Algorithm (Maximization Case)
Formulation of the mathematical model
Setup the initial solution
Test for optimality
Select the variable to enter the basis
Test for feasibility
Finding the new solution
Repeat the procedure

15
Problem 1 ( Hira and Gupta page 166)
Maximize Z = 4X1 + 3X2 + 6X3
Subject to
2X1+3X2+2X3 ≤ 440
4X1+3X3 ≤ 470
2X1+5X2 ≤ 430
X1,X2, X3 ≥ 0

16
Problem 1
Solution
Step1 :
Express the problem in standard form
Maximize Z = 4X1 + 3X2 + 6X3 + 0 S1 + 0S2 + 0S3
Subject to
2X1+3X2+2X3+S1 = 440
4X1+3X3 +S2= 470
2X1+5X2 + S3 = 430
X1,X2, X3 ≥ 0

17
Step2 :
Let decision variables X1= X2 = X3 = 0. Substitute
these values in the constraints, we get the following
i.b.f.s.:
S1 = 440, S2 =479, S3 = 430, Z= 0

4 3 6 0 0 0
Basis
Basis bb 𝜃
𝜃
00 22 33 22 11 00 00 440
440 220
220
00 44 00 33 00 11 00 470
470 470/3
470/3
(156.67)
(156.67)
0 2 5 0 0 0 1 430 ∞
0 2 5 0 0 0 1 430 ∞
0 0 0 0 0 0 0
0 0 0 0 0 0 0
- 4 3 6 0 0 0 ibfs
4 3 6 0 0 0 ibfs

18
4 3 6 0 0 0
Basis
Basis bb 𝜃
𝜃
0
0 -2/3
-2/3 33 00 11 -2/3
-2/3 00 440
440 –– [(470*2)/3]
[(470*2)/3] 380/9
380/9
=
= 380/3
380/3
6 4/3 0 1 0 1/3 0 470/3 ∞
6 4/3 0 1 0 1/3 0 470/3 ∞
0 2 5 0 0 0 1 430 86
0 2 5 0 0 0 1 430 86
8 0 6 0 2 0 940
8 0 6 0 2 0 940
- -4 3 0 0 -2 Second feasible
-4 3 0 0 -2 Second
solutionfeasible
solution

After one more iteration, you will get


The optimal solution is
X1 = 0, X2 = 380/9, X3 = 470/3 Zmax = 3200/3.
S1 =0, S2 =0, S3 =1970 / 9
19
Problem 2 ( J K Sharma page 105)
Use the simplex method to solve the following LP
problem
Maximize Z = 3X1 + 5X2 + 4X3
Subject to the constraints
 2x1+3x2 ≤ 8
2x2+5x3 ≤ 10
3x1+2x2+4x3 ≤ 15
X1, x2, x3 ≥ 0

X1 = 89/41, X2 = 50/41, X3 =62/41 and Z = 765/41

20
Problem – Example 4.3 ( J K Sharma page 110)
A pharmaceutical company has 100 kg of A 180 kg of B
and 120 kg of C ingredients available per month.
The company can use these materials to make three
basic pharmaceutical products namely 5-10-5, 5-5-10
and 20-5-10, where the numbers in each case represent
the percentage of weight of A, B and C, respectively, in
each of the products.
The cost of these raw materials is as follows:

Ingredient Cost per kg (Rs)


A 80
B 20
C 50
Inert ingredients 20
21
Problem – Example 4.3 …
The selling prices of these products are Rs. 40.5, Rs.
43 and Rs. 45 per kg, respectively.
There is a capacity restriction of the company for
product 5-10-5, because of which the company cannot
produce more than 30kg per month.
Determine how much of each of the products the
company should produce in order to maximize its
monthly profit.

22
Problem – Example 4.3 …
 Solution
Let the , and be the three products to be manufactures.
The data of the problem can then be summarized as
follows:

Product Ingredients
Product Inert
A B C
5% 10% 5% 80%
5% 5% 10% 80%
20% 5% 10% 65%
Cost per kg (Rs.) 80 20 50 20

23
Problem – Example 4.3 …
 Solution…
Cost of = 5% * 80 + 10% * 20 + 5% * 50 + 80% *
20
= 4+2+2.5+16 = Rs. 24.5 per kg
Cost of = 5% * 80 + 5% * 20 + 10% * 50 + 80% *
20
= 4+1+5+16 = Rs. 26 per kg
Cost of = 20% * 80 + 5% * 20 + 10% * 50 + 65% *
20
= 16+1+5+13 = Rs. 35 per kg
Let , , be the quantity (in kg) of , and , respectively
to be manufactured.
24
 The LP problem can then be formulated as
Maximize (net profit) Z = (Selling Price – Cost
price) * (Quantity of product) = (40.50 -24.50) +
(43-26) + (45-35) = 16 + 17 + 10
Subject to the constraints
+ + ≤ 100 or ++4 ≤ 2000
+ + ≤ 180 or ++ ≤ 3600
+ + ≤ 120 or +2+2 ≤ 2400
≤ 30
and , ≥ 0.

25
Simplex – Minimization Case
 In certain cases, it is difficult to obtain an initial basic
feasible solution of the given LP problem.
Such cases arise
 When constraint are of the ≤ type,
≤, ≥0
and value of few right-hand side constants is negative [i.e. < 0)
After adding the non-negative slack variable ( = 1,2,…,m),
the initial solution so obtained will be = - for a particular
resource,.
This solution is not feasible because it does not satisfy non-
negativity conditions of slack variables (i.e. ≥ 0)

26
Simplex – Minimization Case
 When
   the constraints are of the ≥ type,
≥, ≥0
After adding surplus (negative slack) variable , the initial
solution so obtained will be = or
= , ≥ 0, ≥ 0
This solution is not feasible because it does not satisfy
non-negativity conditions of surplus variables (i.e. ≥ 0).
In such a case, artificial variable ( = 1,2,…,m) are added
to get an initial basic feasible solution.

27
 The resulting system of equations then becomes:
=
, ≥ 0, = 1,2,…., m
There are m simultaneous equations with (n+m+m)
variables (n decision variables, m artificial variables and
m surplus variables).
An initial basic feasible solution of LP problem with
such constraints can be obtained by equating (n+2m-m)
= (n+m) variables equal to zero.
Thus the new solution to the given LP problem is:
= ( = 1,2,…., m), which is not the solution to the original
system of equations because the two systems of equations are
not equivalent.
28
Thus, to get back to the original problem, artificial
variables must be removed from the optimal solution.
There are two methods for removing artificial
variables from the solution.
Two-phase method
Big- M Method or method of penalties
The simplex method, both for the minimization and
the maximization LP problem, may be summarized
through a flow chart shown in figure.

29
30
Remark
Artificial variables have no meaning in a physical sense
and are only used as a tool for generating an initial
solution to an LP problem.
Before the optimal solution is reached, all artificial
variables must be dropped out from the solution mix.
This is done by assigning appropriate coefficients to
these variables in the objective function.
These variables are added to those constraints with
equality (=) and greater than or equal to (≥) sign.

31
Two phase method
In the first phase of this method, the sum of the
artificial variables is minimized subject to the given
constraints in order to get a basic feasible solution of
the LP problem.
The second phase minimizes the original objective
function starting with the basic feasible solution
obtained at the end of the first phase.
Since the solution of the LP problem is completed in
two phases, this method is called the two-phase
method.

32
Advantages of the Method
No assumptions on the original system of constrains
are made, i.e. the system may be redundant,
inconsistent or not solvable in non-negative numbers.
It is easy to obtain an initial basic feasible solution for
phase 1
The basic feasible solution (if exists) obtained at the
end of phase 1 is used as initial solution for phase 2.

33
Steps of the Algorithm: Two Phase Method
Phase
   1
 Step 1:
 (a): If all the constraints in the given LP problem are ‘less than
or equal to’ (≤) type, then phase 2 can be directly used to solve
the problem. Otherwise, the necessary number of surplus and
artificial variables are added to convert constraints into
equality constraints.
 (b) If the given LP problem is of minimization, then convert it
to the maximization type by the usual method.
 Step 2:
 Assign zero coefficient to each of the decision variables () and
to the surplus variables; and assign -1 coefficient to each of the
artificial variables.
34
 This yields the following auxiliary LP problem.
 Maximize
  =
 Subject to the constraints
= , = 1,2,…,m
and , , ≥ 0
Step 3:
 Apply the simplex algorithm to solve this auxiliary LP problem.
The following three cases may arise at optimality.
(a) Max = 0 and at least one artificial variable is present in the
basis with positive value. This means that no feasible solution
exists for the original LP problem
(b) Max = 0 and no artificial variable is present in the basis. This
means that only decision variables (’s) are present in the basis
and hence proceed to Phase 2 to obtain an optimal basic
feasible solution on the original LP problem

35
Step
   3:
(c) Max = 0 and at least one artificial variable is present in the
basis at zero value. This means that a feasible solution to the
auxiliary LP problem is also a feasible solution to the original LP
problem. In order to arrive at the basic feasible solution, proceed
directly to Phase 2 or else eliminate the artificial basic variable
and then proceed to phase 2.
Remark:
Once the artificial variable has left the basis, it has served its
purpose and can, therefore, be removed from the simplex table.
An artificial variable is never considered for re-entry into the
basis.

36
Phase 2
Assign actual coefficients to the variables in the
objective function and zero coefficient to the artificial
variable which appear at zero value in the basis at the
end of Phase 1.
The last simplex table of Phase 1 can be used as the
initial simplex table for Phase 2.
Then apply the usual simplex algorithm to the
modified simplex table in order to get the optimal
solution to the original problem.
Artificial variables that do not appear in the basis may
be removed.
37
Example 4.4( J K Sharma page 115)
Minimize Z = X1 + X2
Subject to the constraints
2x1+x2≥ 4
X1+7x2≥7
X1, x2 ≥ 0

38
Solution
 Converting the given LP problem objective function
into the maximization form and then adding surplus
variables S1 and S2 and artificial variables A1 and A2
in the constraints, the problem becomes:
Maximize =
Subject to the constraints
2+- +=4
+ 7- + = 7
,,,,, ≥0
Where =

39
 Phase 1
This phase starts by considering the following
auxiliary LP problem:
Maximize =
Subject to the constraints
2+- +=4
+ 7- + = 7
, , , , , ≥ 0

40
0 0 0 0 -1 -1
Basis b 𝜃
-1 2 1 -1 0 1 0 4 4
  
-1 1 7 0 -1 0 1 7 1
-3 -8 1 1 -1 -1
- 3 8 -1 -1 0 0

0 0 0 0 -1 -1
Basis b 𝜃
-1 13/7 0 -1 1/7 1 -1/7 3 21
0 1/7 1 0 -1/7 0 1/7 1 4
-13/7 0 1 -1/7 -1 1/7
- 13/7 0 -1 1/7 0 -8/7

To remove from the solution, we enter S2 in the basis


41 by row operations.
 It may be noted that, if instead of s2, variable X1 is chosen
to entered in to the basis, it will lead to infeasible solution.

0 0 0 0 -1 -1
Basis b 𝜃
0 13 0 -7 1 7 -1/7 21
0 2 1 -1 0 1 0 4
0 0 0 0 0 0 0
- 0 0 0 0 -1 -1
Since all - ≤ 0correspond to non basic variables, the
optimal solution: = 0, 4, = 0, = 21, = 0, = 0 with = 0 is
arrived at.
So, go to Phase 2 to get an optimal solution to our original
LP problem.
42
Phase 2
-1 -1 0 0
Basis b 𝜃
0 13 0 -7 1 21 21/13
-1 2 1 -1 0 4 4/2
-2 -1 1 0
- 1 0 -1 0

-1 -1 0 0
Basis b 𝜃
-1 1 0 -7/13 1/13 21/13
-1 0 1 1/13 -2/13 10/13
-1 -1 6/13 1/13
- 0 0 -6/13 -1/13

43
 = 21/13, 10/13, Max = -31/13
Min = 31/13

44
Thank You

45

You might also like