用大M法求解下列线性规划问题: 约束条件:max z=5x1+x2+3x3; x1+4x2+2x2>=10, x1-2x2+x3<=16, x1,x2,x3>=0.
时间: 2024-01-01 11:06:52 浏览: 185
将约束条件转换为标准形式:
max z = 5x1 + x2 + 3x3
s.t.
4x1 + 2x2 - x4 = 10
x1 - 2x2 + x3 + x5 = 16
x1, x2, x3, x4, x5 >= 0
引入人工变量,得到初始可行解:
max z = 5x1 + x2 + 3x3 + Mx6 + Mx7
s.t.
4x1 + 2x2 - x4 + x6 = 10
x1 - 2x2 + x3 + x5 + x7 = 16
x1, x2, x3, x4, x5, x6, x7 >= 0
由于M越大,人工变量的价值越低,因此将M取一个极大值,如M=1000,得到以下初始单纯形表:
| | x1 | x2 | x3 | x4 | x5 | x6 | x7 | RHS |
|---|----|----|----|----|----|----|----|-----|
| | 1 | 0 | 0 | 0 | 0 | 1000 | 0 | 10 |
| | 0 | 1 | 0 | 0 | 0 | 0 | 1000 | 0 |
| | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 16 |
| | 4 | 2 | 0 | -1 | 0 | 1 | 0 | 10 |
| | 1 | -2 | 1 | 0 | 1 | 0 | 0 | 16 |
| z | -5 | -1 | -3 | 0 | 0 | 0 | 0 | 0 |
由于z的系数为负,需要进行转轴操作。选取x2和x7进行转轴,使得x7的系数为1:
| | x1 | x2 | x3 | x4 | x5 | x6 | x7 | RHS |
|---|----|----|----|----|----|----|----|-----|
| | 1 | 0 | 0 | 0 | 0 | 1000 | 0 | 10 |
| | 0 | 1 | 0 | 0 | 0 | 0 | 1000 | 0 |
| | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 16 |
| | 4 | 0 | -2 | -1 | 2 | 1 | -2 | 10 |
| | 1 | 0 | 1 | 0 | 1 | 0 | 2 | 16 |
| z | -5 | 0 | -4 | 0 | -1 | 0 | 1 | -160 |
继续进行转轴操作,选取x2和x6进行转轴,使得x6的系数为1:
| | x1 | x2 | x3 | x4 | x5 | x6 | x7 | RHS |
|---|----|----|----|----|----|----|----|-----|
| | 1 | 0 | 0 | 0 | 500 | 500 | -500 | 2580 |
| | 0 | 1 | 0 | 0 | -250 | 250 | 250 | -1290 |
| | 0 | 0 | 1 | 0 | 125 | -125 | -125 | 645 |
| | 0 | 0 | 0 | 1 | 375 | -375 | -375 | 1925 |
| | 0 | 0 | 0 | 0 | 250 | -250 | -250 | 1290 |
| z | 0 | 0 | 0 | 0 | -2500 | 2500 | 2500 | 12900 |
最终得到最优解为z=12900,x1=2580,x2=1290,x3=645,x4=1925,x5=x6=x7=0。
阅读全文