Вы находитесь на странице: 1из 34

SIMPLEX METHOD

IN TABULAR FORM

Elita Amrina, Ph.D


Operations Research I (TIN 206)
Introduction
The simplex technique involves generating a series of
solutions in tabular form, called tableaus.
By inspecting the upper row of each tableau, one can
immediately tell if it represents the optimal solution.
Each tableau corresponds to a corner point of the feasible
solution space.
The first tableau corresponds to the origin.
Subsequent tableaus are developed by shifting to an
adjacent corner point in the direction that yields the highest
(smallest) rate of profit (cost).
This process continues as long as a positive (negative) rate of
profit (cost) exists.

Lecture-5 Operations Research I 2


Simplex Method

Min Z = CX
s/t AX = b, (B,N) (XB, XN) = b
X0

For each interation need to be solved :


1. B.XB = b XB = B-1 . b
2. w.B = CB w = CB . B-1 ; Zj Cj = waj Cj
3. B . YK = aK YK = B-1 . aK

Lecture-5 Operations Research I 3


Simplex Method
Suppose that we have starting BFS X with basis B.
The LP problem can be represented as follows:

Min Z
s/t Z CB XB CNXN = 0 ..... (1)
BXB + NXN =b ..... (2)
XB , XN 0
From Equation (2) multiplying by B-1 :

XB + B-1 . N . XN = B-1 b ...... (3)

Lecture-5 Operations Research I 4


Simplex Method
Multiplying Equation (3) by CB and adding to Equation (1):

Eq (3) CB XB + CB . B-1 . N . XN = CB . B-1 . b


Eq (1) Z CB XB CN . XN = 0 +
Z + CB . B-1 . N . XN CN XN = CB . B-1 . b
Z + (CB . B-1 . N CN) XN = CB . B-1 . b ..... (4)

Currently XN = 0 and from Eq. (3) & (4) we get:

XB = B-1 b
Z = CB . B-1 b

Lecture-5 Operations Research I 5


Simplex Method in Tableau

XB XN (Right Hand Side)

Z XB1 ... XBn XN1 ... XNn RHS .. Eq (4)


Z 1 0 0 CB.B-1.N-CN CB.B-1.b Row 0
XB 0 Identity B-1 N B-1 . b Row 1 - m
.. Eq (3)

Lecture-5 Operations Research I 6


Table Explanation
Z as a basic variable to be minimized.
The objective row referred to as row 0 and remaining
rows are rows 1 m.
The RHS column denoted the values of basic variable
(including objective function).
The basic variables identified on the far left column.
The value of objective function CB.B-1.b and basic
variable B-1.b on the RHS.
The cost row gives Zj Cj = CB.B-1.N CN for nonbasic
variables.

Lecture-5 Operations Research I 7


Table Explanation
Row zero will tell problem at optimal solution if
(Zj Cj) 0
If (Zj Cj) > 0 there is XK (maximum (Zj Cj))
YK = B-1.aK is the column under variable XK
If YK 0 Unbounded
If YK > 0 determine the blocking variable by
minimum ratio test.
Then, update basic variables and their value
Update (Zj Cj) values of new nonbasic variables
Update YK columns
Lecture-5 Operations Research I 8
Pivoting

If XK enters basis and XBr leaves basis, then


pivoting on YrK can be stated as follows:
1) Divide row r by YrK
2) For i = 1, 2, ..., m and i r, update the ith row by
adding to it - YrK times the new rth row
3) Update row zero by adding to it CK ZK times
the new rth row.

Lecture-5 Operations Research I 9


Simplex Method in Tableau Form
(Minimization Problem)

INITIALIZATION STEP
Find an initial BFS with basis B.
Form the initial tableau as follow:

Z XB XN RHS
Z 1 0 CB.B-1.N-CN CB.B-1.b

XB 0 I B-1 N B-1 . b

Lecture-5 Operations Research I 10


Simplex Method in Tableau Form
(Minimization Problem)

MAIN STEP
Let ZK CK = Maximum { Zj Cj : j R}
If ZK - CK 0 stop, solution = optimal
If ZK - CK > 0 examine YK
If YK 0 stop, solution = unbounded
If YK > 0 determine index r by minimum ratio test:
br Minimum bi
;Y 0
YrK 1 i m YiK
iK

Update tableau by pivoting at YrK
Update basic and nonbasic variables where XK enters basis and XBr leaves
basis
Repeat the main step

Lecture-5 Operations Research I 11


Example
Min X1 + X2 4X3
s/t X1 + X2 + 2X3 9
X1 + X 2 X 3 2
X 1 + X 2 + X3 4
X1, X2 , X3 0

Min X1 + X2 4X3 + 0S1 + 0S2 + 0S3


s/t X1 + X2 + 2X3 + S1 = 9
X1 + X 2 X 3 + S2 = 2
X 1 + X 2 + X3 + S3 = 4
X1, X2, X3, S1, S2, S3 0
Lecture-5 Operations Research I 12
Example
NonBasic Basic
x x1 x2 x3 s1 s2 s3 The initial basis:

C 1 1 4 0 0 0 B = (S1, S2, S3)


1 1 2 1 0 0
A 1 1 1 0 1 0
1 1 1 0 0 1
9
b 2
4
Lecture-5 Operations Research I 13
Iteration-1

Initial Table

Z X1 X2 X3 S1 S2 S3 RHS
Z 1
S1 0
S2 0
S3 0

Lecture-5 Operations Research I 14


Iteration-1

Initial Table
C 1 1 4 0 0 0

Z X1 X2 X3 S1 S2 S3 RHS
Z 1 -1 -1 4 0 0 0
S1 0
S2 0
S3 0

Lecture-5 Operations Research I 15


Iteration-1

Initial Table 1 1 2 1 0 0
A 1 1 1 0 1 0
1 1 1 0 0 1

Z X1 X2 X3 S1 S2 S3 RHS
Z 1 -1 -1 4 0 0 0
S1 0 1 1 2 1 0 0
S2 0 1 1 -1 0 1 0
S3 0 -1 1 1 0 0 1

Lecture-5 Operations Research I 16


Iteration-1

Initial Table
CB.B-1.b = 0

Z X1 X2 X3 S1 S2 S3 RHS
Z 1 -1 -1 4 0 0 0 0
S1 0 1 1 2 1 0 0
S2 0 1 1 -1 0 1 0
S3 0 -1 1 1 0 0 1

Lecture-5 Operations Research I 17


Iteration-1

Initial Table 9
b 2
Z X1 X2 X3 S1 S2 S3 RHS 4
Z 1 -1 -1 4 0 0 0 0
S1 0 1 1 2 1 0 0 9
S2 0 1 1 -1 0 1 0 2
S3 0 -1 1 1 0 0 1 4

Lecture-5 Operations Research I 18


Iteration-1

Z X1 X2 X3 S1 S2 S3 RHS
Z 1 -1 -1 4 0 0 0 0
S1 0 1 1 2 1 0 0 9
S2 0 1 1 -1 0 1 0 2
S3 0 -1 1 1 0 0 1 4

Lecture-5 Operations Research I 19


Iteration-1

XK

Z X1 X2 X3 S1 S2 S3 RHS
Z 1 -1 -1 4 0 0 0 0
S1 0 1 1 2 1 0 0 9
S2 0 1 1 -1 0 1 0 2
S3 0 -1 1 1 0 0 1 4

YiK

Lecture-5 Operations Research I 20


Iteration-1

XK

Z X1 X2 X3 S1 S2 S3 RHS
Z 1 -1 -1 4 0 0 0 0
S1 0 1 1 2 1 0 0 9
S2 0 1 1 -1 0 1 0 2
XBr S3 0 -1 1 1 0 0 1 4

YrK

Lecture-5 Operations Research I 21


Iteration-2
S3 0 -1 1 1 0 0 1 4

Z X1 X2 X3 S1 S2 S3 RHS
Z 1
S1 0
S2 0
X3 0 -1 1 1 0 0 1 4 No change

Lecture-5 Operations Research I 22


Iteration-2

S2 0 1 1 -1 0 1 0 2

Z X1 X2 X3 S1 S2 S3 RHS
Z 1
S1 0
S2 0 0 2 0 0 1 1 6 + Row3
X3 0 -1 1 1 0 0 1 4

Lecture-5 Operations Research I 23


Iteration-2

S1 0 1 1 2 1 0 0 9

Z X1 X2 X3 S1 S2 S3 RHS
Z 1
S1 0 3 -1 0 1 0 -2 1 -2*Row3
S2 0 0 2 0 0 1 1 6
X3 0 -1 1 1 0 0 1 4

Lecture-5 Operations Research I 24


Iteration-2
Z 1 -1 -1 4 0 0 0 0

Z X1 X2 X3 S1 S2 S3 RHS
Z 1 3 -5 0 0 0 -4 -16 -4*Row3
S1 0 3 -1 0 1 0 -2 1
S2 0 0 2 0 0 1 1 6
X3 0 -1 1 1 0 0 1 4

Lecture-5 Operations Research I 25


Iteration-2

Z X1 X2 X3 S1 S2 S3 RHS
Z 1 3 -5 0 0 0 -4 -16
S1 0 3 -1 0 1 0 -2 1
S2 0 0 2 0 0 1 1 6
X3 0 -1 1 1 0 0 1 4

Lecture-5 Operations Research I 26


Iteration-2

XK

Z X1 X2 X3 S1 S2 S3 RHS
Z 1 3 -5 0 0 0 -4 -16
S1 0 3 -1 0 1 0 -2 1
S2 0 0 2 0 0 1 1 6
X3 0 -1 1 1 0 0 1 4

YiK

Lecture-5 Operations Research I 27


Iteration-2

XK

Z X1 X2 X3 S1 S2 S3 RHS
Z 1 3 -5 0 0 0 -4 -16
XBr S1 0 3 -1 0 1 0 -2 1
S2 0 0 2 0 0 1 1 6
X3 0 -1 1 1 0 0 1 4

YrK

Lecture-5 Operations Research I 28


Iteration-3

Z X1 X2 X3 S1 S2 S3 RHS
Z 1
X1 0 1 -1/3 0 1/3 0 -2/3 1/3 :3
S2 0
X3 0

Lecture-5 Operations Research I 29


Iteration-3

Z X1 X2 X3 S1 S2 S3 RHS
Z 1
X1 0 1 -1/3 0 1/3 0 -2/3 1/3
S2 0 0 2 0 0 1 1 6 No change
X3 0

Lecture-5 Operations Research I 30


Iteration-3

Z X1 X2 X3 S1 S2 S3 RHS
Z 1
X1 0 1 -1/3 0 1/3 0 -2/3 1/3
S2 0 0 2 0 0 1 1 6
X3 0 0 2/3 1 1/3 0 1/3 13/3 +1/3*Row-1

Lecture-5 Operations Research I 31


Iteration-3

Z X1 X2 X3 S1 S2 S3 RHS
Z 1 0 -4 0 0 0 -2 -17 - Row1
X1 0 1 -1/3 0 1/3 0 -2/3 1/3
S2 0 0 2 0 0 1 1 6
X3 0 0 2/3 1 1/3 0 1/3 13/3

Lecture-5 Operations Research I 32


Solution

Since (Zj-Cj) 0 for all nonbasic variables


Then stop, Optimal solution
Where:
(X1, X2, X3) = (1/3, 0, 13/3)
With objective value:
Z = -17

Lecture-5 Operations Research I 33


Homework-2

From Hillier and Liberman 7th edition)


No:
4.3-5
4.3-6
4.4-6 (a, b)
4.4-7 (a, b)
4.4-9

Lecture-5 Operations Research I 34

Вам также может понравиться