lingo求解0-1整数

来源:百度知道 编辑:UC知道 时间:2024/09/19 19:23:27
程序应该怎么写啊???
matlab中的bintprog该怎么解决0-1?
建模中用到的

min f'*X subject to: A*X <= b,
Aeq*X = beq,
where the elements of X are binary
integers, i.e., 0's or 1's.

f = [-9; -5; -6; -4];
A = [6 3 5 2; 0 0 1 1; -1 0 1 0; 0 -1 0 1];
b = [9; 1; 0; 0];
X = bintprog(f,A,b,[],[])
Optimization terminated.

X =

1
1
0
0

lingo中限制变量为0-1变量命令@bin