Sie sind auf Seite 1von 45

EXAMPLES ON SIMPLEX

ALGORITHM

Dr. KRISHAN K. PANDEY


ASSISTANT PROFESSOR
CMES, UNIVERSITY OF PETROLEUM
& ENERGY STUDIES,
DEHRADUN (U.K.), INDIA
Example 1
A manufacturer of leather belts makes three types of belts A,B and C which
are processed on three machines M1, M 2 and M3. Belt A requires 2 hours
on Machine M1 and 3 hours on machine M3. Belt B requires 3 hours on
Machine M1 , 2 hours on machine M2 and 2 hours on machine M3; and
Belt C requires 5 hours on Machine M2 and4 hours on machine M3.There
are 8 hours of time per day available on machine M1 , 10 hours of time
per day available on machine M2 and 15 hours of time per day available
on machine M3.The profit gained from belt A is Rs. 3 per unit, from belt B
is Rs. 5 per unit , from belt C is Rs. 4 per unit . What should be the daily
production of each type of belts so that the profit is maximum.
Mathematical Form :
Maximize z = 3x1+5x2+4x3
S.t. 2x1+3x2 ≤ 8,
2x2+5x3 ≤ 10,
3x1+2x2+4x3 ≤ 15,
x1,x2,x3 ≥ 0.
I Simplex Table
Cj 3 5 4 0 0 0

CB Basic Variable Solution x1 x2 x3 S1 S2 S3


(B) Values xB

0 S1 8 2 3 0 1 0 0

0 S2 10 0 2 5 0 1 0

0 S3 15 3 2 4 0 0 1

Zj – Cj -3 -5 -4 0 0 0
0
II Simplex Table
Cj 3 5 4 0 0 0

CB Basic Variable Solution x1 x2 x3 S1 S2 S3


(B) Values xB

5 x2 8/ 3 2/3 1 0 1/3 0 0

0 S2 14 / 3 -4/3 0 5 - 2/ 3 1 0

0 S3 29 / 3 5/3 0 4 - 2/ 3 0 1

Zj – Cj
40 / 3 1/3 0 -4 5/3 0 0
III Simplex Table
Cj 3 5 4 0 0 0

CB Basic Variable Solution x1 x2 x3 S1 S2 S3


(B) Values xB

5 x2 8/ 3 2/3 1 0 1/3 0 0

4 x3 14 / 15 - 4 / 15 0 1 - 2/ 15 1/5 0

0 S3 89 / 15 41 / 15 0 0 - 2/ 15 - 4/5 1

Zj – Cj
256 / 15 - 11 / 15 0 0 17/15 4/5 0
IV Simplex Table
Cj 3 5 4 0 0 0

CB Basic Variable Solution x1 x2 x3 S1 S2 S3


(B) Values xB

5 x2 50/41 0 1 0 15 /41 8/41 -10/41

4 x3 62 / 41 0 0 1 - 6/ 41 5/41 4/41

3 x1 89 / 41 1 0 0 - 2/ 41 -12/41 15/41

Zj – Cj
765 / 41 0 0 0 45/41 24/41 11/41
Now since all Z j – C j are non negative, therefore an
optimum basic solution is

X1= 89/41, X2= 50/41, X3= 62/41; max. z = 765/41.

Hence in order to achieve a maximum income of


Rs. 765/41, the firm should produce 89/41 units of
belt A, 50/41 units of belt B and 62/41 unit of belt C.
Example 2
Maximize z = 3x1 + 2x2
subject to:
- x1 + 2x2 ≤ 4
3x1 + 2x2 ≤ 14
x1 - x2 ≤ 3
x1, x2 ≥ 0
I Simplex Table
Cj 3 2 0 0 0

CB Basic Solution x1 x2 S1 S2 S3
Variable Values xB
(B)

0 S1 4 -1 2 1 0 0

0 S2 14 3 2 0 1 0

0 S3 3 -1 0 0 1
1

Zj – Cj -3 -2 0 0 0
0
II Simplex Table
Cj 3 2 0 0 0

CB Basic Variable Solution x1 x2 S1 S2 S3


(B) Values xB

0 S1 7 0 1 1 0 1

0 S2 5 0 5 0 1 -3

3 X1 3 1 -1 0 0 1

Zj – Cj 0 -5 0 0 3
9
III Simplex Table
Cj 3 2 0 0 0

CB Basic Variable Solution x1 x2 S1 S2 S3


(B) Values xB

0 S1 6 0 0 1 - 1/5 8/5

2 X2 1 0 1 0 1/5 - 3/5

3 X1 4 1 0 0 1/5 2/5

Zj – Cj
14 0 0 0 1 0
Since all the values of zj- cj are positive, this is the
optimal solution.
x1 = 4, x2 = 1
z = 3 * 4 + 2 * 1 = 14.

The largest profit of Rs.14 is obtained, when 1 unit of


x2 and 4 units of x1 are produced. The above solution
also indicates that 6 units are still unutilized, as
shown by the slack variable S1 in the XB column.
NOTE :

Please don't convert the fractions into decimals, because


many fractions cancel out during the process while the
conversion into decimals will cause unnecessary
complications.

“Minds are like parachutes; they work best when open.”


Example 3
Luminous Lamps produces three types of lamps - A, B, and C.
These lamps are processed on three machines - X, Y, and Z.
The full technology and input restrictions are given in the
following table. Find out a suitable product mix so as to
maximize the profit.
Product Machine Profit per unit
X Y Z
A
10 7 2 12
B
2 3 4 3
C
1 2 1 1
Available Time
100 77 80
Solution.
The decision problem can be formulated as
Maximize z = 12x1 + 3x2 + x3
subject to :
10x1 + 2x2 + x3 ≤ 100
7x1 + 3x2 + 2x3 ≤ 77
2x1+ 4x2 + x3 ≤ 80
x1, x2, x3 ≥ 0
Converting inequalities to equalities
10x1 + 2x2 + x3 + x4 = 100
7x1 + 3x2 + 2x3 + x5 = 77
2x1+ 4x2 + x3 + x6 = 80
x1, x2, x3, x4, x5, x6 ≥ 0
Where x4, x5 and x6 are slack variables.
Including these slack variables in the objective function, we
get
• Maximize z = 12x1 + 3x2 + x3 + 0x4 + 0x5 + 0x6
• Initial basic feasible solution
• x1 = 0, x2 = 0, x3 = 0, z = 0
x4 = 100, x5 = 77, x6 = 80.
Table 1
cj 12 3 1 0 0 0

cB Basic variable x1 x2 x3 x4 x5 x6 Solution values


XB b (=XB)

0 x4 10 2 1 1 0 0 100

0 x5 7 3 2 0 1 0 77

0 x6 2 4 1 0 0 1 80
zj-cj -12 -3 -1 0 0 0
Key column = x1 column, Minimum (100/10, 77/7, 80/2) = 10, Key row = x4 row,
Pivot element = 10
Table 2
cj 12 3 1 0 0 0
cB Basic x1 x2 x3 x4 x5 x6 Solution values
variables b (= XB)
B

12 x1 1 1/5 1/10 1/10 0 0 10

13/1
0 x5 0 8/5 -7/10 1 0 7
0

0 x6 0 18/5 4/5 -1/5 0 1 60

zj-cj 0 -3/5 1/5 6/5 0 0


Final Table
cj 12 3 1 0 0 0

cB Basic variables x1 x2 x3 x4 x5 x6 Solution values


B b (= XB)

12 x1 1 0 -1/16 3/16 -1/8 0 73/8

3 x2 0 1 13/16 -7/16 5/8 0 35/8

0 x6 0 0 -17/8 11/8 -9/4 1 177/4

zj-cj 0 0 11/16 15/16 3/8 0

An optimal policy is x1 =73/8, x2 = 35/8, x3 = 0.


The associated optimal value of the objective function is
z = 12 * (73/8) + 3 * (35/8) + 1 * 0 = 981/8.
Some Special Cases
1. Unrestricted (unconstrained) Variables:
Sometimes decision variables are unrestricted in sign (positive, negative or
zero). In all such cases, the decision variables can be expressed as the
difference between two non-negative variables. For example, if x1 is
unrestricted in sign, then Put x1 = x1' - x1'' .

Example :
Maximize z = 2x1 + 3x2
subject to,
-x1 + 2x2 ≤ 4
x1 + x2 ≤ 6
x1 + 3x2 ≤ 9
x1, x2 are unrestricted in sign
Solution:
Since x1 and x2 are unrestricted in sign, we can replace them by non-
negative variables x1' , x1'', x2' , x2'' .
Put x1 = x1' - x1'‘ and x2 = x2' - x2''
The given problem can be written as
Max. z = 2(x1' - x1'') + 3(x2' - x2'')
subject to: -(x1' - x1'') + 2(x2' - x2'') ≤ 4
(x1' - x1'') + (x2' - x2'') ≤ 6
(x1' - x1'') + 3(x2' - x2'') ≤ 9
Introducing slack variables
Max. z = 2x1' - 2x1'' + 3x2' - 3x2''
subject to:
-x1' + x1'' + 2x2' - 2x2'' + x3 = 4
x1' - x1'' + x2' - x2'' + x4 = 6
x1' - x1'' + 3x2' - 3x2'' + x5 = 9
Where x3, x4 and x5 are slack variables.
Table 1
cj 2 -2 3 -3 0 0 0

cB Basic variables x1' x1'' x2' x2'' x3 x4 x5 Solution values


B b (=XB)

0 x3 -1 1 2 -2 1 0 0 4

0 x4 1 -1 1 -1 0 1 0 6

0 x5 1 -1 3 -3 0 0 1 9

zj-cj -2 2 -3 3 0 0 0
Key column = x2' column, Minimum (4/2, 6/1, 9/3) = 2, Key row = x3 row.
Pivot element = 2

Table 2
cj 2 -2 3 -3 0 0 0

cB Basic variables x1' x1'' x2' x2'' x3 x4 x5 Solution values


B b (=XB)

3 x2' -1/2 1/2 1 -1 1/2 0 0 2

0 x4 3/2 -3/2 0 0 -1/2 1 0 4

0 x5 5/2 -5/2 0 0 -3/2 0 1 3

zj-cj -7/2 7/2 0 0 3/2 0 0


Table 3
cj 2 -2 3 -3 0 0 0

cB Basic x1' x1'' x2' x2'' x3 x4 x5 Solution values


variables b (=XB)
B

3 x2' 0 0 1 -1 1/5 0 1/5 13/5

0 x4 0 0 0 0 2/5 1 -3/5 11/5

2 x1' 1 -1 0 0 -3/5 0 2/5 6/5

zj-cj 0 0 0 0 -3/5 0 7/5


Table 4
cj 2 -2 3 -3 0 0 0

cB Basic variables x1' x1'' x2' x2'' x3 x4 x5 Solution values


B b (=XB)

3 x2' 0 0 1 -1 0 -1/2 1/2 3/2

0 x3 0 0 0 0 1 5/2 -3/2 11/2

2 x1' 1 -1 0 0 0 3/2 -1/2 9/2

zj-cj 0 0 0 0 0 3/2 1/2

The optimal solution is:


x1' = 9/2, x1'' = 0, x2' = 3/2, x2'' = 0.
Solution of the original problem is:
x1 = x1' - x1'' = 9/2 - 0 = 9/2
x2 = x2' - x2'' = 3/2 - 0 = 3/2
z = 2 * 9/2 + 3 * 3/2 = 27/2.
2. Unbounded Solution :
If in course of simplex computation zj - cj < 0, but minimum
positive value is ≤ 0 then the problem has an unbounded
solution.

Example :
Maximize 5x1 + 4x2
subject to : x1 ≤ 7
x1 - x2 ≤ 8
x1, x2 ≥ 0.

Solution.
Converting inequalities to equalities
x1 + x3 = 7
x1 - x2 + x4 = 8
x1, x2, x3, x4 ≥ 0.
Where x3 and x4 are slack variables.
Table 1
cj 5 4 0 0

cB Basic variables x1 x2 x3 x4 Solution values


B b (=XB)

0 x3 1 0 1 0 7

0 x4 1 -1 0 1 8

zj-cj -5 -4 0 0
Table 2
cj 5 4 0 0
cB Basic variables x1 x2 x3 x4 Solution values
B b (=XB)

5 x1 1 0 1 0 7

0 x4 0 -1 -1 1 1

zj-cj 0 -4 5 0

Since minimum positive value is infinity, it is not


possible to proceed with the simplex computation any
further. This is the criterion for unbounded solution.
3. No Feasible Solution :
If in course of simplex computation, one or more
artificial variables remain in the basis at positive level at
the end of phase 1 computation, the problem has no
feasible solution. For example, let us consider the
following problem.
Example

Maximize -200x1 - 300x2


subject to :
2x1 + 3x2 ≥ 1200
x1 + x2 ≤ 400
2x1 + 3/2x2 ≥ 900
x1, x2 ≥ 0
TWO – PHASE METHOD
In this method, the whole procedure of solving a linear
programming problem involving artificial variables is divided
into two phases. In phase I, we form a new objective function
by assigning zero to every original variable (including slack
and surplus variables) and -1 to each of the artificial variables.
Then we try to eliminate the artificial varibles from the basis.
The solution at the end of phase I serves as a basic feasible
solution for phase II. In phase II, the original objective
function is introduced and the usual simplex algorithm is used
to find an optimal solution.
Example: 1
Minimize z = - 3x1 + x2 - 2x3
subject to
x1 + 3x2 + x3 ≤ 5
2x1 - x2 + x3 ≥ 2
4x1 + 3x2 - 2x3 = 5
x1, x2, x3 ≥ 0
Solution:
Maximize z = 3x1 - x2 + 2x3
subject to
x1 + 3x2 + x3 ≤ 5
2x1 - x2 + x3 ≥ 2
4x1 + 3x2 - 2x3 = 5
x1, x2, x3 ≥ 0
Converting inequalities to equalities
x1 + 3x2 + x3 + x4= 5
2x1 - x2 + x3 – x5 = 2
4x1 + 3x2 - 2x3 = 5
x1, x2, x3 , x4 , x5 ≥ 0
Where:
x4 is a slack variable
x5 is a surplus variable
Now, if we let x1, x2 and x3 equal to zero in the initial solution, we will have x4 = 5
and x5 = -2, which is not possible because a surplus variable cannot be negative.
Therefore, we need artificial variables.
x1 + 3x2 + x3 + x4 = 5
2x1 - x2 + x3 - x5 + A1 = 2
4x1 + 3x2 - 2x3 + A2 = 5
x1 , x 2 , x 3 , x 4 , x 5 , A 1 , A 2 ≥ 0
Where A1 and A2 are artificial variables.
PHASE 1
In this phase, we remove the artificial variables and find an initial feasible
solution of the original problem. Now the objective function can be
expressed as
Maximize 0x1 + 0x2 + 0x3 + 0x4 + 0x5 + (- A1) + (- A2)
subject to
x1 + 3x2 + x3 + x4 = 5
2x1 - x2 + x3 - x5 + A1 = 2
4x1 + 3x2 - 2x3 + A2 = 5
x1, x2, x3, x4, x5, A1, A2 ≥ 0
Initial basic feasible solution
The initial basic feasible solution is obtained by setting
x1 = x2 = x3 = x5 = 0
Then we shall have A1 = 2 , A2 = 5, x4 = 5
TABLE 1
cj 0 0 0 0 0 -1 -1

cB Basic variables x1 x2 x3 x4 x5 A1 A2 Solution values


B b (= XB)

0 x4 1 3 1 1 0 0 0 5

-1 A1 2 -1 1 0 -1 1 0 2

-1 A2 4 3 -2 0 0 0 1 5

Zj- cj -6 -2 1 0 1 0 0

Key column = x1 column


Minimum (5/1, 2/2, 5/4) = 1
Key row = A1 row
Pivot element = 2
A1 departs and x1 enters.
TABLE 2
cj 0 0 0 0 0 -1

cB Basic variables x1 x2 x3 x4 x5 A2 Solution values


B b (= XB)

0 x4 0 7/2 1/2 1 1/2 0 4

0 x1 1 -1/2 1/2 0 -1/2 0 1

-1 A2 0 5 -4 0 2 1 1

zj-cj 0 -5 4 0 -2 0

A2 departs and x2 enters. Here, Phase 1 terminates because both the artificial
variables have been removed from the basis.
PHASE 2

The basic feasible solution at the end of Phase 1 computation is used as


the initial basic feasible solution of the problem. The original objective
function is introduced in Phase 2 computation and the usual simplex
procedure is used to solve the problem.

TABLE 3
cj 3 -1 2 0 0

cB Basic variables x1 x2 x3 x4 x5 Solution values


B b (= XB)

0 x4 0 0 33/10 1 -9/10 33/10

3 x1 1 0 1/10 0 -3/10 11/10

-1 x2 0 1 -4/5 0 2/5 1/5

zj-cj 0 0 -9/10 0 -13/10


TABLE 4
cj 3 -1 2 0 0

cB Basic variables x1 x2 x3 x4 x5 Solution values


B b (= XB)

0 x4 0 9/4 3/2 1 0 15/4

3 x1 1 3/4 -1/2 0 0 5/4

0 x5 0 5/2 -2 0 1 1/2

zj-cj 0 13/4 -7/2 0 0


TABLE 5
cj 3 -1 2 0 0

cB Basic variables x1 x2 x3 x4 x5 Solution values


B b (= XB)

2 x3 0 3/2 1 2/3 0 5/2

3 x1 1 3/2 0 1/3 0 5/2

0 x5 0 11/2 0 4/3 1 11/2

zj-cj 0 17/2 0 7/3 0

An optimal policy is x1 = 5/2, x2 = 0, x3 = 5/2. The associated optimal value


of the objective function is z = 3 * (5/2) - 0 + 2 * (5/2) = 25/2.
EXAMPLE 2

Maximize z = 12x1 + 15x2 + 9x3


subject to
8x1 + 16x2 + 12x3 ≤ 250
4x1 + 8x2 + 10x3 ≥ 80
7x1 + 9x2 + 8x3 = 105
x1, x2, x3 ≥ 0
Solution.
Introducing slack, surplus & artificial variables
8x1 + 16x2 + 12x3 + x4 = 250
4x1 + 8x2 + 10x3 - x5 + A1 = 80
7x1 + 9x2 + 8x3 + A2 = 105
Where:
x4 is a slack variable.
x5 is a surplus variable.
A1& A2 are artificial variables.
PHASE 1
Maximize 0x1 + 0x2 + 0x3 + 0x4 + 0x5 + (- A1) + (- A2)
subject to
8x1 + 16x2 + 12x3 + x4 = 250
4x1 + 8x2 + 10x3 - x5 + A1 = 80
7x1 + 9x2 + 8x3 + A2 = 105
x1, x2, x3, x4, x5, A1, A2 ≥ 0
Equating x1, x2, x3, x5 to zero.
Initial basic feasible solution
x4 = 250, A1= 80 , A2 = 105
TABLE 1

cj 0 0 0 0 0 -1 -1

cB Basic variables x1 x2 x3 x4 x5 A1 A2 Solution values


B b (= XB)

0 x4 8 16 12 1 0 0 0 250

-1 A1 4 8 10 0 -1 1 0 80

-1 A2 7 9 8 0 0 0 1 105

Zj-cj -11 -17 -18 0 1 0 0


TABLE 2
cj 0 0 0 0 0 -1

cB Basic variables x1 x2 x3 x4 x5 A2 Solution values


B b (= XB)

0 x4 16/5 32/5 0 1 6/5 0 154

0 x3 2/5 4/5 1 0 -1/10 0 8

-1 A2 19/5 13/5 0 0 4/5 1 41

zj-cj -19/5 -13/5 0 0 -4/5 0

Here, Phase 1 terminates because both the artificial variables have been
removed from the basis.
PHASE 2

TABLE 3
cj 12 15 9 0 0

cB Basic variables x1 x2 x3 x4 x5 Solution values


B b (= XB)

0 x4 0 80/19 0 1 10/19 2270/19

9 x3 0 10/19 1 0 -7/38 70/19

12 x1 1 13/19 0 0 4/19 205/19

zj-cj 0 -39/19 0 0 33/38


TABLE 4
Cj 12 15 9 0 0

cB Basic x1 x2 x3 x4 x5 Solution values


variables b (= XB)
B

0 x4 0 0 -8 1 2 90

15 x2 0 1 19/10 0 -7/20 7

12 x1 1 0 -13/10 0 9/20 6

Zj- cj 0 0 39 /10 0 3/20

The optimal solution is:


x1 = 6, x2 = 7, x3 = 0
z = 12 *6 + 15 * 7 + 9 * 0 = 177.

Das könnte Ihnen auch gefallen