0

Before programming an algorithm which implements the simplex method, I thought I'd solve an issue before the actual programming work begins.

For some reason, I can NEVER get the correct answer. I've understood the method, but the problem is with the row operations - where you try to get a column to have all 0 values except for the pivot element which has a value of '1'.

To do this, I play around with the rows by doing R1-R2, R2+5R1, etc. I always manage to get the pivot column to be 1 and the rest 0's, however my answers never match the correct ones. I've narrowed it down to a problem with the row operations - are there any rules related to this, or can I just play around with the rows as much as I like? Also, can I mix between older tableaux and the current one?

Thanks

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
simplex
  • 1
  • 1
  • 1
    You may want to follow this, for example, http://www.zweigmedia.com/RealWorld/tutorialsf4/framesSimplex.html, and if you could point out specifically what you are working on, it may be easier to answer your question. – James Black May 16 '11 at 00:24

1 Answers1

4

It sounds like you are adding and subtracting arbitrary combinations of rows to get zeros, like you would if you were transforming a matrix to row-reduced echelon form. In the Simplex algorithm, you are only allowed to add a multiple of the pivot row from the other rows.

You should definitely not be using older tableaus in your solution. Each iteration should only involve the current tableau.

Are you implementing this for an educational project? If not, there are many highly tuned libraries for solving linear programs.

japreiss
  • 11,111
  • 2
  • 40
  • 77