简体   繁体   中英

Simplex Algorithm: Initialize-Simplex

I am trying to figure out the simplex algorithm in the book "Introduction to Algorithms, 3rd edition". The procedure "Initial-Simplex" takes as input a standard form, and check if there is an initial basic feasible solution for the standard form. The pseudo code is as following: 在此处输入图像描述

At line 2, it checks if the minimum variable in array b is greater than or equal to 0. If not, it constructs a Laux and conduct a pivot to eliminate the negative variable within b. Then at line 9, it shows the basic solution is feasible for Laux. The question is, what if originally in array b, there are more than one negative variables? For example the origin b is [-2, -1, 3, 1], then at line 1, we have b[k]=-2, so k=0. But after the execution of line 4 to line 9, there is still a negative variable -1 within b. In this case, we cannot say the basic solution is feasible for Laux. In conclusion, there is no mechanism which checks whether all the variables in b are non-negative, and line 4 to line 9 is not within a loop. Does this algorithm assume that less than one negative variable is within b originally?

I checked the algorithm again, and I think I know the reason. For the following example, since -4 is the smallest variable in array b, after a pivot, it becomes 4. Even if there may be other negative variables in b originally, they cannot be smaller than -4, because -4 is the smallest. After we replace x0 with another variable, the bx0 value corresponding to x0 is 4, and we have |4| greater than or equal to any other |bi| in the array which bi < 0. So after a pivot, the new bi must be a non-negative number. For the standard form

maximize 2x1 - x2
subject to
2x1-x2 <= -2
x1 - 5x2 <= -4
x1, x2 >= 0

The slack form is

z = -x0
2x1 - x2 - x0 <= -2
x1 - 5x2 - x0 <= -4
x1, x2, x0 >= 0

And after a pivot,

x0 = 4 + x1 - 5x2 + x4
x3 = -2 - 2x1 -x2 + (4 + x1 - 5x2 + x4)

We can see that -2 + 4 is greater than 0. There won't be any negative variables in b.

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