Sie sind auf Seite 1von 56

LPP Solution using Simplex Method

1
Simplex Method
1. Linear programming can handle problems involving only two decision variables.

2. Simplex method provides an efficient technique which can be applied for solving
LPPs of any magnitude - involving two or more decision variables

3. In this technique the objective function is used to control the development of each
feasible solution to the problem.

4. If an optimal solution to the problem exists, it is located at the corner points of the
feasible region determined by the constraints of the system.

5. Simplex method selects optimal solution from among the set of feasible solutions to
the problem by iterative search.

6. By using simplex technique, we can consider a minimum number of feasible


solutions to obtain an optimal one.
Simplex Method

Ø There are two conditions to be satisfied in order to apply simplex method to a linear
programming problem.
1. The R.H.S of each of the constraints bi should be non –negative.
• If an LLP has a constraint for which a negative resource value is given, it should be,
in first step, converted to positive value.

Example; 18X1- 3X2 ³ - 6


= - 8X1 + 3X2 £ 6 ( note : direction of in equality changes in the process)

2. Each of the decision variables of the problem should be non negative.


unrestricted in sign
Z = 5X1 + 7X2 - 2X3
2X1+ 5X2+3X3 £ 80
5X1+ 2X2 - 2X3 £ 30
X2 + 6X3 £ 42
X1, X2 ³ 0 and X3 unrestricted in sign
unrestricted in sign

Since X3 is unrestricted in sign, we can represent it by a difference of two non negative


variables,

say X4 and X5. Substituting X3 = X4 - X5 in the equation

Z = 5X1+ 7X2 – 2X4 + 2X5 Z = 5X1 + 7X2 - 2X3


2X1+ 5X2 + 3X4 - 3X5 £ 80
5X1+ 2X2 – 2X4 + 2X5 £ 30 2X1+ 5X2+3X3 £ 80
X2 + 6X4 - 6X5 £ 42 5X1+ 2X2 - 2X3 £ 30
X2 + 6X3 £ 42
X1, X2 ³ 0 and X3 unrestricted in sign
X1, X2, X4, X5 ³ 0

After the solution is obtained, we shall substitute the difference of the values of X4, and
X5 in place of X3
Example 1- Solve the following LP problem using Simplex method
Maximize, Z = 12X1 + 16X2
Subject to
10X1 + 20X2 £ 120
8X1 + 8X2 £ 80
X1 ³ 0, X1 ³ 0

Z = 12X1 + 16X2
10X1 + 20X2 + S1 = 120
8X1 + 8X2 + S2 = 80
Z = 12X1 + 16X2 + 0S1 + 0S2
X1, X2, S1, S2 ³ 0

Note : S1 and S2 are called Slack variables, it can take any slack between the left and right
hand side inequalities upon converting into equal)
Initial Simplex tableau

Cbi Cj Solution Ratio

Basic variables

Zj

Cj - Zj

Cj = Coefficient of objective function


Note: Cbi = Coefficient of basic variables
ZJ = (sum of cost of basic variables multiplied by coefficients of constraint variables)
Initial Simplex tableau 10X1 + 20X2 + S1 = 120 ZJ =

objective function, Z = 12X1 + 16X2 + 0S1 + 0S2 8X1 + 8X2 + S2 = 80

Cbi Cj 12 16 0 0 Solution Ratio

Basic variables
X1 X2 S1 S2

0 S1 10 20 1 0 120

0 S2 8 8 0 1 80

Zj

Cj - Zj

Cj = Coefficient of objective function


Cbi = Coefficient of basic variables The cost of slack variables S1 and S2 are zero
Next find the values of Zj
Look for optimality condition
Cbi Cj 12 16 0 0 Solution Ratio

Basic variables
X1 X2 S1 S2
(BV)

0 S1 10 20 1 0 120

0 S2 8 8 0 1 80

Zj 0 0 0 0 0

Cj - Zj 12 16 0 0

For all maximization problems Cj – Zj should be £ 0


Look for optimality condition

For all maximization problems Cj – Zj should be £ 0

For all minimization problems Cj – Zj should be ³ 0

Since Cj – Zj are 12 and 16 respectively which are more than zero and positive
Solution is not optimal

Next select the maximum value of Cj – Zj, i.e 16 (this is called key column)

Then calculate the ratio i.e 120/20 = 6 (dividing the solution by bi value of this column)
similarly 80/8 =10

In order to find the key row, select the column of least ratio, i.e 6
Cbi Cj 12 16 0 0 Solution Ratio

Basic variables X1 X2 S1 S1
(BV)

0 S1 10 1 0 120

120
10
20 120/20 = 6

0
0 S2 8 8 0 1 80 80/8 = 10

Zj
0 0 0 0 0

Cj - Zj 0 0
12 16

Next select the maximum value of Cj – Zj, i.e 16 (this column is called key column)
Then calculate the ratio i.e 120/20 = 6
similarly 80/8 =10
In order to find the key row, select the column of least ratio, i.e 6
entering variable Key element

Cbi Cj 12 16 0 0 Solution Ratio

Basic variables X1 X2 S1 S1
(BV)

0 S1 10 1 0 120

120
10
20 120/20 = 6

0
0 S2 8 8 0 1 80 80/8 = 10

Zj
0 0 0 0 0

Cj - Zj 0 0
12 16

Key column
leaving variable Key row
Entering variable
1St Iteration process

CBj Cj 12 16 0 0 Solution Ratio

Basic variables X1 X2 S1 S2
(BV)

S1
0 leaving variable
S2
0

Zj

Cj - Zj

Cj = Coefficient of objective function


Replace S1 with X2
Cbj = Coefficient of basic variables
1St Iteration process

CBj Cj 12 16 0 0 Solution Ratio

Basic variables X1 X2 S1 S2
(BV)

X2 10/20 20/20 1/20 0/20 120/20


16

S2
0

Zj

Cj - Zj

for the first row, divide the old coefficients of basic vales of variables with the key element
1St Iteration process

CBj Cj 12 16 0 0 Solution Ratio

Basic variables X1 X2 S1 S2
(BV)

X2 1/20 1 1/20 0 6
16

S2
0

Zj

Cj - Zj

for the first row, divide the old coefficients of basic vales of variables with the key element
For the values of the second row use the following formula
Cbi Cj 12 16 0 0 Solution Ratio

Basic variables X1 X2 S1 S1
(BV)

0 S1 10 1 0 120

120
10
20 120/20 = 6

0
0 S2 8 8 0 1 80 80/8 = 10

Zj
0 0 0 0 0

Cj - Zj 0 0
12 16
1St Iteration

Cbi Cj 12 16 0 0 Solution Ratio

Basic variables
X1 X2 S1 S2

16 X2 1/2 1 1/20 0 6

0 S2 4 0 - 2/5 1 32

Zj

Cj - Zj
Find Zj Value

(16 x 1/2) + (0 x 4) = 8

(16 x 1) + (0 x 0) = 16

(16 x 1/20) + (0 x – 2/5) = 4/5

(16 x 0) + (0 x 1) = 0
(16 x 6) + (0 x 32) = 96
Next select the maximum value of Cj – Zj, i.e 4 (this is called key column)
Cbi Cj 12 16 0 0 Solution Ratio

Basic variables X1 X2 S1 S2

16 X2 1/2 1 1/20 0 6

0 S2 4 0 - 2/5 1 32

Zj 8 16 4/5 0 96

Cj - Zj 4 0 - 4/5 0

Since Cj – Zj are 4,0. – 4/5 and 0, respectively, 4 is more than zero and positive.
Therefore, Solution is not optimal
For all maximization problems Cj – Zj should be £ 0
Next select the maximum value of Cj – Zj, i.e 4 (this is called key column)
2nd Iteration

Cbi Cj 12 16 0 0 Solution Ratio

Basic variables X1 X2 S1 S2

16 X2 1/2 1 1/20 0 6 12
1/2

0 S2 44 0 - 2/5 1 32 8

Zj 8 16 4/5 0

Cj - Zj 4 0 - 4/5 0

In order to find the key row, select the column of least ratio, i.e 8
2nd Iteration entering variable

CBj Cj 12 16 0 0 Solution Ratio

Basic variables
X1 X2 S1 S2
(BV)

16 X2 ½1/2 1 1/20 0 6 /1/2 12

0 S2 44 00 - 2/5
- 2/5 11 32
32/4 8

32
Zj 8 16 4/5 0

Cj - Zj 4 0 - 4/5 0

leaving variable
Cbi Cj 12 16 0 0 Solution Ratio

Basic variables X1 X2 S1 S2

16 X2

12 X1 4/4 0/4 - 2/5/4 0/4 32/4

Zj

Cj - Zj

in order to find new variables, divide the row with key element 4
CBj Cj 12 16 0 0 Solution Ratio

Basic variables
X1 X2 S1 S2
(BV)

16 X2

12 X1 1 0 - 1/10 1/4 8

Zj

Cj - Zj
CBj Cj 12 16 0 0 Solution Ratio

Basic variables
X1 X2 S1 S2
(BV)

16 X2 0 1 1/10 - 1/8 2

12 X1 1 0 - 1/10 1/4 8

Zj

Cj - Zj
Find Zj Value

(16 x 0) + (12 x ) = 12

(16 x 1) + (12 x 0) = 16

(16 x 1/10) + (12 x – 1/10) = (16/10 – 12/10) = 4/10 = 2/5

(16 x -1/8) + (12 x 1/4) = (- 2 + 3) =1

(16 x 2) + (12 x 8) =128


2nd Iteration

CBj Cj 12 16 0 0 Solution Ratio

Basic variables X1 X2 S1 S2
(BV)

16 X2 0 1 1/10 - 1/8 2

12 X1 1 0 - 1/10 1/4 8

Zj 12 16 2/5 1 128

Cj - Zj 0 0 - 2/5 -1

X1 = 2, X2 = 8, Z = 128
Optimal solution is

X1 = 12

X2 = 16
Z = 128
Example 2
A manufacturer of wooden articles produces tables and chair which require two types of
inputs, i.e. wood and labor,
Each table requires 2 units of wood and 4 unit labor
Each chair requires 3 units of wood and 3 units of labor
Profit from each table is Rs 40 and profit from each chair is Rs 35
Total available resources for manufacturing tables and chair are 60 units of wood and 96
units of labor.
The manufacturer wants to maximize his profit by distributing his resources for each table
and chair.
Formulate the problem mathematically and solve using simplex method
Example – 2, Interpretation of the vales in the problem and solution
Let the tables be X1 and chairs be X2

maximize profit , Z = 40X1 + 35X2

Rs. 40 profit per table Rs. 35 profit per table

subject to raw material constraint 2X1 + 3X2 £ 60 Total wood available is 60 units

2 units of wood is required per table 3 units of wood is required per table

X1, X2 ≥ 0
Labour hour constraint 4X1 + 3X2 £ 96 Total labour available is 96 hours
X1 table and X2 chairs are
4 units of labour is required per table 3 units of labour is required per table not negative
Interpretation of elements in Simplex tableau

Let S1 be slack variable for wood and S2 be slack variable for labour hours

Z = 40X1+35X2+0S1+0S2 2X1 + 3X2 + S1 = 60

40 35 4X1 + 3X 0 2 + S02 = 96
Hrs of labour @ 0 Rs. per hour

kgs of wood @ 0 Rs per kg

Ø We are adding S1 and S2 objective function because, if wood or labour is left over, that
will be added to our objective of profit.

Ø Let us start with the assumption that, Zero cost for slack material and slack labour

Ø At the end of the solution if S1 or S2 leftover if any, so many units will be considered as
left over units of inputs.
Initial Simplex tableau

Cbi Cj Solution Ratio


Basic variables

Zj
Cj - Zj

Note: Cj = Coefficient of objective function


Cbi = Coefficient of basic variables
ZJ = (sum of cost of basic variables multiplied by coefficients of constraint variables)

Ø Zj represents the loss of profit that results from the addition of one unit of variable heading a particular
column. (wood and labour for table and wood and labour for chair)

Cj - Zj = Net profit (cost should be negative)


Interpretation of elements in Simplex tableau 2X1 + 3X2 + S1 = 60

Z = 40X1+35X2+0S1+0S2 4X1 + 3X2 + S2 = 96

Cbi Cj 40 35 0 0 Solution Ratio

Basic variables X1 X2 S1 S2

0 S1

0 S2

Zj

Cj - Zj
Interpretation of elements in Simplex tableau
2X1 + 3X2 + S1 = 60
Z = 40X1+35X2+0S1+0S2 4X1 + 3X2 + S2 = 96
Cbi Cj 40 35 0 0 Solution Ratio

Basic variables
X1 X2 S1 S2

0 S1 2 3 1 0 60

0 S2 4 3 0 1 96

Zj 0 0 0 0 0

Cj - Zj 40 35 0 0

Ø slack variables cost is zero


Cbi Cj 40 35 0 0 Solution Ratio

Basic variables X1 X2 S1 S2
(BV)

0 S1 2 3 1 0 60
2 60 /2= 30

S2 44 3 0 1 96
0 96/4 =24

96
3

1
Zj
0 0 0 0 0
Cj - Zj
40 35 0 0

We have more profit from table, we can use all the resources for making tables only. Therefore select table as
a product to work (i.e key column)
How many tables and chairs can be made from available wood and labour ?
we need 2 units of wood /table we have 60 units of wood i.e we can make 60/2 – 30 tables
Cbi Cj 40 35 0 0 Solution Ratio

Basic variables X1 X2 S1 S2
(BV)

0 S1 2 3 1 0 60 60 /2= 30
2

0 S2 44 3 0 1 100 96/4 =24

96
3

1
Zj 0 0 0 0 0

Cj - Zj 40 35 0 0

we need 4 hrs of labour /table we have 96 units of labour i.e we can make 96/4 –24 tables
Though we have wood for 30 tables we can only make 24 tables because of labour constraint
therefore select the least value 24 (S2 or labour) to calculate the best product mix (select S2 labour as key row)
entering variable
Cbi Cj 40 35 0 0 Solution Ratio

Basic variables X1 X2 S1 S2
(BV)

0 S1 4 3 1 0 60 60 /2= 30
2

S2 24 3 0 1 100 96/4 =24

96
40

1
Zj 0 0 0 0 0
leaving variable
Cj - Zj 40 35 0 0

We have selected to work on table consuming all the labour hours by making slack S2 = 0
therefore we can replace S2 with X1
Cbi Cj 40 35 0 0 Solution Ratio

Basic variables X1 X2 S1 S2
(BV)

0 S1 2 3 1 0 60
2

40 X1 44 3 0 1 96 96/4 =24

96
3

1
Zj
0 0 0 0 0

Cj - Zj 0 0
40 35

Divide the key row coefficients with key element (in this case time required per table)
(4/4), (3/4), (0/4), (1/4) and (96/4) (we are dividing the time required per table across the
products, to see if one hour time is left how many other products can be made))
Cbi Cj 40 35 0 0 Solution Ratio

Basic variables X1 X2 S1 S2
(BV)

0 S1 4 3 1 0 60 60 /2= 30
2

40 X1 24/4 3 0 1 100 96/4 =24

96/4
3/4

0/4

1/4
Zj

Cj - Zj

Old value ( - ) 3 units of wood ( - )

3 - 2x3 /4 = 3/2
For the second row apply the formula ; old value – {(corresponding key column value) x (corresponding key
row value)} / key element
X1 = 2 - 2 X4/4 =0
X2 = 3 - 2x3 /4 = 3/2
S1 = 1- 2 x 0 /4 = 1
S2 = 0 - 2x1/4 = -1/2
solution = 60 – 2 x96/4 = 12

Zj
X1 = (0x0)+(40x1) = 40 ; X2 = (0 x3/2)+(40x3/4) = 30

S1 = ( 0x1) + (40x0) = 0 ; S2 = ( 0x-1/2) + (40x1/4) = 10


Solution (0x-12) + (40 x24) = 960
Solution I
Cbi Cj 40 35 0 0 Solution Ratio

Basic variables X1 X2 S1 S2
(BV)

0 S1 0 3/2 1 -1/2 12 60 /2= 30

40 X1 1 3/4 0 1/4 24 96/4 =24

Zj

Cj - Zj
Cbi Cj 40 35 0 0 Solution Ratio
Basic variables X1 X2 S1 S2
(BV)

0 S1 0 3/2 1 -1/2 12 60 /2= 30


40 X1 1 3/4 0 1/4 24 96/4 =24
Zj 960

Cj - Zj
Ø Substitution rates or changes in S2 : Since one unit of X1 requires four hours, solution in
the tableau uses up all the 96 hrs.

Ø If one unit of S2 i.e one hour is made available for other purposes, then ¼ units of X1
would have to be given up.

Ø Since one unit of X1 require 2 kgs of wood, one hour of S2 reduces the out put of X1 by ¼
units , ¼ x 2 = ½ of wood would be unutilised (-1/2)
Solution I
Cbi Cj 40 35 0 0 Solution Ratio

Basic variables X1 X2 S1 S2
(BV)

0 S1 0 3/2 1 -1/2 12 60 /2= 30

40 X1 1 3/4 0 1/4 24 96/4 =24

Zj 960
40 30 0 10
Cj - Zj 0 5 0 -10

X1 = 24, X2 = 0, S1 = 12, S2 = 0 and the total revenue = 960


For all maximization problems Cj – Zj should be £ 0
Cbi Cj 40 35 0 0 Solution Ratio
Basic variables X1 X2 S1 S2
(BV)

0 S1 0 3/2 1 -1/2 12 60 /2= 30


40 X1 1 3/4 0 1/4 24 96/4 =24
Zj 960
40 30 0 10
Cj - Zj 0 5 0 -10
Ø Substitution rates or changes in S1 : 0 corresponding to X1 implies that reducing one kg
of wood has no effect on output of X1
Ø Since all the labour hours having been used, making available 1 kg of wood will cause no
change in the output (12 kg of wood is available unused)
Ø Substitution rates or changes in X2 : Addition of one unit of X2 would replace ¾ unit of
product X1
Ø X2 requires 3 hours of labour, implies that we give up ¾ units of X1

Ø Adding a unit of X2 would replace 3/2 kgs of wood ( 2 x ¾ = 3/2) or released from X1
Cbi Cj 40 35 0 0 Solution Ratio
Basic variables X1 X2 S1 S2
(BV)

0 S1 0 3/2 1 -1/2 12 60 /2= 30


40 X1 1 3/4 0 1/4 24 96/4 =24
Zj 960
40 30 0 10
Cj - Zj 0 5 0 -10

Ø Substitution rates or changes in X1 : Addition of one unit of X1 would replace, one unit of
the same product.
Ø Addition of X1 and replacing by X1 imply no change in the requirement of wood, it is
zero.

Ø Positive rates indicate decrease and negative / release of material or labour


Cbi Cj 40 35 0 0 Solution Ratio
Basic variables X1 X2 S1 S2
(BV)

0 S1 0 3/2 1 -1/2 12 60 /2= 30


40 X1 1 3/4 0 1/4 24 96/4 =24
Zj 960
40 30 0 10
Cj - Zj 0 5 0 -10
Ø changes in Cj - Zj
Ø Zj represents the loss of profit that results from the addition of one unit of variable
heading a particular column.
Ø Zj = 40, 30, 0 and 10
Ø Addition of one unit of X1 causes reduction of one unit of the same product and a 0
change in S1
Ø Reduction of one unit of X1 would result in a loss of Rs. 40
Ø Hence for X1, the value equals 40.
Cbi Cj 40 35 0 0 Solution Ratio
Basic variables X1 X2 S1 S2
(BV)

0 S1 0 3/2 1 -1/2 12 60 /2= 30


40 X1 1 3/4 0 1/4 24 96/4 =24
Zj 960
40 30 0 10
Cj - Zj 0 5 0 -10
Ø changes in Cj - Zj
Ø Addition of one unit of X2 results in two changes.
a. S1 is reduced by 3/2 units and
b. X1 is reduced by ¾ units
Ø Since the profit per unit of S1 is nil, the changes in S1 shall cause no changes to the profit
Ø Since profit of X1 Rs.40 reduction of 3/4 units would result in a loss of 40 x ¾ = 30
Ø For S1 addition of one unit of S1 causes a substitution of 1 unit of the same and none of
X1, therefore the loss of profit is zero
Cbi Cj 40 35 0 0 Solution Ratio
Basic variables X1 X2 S1 S2
(BV)

0 S1 0 3/2 1 -1/2 12 60 /2= 30


40 X1 1 3/4 0 1/4 24 96/4 =24
Zj 960
40 30 0 10
Cj - Zj 0 5 0 -10
Øchanges in Cj - Zj
ØAdding one unit of S2, produces two changes
a. Freeing of 1/2 units of wood (S1) and
b. Consuming ¼ hrs labour of X1, that would cause a reduction of 40 x ¼ = 10 (loss of Rs. 10)
Ø For X2, unit profit is Rs. 35, whereas loss of profit is Rs.30
Ø Net change in the profit resulting from the addition of on unit of X2, is 35-30 Rs.5
Ø For S1, net change is zero while for S2, adding a unit in the solution would involve a net loss
of Rs 10
Ø A positive value in (Cj –Zj) indicates that the objective function value may be increased.
Cbi Cj 40 35 0 0 Solution Ratio
Basic variables X1 X2 S1 S2
(BV)

0 S1 0 3/2
3/2 1 -1/2 12 12/3/2= 8
40 X1 1 3/4
3/4 0 1/4 24 24/3/4 =32
Zj 960
40 30 0 10
Cj - Zj 0 5 0 -10
Cbi Cj 40 35 0 0 Solution Ratio

Basic variables X1 X2 S1 S2
(BV)

0 S1 0 3/23/2 1 -1/2 12

-1/2
3/2
12/3/2 = 8

12
0

1
40 X1 1 3/4
3/4 0 1/4 24
24x4/3=32
Zj 960
40 30 0 10
Cj - Zj 0 5
0 -10

Negative signs are gains and positive signs are loss or giving up for other activities
Cbi Cj 40 35 0 0 Solution Ratio

Basic variables X1 X2 S1 S2
(BV)

35 X2 0 1 2/3 -1/3 8
12/3/2 = 8
40 X1 1 0 -1/2 1/2 18 24x4/3=32
Zj 40 35 10/3 25/3 1000

Cj - Zj 0 0
-10/3 -25/3

Ø The values 0 and 1 under X1 suggest that a unit of X1 added to the current mix will call for replacing one
unit of the same product in the solution with 0 change needed in the other product.
Ø Similarly for X2 adding one product of X2 will have no change in X1
Ø For S1 2/3 for X2 and -1/2 for X1 implies that, releasing (removing) one kg of wood would mean losing
2/3 units of X2 and gaining ½ units of X1

Ø Loss of 2/3 units of X2 and gain of ½ units of X1 would result in net loss of (35 x 2/3) – (40 x ½) = - 10/3
Cbi Cj 40 35 0 0 Solution Ratio

Basic variables X1 X2 S1 S2
(BV)

35 X2 0 1 2/3 -1/3 8

40 X1 1 0 -1/2 1/2 18

Zj 40 35 10/3 25/3 1000

Cj - Zj 0 0
-10/3 -25/3

Ø For S2 the values - 1/3 for X2 and 1/2 for X1 indicate that, releasing (removing) one hour of labour would
mean losing ½ units of X1 and gaining 1/3 hours X2
Ø reduction of ½ hours from X1 would release 4 x ½ = 2 hours of labour while adding 1/3 hrs for X2 that
would consume 3 x 1/3 = 1 hour of labour

Ø The changes shall cause a net reduction of Rs. 25/3 in profit


Ø A loss of 40 x ½ = 20 and gain of 35 x1/3 = 35/3 (20 – 35/3 = 25/3)
Example – 2, Interpretation of the vales in the problem and solution
Let the tables be X1 and chairs be X2

maximize profit , Z = 40X1 + 35X2 Solution


X1 = 18, X2 = 8, Z =1,000
2X1 + 3X2 £ 60
Z= 40(18) + 35(8) = 720 + 280 = 1,000
4X1 + 3X2 £ 96
2(18)+3(8) = 36 + 24 = 60
X1, X2 ≥ 0 4(18) + 3(8) = 72 + 24 = 96
Next Topic Duality and sensitivity Analysis

Das könnte Ihnen auch gefallen