Consider the Linear Program:
” Minimize
where
and
Consider a vector
It has a Basis
The corresponding columns in
Thus
Now apply the Optimality Condition in Linear Programming
which simplifies to:
if and only if
Otherwise, find an index such that
(usually the most negative one).
Then find
If they are all negative the problem is unbounded.
Now pivot around
i.e. use row operations to make the
Note that these operations will preserve
Now by swapping columns we have arrived at the same form as the starting problem.
Repeat these steps until done.
Two-phase algorithm
If our initial problem is not of the desired form, we do two phases, as follows.
Phase 1
Suppose we are given the problem of minimizing
We can WLOG take
First consider the problem of minimizing
Now this is of the form
so we can apply the Simplex method.
This has to terminate at a solution
But now
Now, given that we also tracked the
we are sure to have a good setup for Phase 2.
Phase 2
We can remove
now only looking at