Sie sind auf Seite 1von 7

UNIVERSITY OF KARACHI

DEPARTMENT OF COMPUTER SCIENCE


(MORNING PROGRAMME)
BACHELOR OF SCIENCE IN COMPUTER SCIENCE
SEMESTER FIRST SEMESTER 2016
COURSE BSCS-507 OPERATIONS RESEARCH I
HANDOUT III
TWO-PHASE SIMPLEX METHOD
FOR SOLVING LINEAR PROGRAMMING MODEL PROBLEMS
This method is used for solving the non-standard optimization problems and/or for
solving the minimization problems of linear programming model. 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 to get rid of
(removing) the artificial variables. If this new objective function is minimized to zero,
the solution at the end of Phase I serves as a basic feasible solution for Phase II.
Otherwise, if at the end of Phase I, the objective function is not minimized to zero, it
indicates that there is no feasible solution to the problem, and we conclude the problem
and stop. In Phase II, the usual Simplex Method is used to find an optimal solution.

PROBLEM 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
Any linear minimization problem can be viewed as an equivalent linear maximization
problem, and vice versa.
For this purpose, assume that: Z = Z
Therefore, Z = 3x1 x2 + 2x3
Then the given problem is equivalent to the following linear maximization problem.
Maximize Z = 3x1 x2 + 2x3
subject to:
x1 + 3x2 + x3 5
2x1 x2 + x3 2
4x1 + 3x2 2x3 = 5
x1, x2, x3 0

Page 1 of 7

UNIVERSITY OF KARACHI
DEPARTMENT OF COMPUTER SCIENCE
(MORNING PROGRAMME)
BACHELOR OF SCIENCE IN COMPUTER SCIENCE
SEMESTER FIRST SEMESTER 2016
COURSE BSCS-507 OPERATIONS RESEARCH I
HANDOUT III
Converting inequalities to equalities (in the constraints)
x1 + 3x2 + x3 + s1 = 5
2x1 x2 + x3 s2 = 2
4x1 + 3x2 2x3 = 5
x1, x2, x3, s1, s1 0
Where, s1 is a slack variable, and s2 is a surplus variable.
Now, if we let x1, x2 and x3 equal to zero in the initial solution, we will have s1 = 5 and
s2 = 2, which is not possible because a surplus variable cannot be negative. Therefore,
we need artificial variables.

Adding artificial variables (in the constraints)


x1 + 3x2 + x3 + s1 = 5
2x1 x2 + x3 s2 + a1 = 2
4x1 + 3x2 2x3 + a2 = 5
x1, x2, x3, s1, s2, a1, a2 0
Where, a1 and a2 are the artificial variables.
Phase I
In this phase, we attempt to remove the artificial variables and to find an initial feasible
solution of the original problem. Now the new objective function can be expressed as
follows.
Minimize W = a1 + a2
For this purpose, assume that: W = W
Therefore, W = (a1) + (a2)
Then the above problem is equivalent to the following linear maximization problem (as
discussed above).
Maximize W = (a1) + (a2)
Hence, the actual problem that is to be solved is as follows.

Page 2 of 7

UNIVERSITY OF KARACHI
DEPARTMENT OF COMPUTER SCIENCE
(MORNING PROGRAMME)
BACHELOR OF SCIENCE IN COMPUTER SCIENCE
SEMESTER FIRST SEMESTER 2016
COURSE BSCS-507 OPERATIONS RESEARCH I
HANDOUT III
Maximize W = (a1) + (a2)
Maximize Z = 3x1 x2 + 2x3
subject to
x1 + 3x2 + x3 + s1 = 5
2x1 x2 + x3 s2 + a1 = 2
4x1 + 3x2 2x3 + a2 = 5
x1, x2, x3, s1, s2, a1, a2 0
Converting the Canonical Form to the Initial Simplex Table.
B.V.
s1
a1
a2
Z
W

x1
1
2
4
3
0

x2
3
1
3
1
0

x3
1
1
2
2
0

s1
1
0
0
0
0

s2
0
1
0
0
0

a1
0
1
0
0
1

a2
0
0
1
0
1

Z
0
0
0
1
0

W
0
0
0
0
1

RHS
5
2
5
0
0

In the above table, it can be observed that, although s1 is a correct basic variable, a1
and a2 are not appropriate basic variables (as they do not follow the criteria for the
identification of the basic variables). However, they can become the correct basic
variables if the 1s are removed from the W-row. Hence, we will apply the appropriate
row operations to remove these 1s from the W-row (i.e. R5 = R5 R2 R3). So, the
Simplex Table will become as follows. This will be the Initial Simplex Table.

Initial Simplex Table


B.V.
s1
a1
a2
Z
W

x1
1
2
4
3
6

x2
3
1
3
1
2

x3
1
1
2
2
1

s1
1
0
0
0
0

s2
0
1
0
0
1

a1
0
1
0
0
0

a2
0
0
1
0
0

Z
0
0
0
1
0

W
0
0
0
0
1

RHS
5
2
5
0
7

Initial basic feasible solution


The initial basic feasible solution is obtained by setting x1 = x2 = x3 = s2 = 0.
Then we shall have s1 = 5, a1 = 2, and a2 = 5.

Page 3 of 7

UNIVERSITY OF KARACHI
DEPARTMENT OF COMPUTER SCIENCE
(MORNING PROGRAMME)
BACHELOR OF SCIENCE IN COMPUTER SCIENCE
SEMESTER FIRST SEMESTER 2016
COURSE BSCS-507 OPERATIONS RESEARCH I
HANDOUT III
But the problem here is that this solution has the artificial variables a1 and a2. We need
to get rid of them in the first phase.
Now, we start the Simplex Method as usual. We will process the Initial Simplex Table
as follows.

Initial Simplex Table (Simplex Table I)


B.V.
s1
a1
a2
Z
W

x1
1
2
4
3
6

x2
3
1
3
1
2

x3
1
1
2
2
1

s1
1
0
0
0
0

s2
0
1
0
0
1

a1
0
1
0
0
0

a2
0
0
1
0
0

Z
0
0
0
1
0

W
0
0
0
0
1

RHS
5
2
5
0
7

Pivotal Column, Pivotal Row and the Pivotal Elements are highlighted in the table.
x1 is the new (entering) basic variable, and a1 is the leaving basic variable.
Whenever an artificial variable leaves it never enters the table again, so we remove its
column from the table. The resulting Simplex Table will be as follows.

Simplex Table II
B.V.
s1
x1
a2
Z
W

x1
0
1
0
0
0

x2
3.5
0.5
5
0.5
5

x3
0.5
0.5
4
0.5
4

s1
1
0
0
0
0

s2
0.5
0.5
2
1.5
2

a2
0
0
1
0
0

Z
0
0
0
1
0

W
0
0
0
0
1

RHS
4
1
1
3
1

Pivotal Column, Pivotal Row and the Pivotal Elements are highlighted in the table.
x2 is the new (entering) basic variable, and a2 is the leaving basic variable. We will
remove the column of a2 from the table.
The resulting Simplex Table will be as follows.

Page 4 of 7

UNIVERSITY OF KARACHI
DEPARTMENT OF COMPUTER SCIENCE
(MORNING PROGRAMME)
BACHELOR OF SCIENCE IN COMPUTER SCIENCE
SEMESTER FIRST SEMESTER 2016
COURSE BSCS-507 OPERATIONS RESEARCH I
HANDOUT III
Simplex Table III
B.V.
s1
x1
x2
Z
W

x1
0
1
0
0
0

x2
0
0
1
0
0

x3
3.3
0.1
0.8
0.9
0

s1
1
0
0
0
0

Z
0
0
0
1
0

s2
0.9
0.3
0.4
1.3
0

W
0
0
0
0
1

RHS
3.3
1.1
0.2
3.1
0

Here, Phase I terminates because both the artificial variables have been removed from
the system, and the optimal value of W is zero. As W = W, we have obtained the
value of W as zero. It means that the problem has the feasible solution. We will now
remove the W-column and W-row and will proceed to Phase II.
The resulting Simplex Table will be the first table to be used in Phase II.

Phase II
The basic feasible solution at the end of Phase I processing is used as the initial basic
feasible solution of the problem. The original objective function is to be solved in Phase
II, and the usual Simplex Method is to be used to solve the problem.
The first table used in this phase is the resulting Simplex Table of the previous phase.
The normal processing of the Simplex Method will be performed on this table.
Simplex Table III (after removing the W-column and W-row)
B.V.
s1
x1
x2
Z

x1
0
1
0
0

x2
0
0
1
0

x3
3.3
0.1
0.8
0.9

s1
1
0
0
0

s2
0.9
0.3
0.4
1.3

Z
0
0
0
1

RHS
3.3
1.1
0.2
3.1

Pivotal Column, Pivotal Row and the Pivotal Elements are highlighted in the table.
s2 is the new (entering) basic variable, and x2 is the leaving basic variable.
The resulting Simplex Table will be as follows.

Page 5 of 7

UNIVERSITY OF KARACHI
DEPARTMENT OF COMPUTER SCIENCE
(MORNING PROGRAMME)
BACHELOR OF SCIENCE IN COMPUTER SCIENCE
SEMESTER FIRST SEMESTER 2016
COURSE BSCS-507 OPERATIONS RESEARCH I
HANDOUT III
Simplex Table IV
B.V.
s1
x1
s2
Z

x1
0
1
0
0

x2
2.25
0.75
2.5
3.25

x3
1.5
0.5
2
3.5

s1
1
0
0
0

s2
0
0
1
0

Z
0
0
0
1

RHS
3.75
1.25
0.5
3.75

Pivotal Column, Pivotal Row and the Pivotal Elements are highlighted in the table.
x3 is the new (entering) basic variable, and s1 is the leaving basic variable.
The resulting Simplex Table will be as follows.

Simplex Table V
B.V.
x3
x1
s2
Z

x1
0
1
0
0

x2
1.5
1.5
5.5
8.5

x3
1
0
0
0

s1
0.67
0.33
1.33
2.33

s2
0
0
1
0

Z
0
0
0
1

RHS
2.5
2.5
5.5
12.5

The resulting Simplex Table is the final Simplex Table and has the optimal value for Z.
According to this final Simplex Table, the optimal (maximal) value of Z is 12.5.
As Z = Z, we have the value of Z as 12.5.
Hence, the optimal solution is as follows.
The Optimal (Minimized) value of Z is 12.5, at x1 = 2.5, x2 = 0, and x3 = 2.5.
Furthermore, the values of the slack/surplus variables are s1 = 0 and s2 = 5.5.
These values can be verified as well.

( PLEASE PROCEED TO THE NEXT PAGE FOR PROBLEM 2 )


Page 6 of 7

UNIVERSITY OF KARACHI
DEPARTMENT OF COMPUTER SCIENCE
(MORNING PROGRAMME)
BACHELOR OF SCIENCE IN COMPUTER SCIENCE
SEMESTER FIRST SEMESTER 2016
COURSE BSCS-507 OPERATIONS RESEARCH I
HANDOUT III

PROBLEM 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
DO IT YOURSELF!

WISH YOU THE BEST OF LUCK


*******************************
Page 7 of 7

Das könnte Ihnen auch gefallen