数学中求解整数规划在matlab中怎么使用

如题所述

第1个回答  2016-12-11
少年,用专业的数学规划软件吧,比如说lingo。
! The code is about PILP;
MAX=X-2*Y;

X>=1;X<=2;

Y>=3;Y<=4;

@GIN(X);@GIN(Y);
答案在这里哦!‍

Global optimal solution found.

Objective value: -4.000000

Objective bound: -4.000000

Infeasibilities: 0.000000

Extended solver steps: 0

Total solver iterations: 0

Elapsed runtime seconds: 0.64

Model Class: PILP

Total variables: 2

Nonlinear variables: 0

Integer variables: 2

Total constraints: 5

Nonlinear constraints: 0

Total nonzeros: 6

Nonlinear nonzeros: 0

Variable Value Reduced Cost

X 2.000000 -1.000000

Y 3.000000 2.000000

Row Slack or Surplus Dual Price

1 -4.000000 1.000000

2 1.000000 0.000000

3 0.000000 0.000000

4 0.000000 0.000000

5 1.000000 0.000000本回答被提问者采纳
相似回答