Question: Simplex Procedure

I am trying to write my own procedure for the revised simplex method. I have defined my matrix and vectors and obviously my objective function I am trying to optimise. However I am having trouble with programming my entering and leaving variables.

For example I have the sequence 0, -20, 12. I need the smallest positive number i.e. 12 but how do I say this corresponds to the variable x[8] and thus in the simplex method the vector P[8] enters?

If you need any more information or any previous code let me know, thanks!

Please Wait...