min -x2 + 2x3subject to x1 -2x2 + x3 = 2 x2 -3x3 + x4 = 8 x2-x3+x5=2 x1, x2, x3, x4, x5 >= 0用上面的程序求解这个问题并画出每一步程序单纯形表
时间: 2023-12-06 16:44:08 浏览: 88
把问题转化为标准形式:
max x2 - x3 - x5
subject to x1 -2x2 + x3 + 0x4 + 0x5 = 2
0x1 + x2 -3x3 + x4 + 0x5 = 8
0x1 + x2 -x3 + 0x4 + x5 = 2
x1, x2, x3, x4, x5 >= 0
初始单纯形表:
| BV | x1 | x2 | x3 | x4 | x5 | b |
|----|-----|-----|-----|-----|-----|-------|
| x4 | 0 | 0 | -3 | 1 | 0 | 8 |
| x5 | 0 | 1 | -1 | 0 | -1 | 2 |
| x6 | 1 | -2 | 1 | 0 | 0 | 2 |
| | z | 1 | -1 | 0 | -1 | 0 |
第一次迭代:
| BV | x1 | x2 | x3 | x4 | x5 | b |
|----|-----|-----|-----|-----|-----|-------|
| x4 | 0 | 0 | -3 | 1 | 0 | 8 |
| x5 | 0 | 1 | -1 | 0 | -1 | 2 |
| x6 | 1 | -2 | 1 | 0 | 0 | 2 |
| x1 | 0 | -2 | 1 | 0 | 0 | 2 |
| | z | 1 | -1 | 0 | -1 | 0 |
第二次迭代:
| BV | x1 | x2 | x3 | x4 | x5 | b |
|----|-----|-----|-----|-----|-----|-------|
| x4 | 0 | 0 | 0 | 1 | 3 | 10 |
| x5 | 0 | 1 | 0 | 0 | 2 | 4 |
| x6 | 1 | 0 | 0 | 0 | 1 | 4 |
| x1 | 0 | 0 | 1 | 0 | 2 | 6 |
| | z | 0 | -1 | 0 | -3 | -4 |
最优解为 z = -4,x1 = 6,x2 = 0,x3 = 0,x4 = 10,x5 = 4。
每一步的单纯形表如下:
初始单纯形表:
| BV | x1 | x2 | x3 | x4 | x5 | b |
|----|-----|-----|-----|-----|-----|-------|
| x4 | 0 | 0 | -3 | 1 | 0 | 8 |
| x5 | 0 | 1 | -1 | 0 | -1 | 2 |
| x6 | 1 | -2 | 1 | 0 | 0 | 2 |
| | z | 1 | -1 | 0 | -1 | 0 |
第一次迭代:
| BV | x1 | x2 | x3 | x4 | x5 | b |
|----|-----|-----|-----|-----|-----|-------|
| x4 | 0 | 0 | -3 | 1 | 0 | 8 |
| x5 | 0 | 1 | -1 | 0 | -1 | 2 |
| x6 | 1 | -2 | 1 | 0 | 0 | 2 |
| x1 | 0 | -2 | 1 | 0 | 0 | 2 |
| | z | 1 | -1 | 0 | -1 | 0 |
第二次迭代:
| BV | x1 | x2 | x3 | x4 | x5 | b |
|----|-----|-----|-----|-----|-----|-------|
| x4 | 0 | 0 | 0 | 1 | 3 | 10 |
| x5 | 0 | 1 | 0 | 0 | 2 | 4 |
| x6 | 1 | 0 | 0 | 0 | 1 | 4 |
| x1 | 0 | 0 | 1 | 0 | 2 | 6 |
| | z | 0 | -1 | 0 | -3 | -4 |
阅读全文