已袜前颂悔历知:
n
w
v
tw
maxv=0
for i=0:2^n-1
B=dec2bin(i)
temp_w=0
temp_v=0
for j=1:n
if B(j)=='1'
temp_w=temp_w w[j]
temp_v=temp_v v[j]
end
if (temp_w
Pj 价格,Vj 体积 j=1,。。。,10 Xj 0,1 变世察梁量min z=sum(j, Pj * (1-Xj))
s.t. sum(j, Vj * Xj) <= 2000
Xj取没吵0,搜运1
Matlab:
f = -[1545100705075200902030]
A = [200 350 500 430 320 120 700 420 250 100]
b = 2000
x = bintprog(f,A,b)
Result
x =
0
0
1
0
0
1
1
1
0
1
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)