Beruflich Dokumente
Kultur Dokumente
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.
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.
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
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.
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.
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