COSC5313
Simplex Algorithm
XB =
B-1
b >= 0
2. Solve Bt l
= CB
for the vector of Simplex Multipliers l (with m elements)
3. Select a column a k of
N such that
pk = CNk - lt
ak
< 0
(Note Relative Cost vector pt =
CNt
-
CBt B-1 N)
We may select the
ak which gives
the smallest negative value of
pk.
If pk >= 0 for every k (m+1
<= k <= n) then stop.
The current solution is optimal.
B y =
ak
(Note XB = B-1 b - B-1
5. Find q
= XBl /
yl = min xBi
/yi for yi > 0
1<=i<=m
If no yi is positive, then the set of solutions
to Ax = b,
x>=0
is unbounded and the objective function can be made an arbitrarily
large
negative number. Terminate the computation in this
case.
xi = xi - q yi , for 1 <= i <= m , i <> l
And, xk = q becomes a new basic variable
and xl becomes a
new
non-basic variable.
For the new
basis, we can compute its inverse instead from the inverse
of
the current basis as
follows:
(B’)-1 =
( - y1/yl , -y2/yl , -y3/yl , +1/yl, …, -ym/yl)
B. 2-Phase Method.: To ensure a
basic solution
Max xm+n+1 = -(
c1x1 +
c2x2
+
c3x3
+… + cnxn )
subject to
(i)
(A+Im)x = b where x is an
(m+n)-vector
(ii)
cx +
xm+n+1 = 0
where x is the original n-vector.
(iii)
n
S Am+2,j
xj + xm+n+2 = bm+2
j=1
where
bm+2 = -(b1+b2+…+bm) and
m
Am+2,j
= - S Ai,j
for j=1,2,…,n.
i=1
(iv)
xj >= 0 for j=1,2,3,…, m+n
c. Example
Original Problem:
min 12 x1+3x2+4x3
subject to
x1+x2 - 2x3 = 10
x1-2x2+3x3 = 20
x1,x2,x3>=0
New Problem:
maximize x6
subject to
x1 + x2 – 2x3 + x4
= 10
x1 – 2x2 + 3x3
+ x5
= 20
12x1
+3x2 + 4x3
+ x6
=
0
-2x1 +x2 -x3
+x7 = -30
x1,x2,x3,x4,x5 >= 0
(In general,
xm+n+1 = -cx
and
xm+n+2 = - (xn+1 + xn+2 + … + xn+m) )
In this revised problem, we have m+2 equations in m+n+2
variables.
During phase-1, we maximize xm+n+2.
If this max is zero, we begin phase-2 to
maximixe xm+n+1
while keeping xm+n+2 at zero.