简体   繁体   中英

Simplex Method/Linear Programming Help

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM