118 Optimization: Algorithms and Applications
Writing the modied objective function in terms of the nonbasic variables
using the rst and second constraint equations:
y
1
+ y
2
= 13 − 5x
1
+ 2x
2
+ x
3
This can also be done using the formula
ˆ
c c y N
N
T
N
T T
= − (4.33)
where
y c B
T
B
T
=
−1
(4.34)
By executing the MATLAB code (initial_cost.m), the cost coefcients for the
nonbasic variables can be obtained as
(-5, 2, 1)
With a minor modication of the MATLAB code (simplex.m), phase I code is
written in phase1.m. On executing the code, the following output is displayed
on the command window.
─────────────────────────────────────────
basic_set = 5 6 4
nonbasic_set = 1 2 3
Initial_Table =
1 0 0 3 2 0 10
0 1 0 2 -4 -1 3
0 0 1 3 4 0 16 ...