首先数学建模
设需要x1+x2+x3+x4+x5+x6个人
依题意列方程组
X1=60
X1+X2=70
X2+X3=60
X3+X4=50
X4+X5=20
X5+X6=30
然后用LINDO求解模型
打开LINDO
输入以下代码
MIN X1+X2+X3+X4+X5+X6
SUBJECT TO
X1=60
X1+X2=70
X2+X3=60
X3+X4=50
X4+X5=20
X5+X6=30
END
编译 求解得
LP OPTIMUM FOUND AT STEP 4
OBJECTIVE FUNCTION VALUE
1) 150.0000
VARIABLE VALUE REDUCED COST
X1 60.000000 0.000000
X2 10.000000 0.000000
X3 50.000000 0.000000
X4 0.000000 0.000000
X5 30.000000 0.000000
X6 0.000000 0.000000
ROW SLACK OR SURPLUS DUAL PRICES
2) 0.000000 0.000000
3) 0.000000 -1.000000
4) 0.000000 0.000000
5) 0.000000 -1.000000
6) 10.000000 0.000000
7) 0.000000 -1.000000
NO. ITERATIONS= 4
RANGES IN WHICH THE BASIS IS UNCHANGED:
OBJ COEFFICIENT RANGES
VARIABLE CURRENT ALLOWABLE ALLOWABLE
COEF INCREASE DECREASE
X1 1.000000 INFINITY 0.000000
X2 1.000000 0.000000 1.000000
X3 1.000000 0.000000 1.000000
X4 1.000000 INFINITY 0.000000
X5 1.000000 0.000000 1.000000
X6 1.000000 INFINITY 0.000000
RIGHTHAND SIDE RANGES
ROW CURRENT ALLOWABLE ALLOWABLE
RHS INCREASE DECREASE
2 60.000000 0.000000 60.000000
3 70.000000 INFINITY 0.000000
4 60.000000 0.000000 INFINITY
5 50.000000 INFINITY 0.000000
6 20.000000 10.000000 INFINITY
7 30.000000 INFINITY 10.000000
最优解是X1=60 X2=10 X3=50 X4=0 X5=30 X6=0
所以至少需要150人
复制到WROD中应该不用我教了吧!!!
取消
评论