This is a simple implementation of the simplex method that can be vastly improved with better use of data structures and design. This code is designed to be used for classroom exercises and makes no attempt to be efficient at all.
The overall organization of the code is that we have:
SimplexState
which represents the current vertex and problemSimplexPoint
which represents the KKT information at a pointWe can create a SimplexPoint
from a SimplexState
to understand
the current point.
Then the fundamental iteration is simplex_step
, which moves
from one vertex to another and returns an updated SimplexState
In [1]:
A1 = [-2.0 1;
-1 2;
1 0]
b = [2.0; 7; 3]
A = [A1 eye(3)] # form the problem with slacks.
include("plotregion.jl")
PlotRegion.plotregion(A,b)