帮忙看看这段代码!老是报雅克比错误。
model:sets:
wh /1..256/:ver;
h /1..16/;
circulation(h,wh):flow;
endsets
data:
ver=
0 4 5 3 2 5 3 6 3 2 6 3 2 4 1 2
3 0 3 5 2 2 4 5 2 5 2 3 4 6 4 0
3 2 0 4 8 2 5 2 1 3 3 2 4 2 2 2
0 3 5 0 5 2 6 3 4 4 1 2 5 4 2 4
5 4 0 7 0 2 5 2 5 7 3 5 1 4 3 4
5 3 7 4 2 0 3 2 2 4 3 4 2 4 2 1
3 7 2 4 3 2 0 2 3 5 1 2 5 4 3 1
5 2 2 3 3 2 1 0 3 5 3 5 1 3 6 2
2 6 2 3 1 4 2 3 0 3 4 5 1 2 3 5
7 5 2 2 3 1 2 0 5 0 3 6 1 5 4 6
5 3 6 2 1 3 3 4 2 1 0 1 5 3 3 5
2 2 4 1 4 4 3 3 4 7 6 0 2 7 3 4
6 3 1 4 3 2 5 3 4 6 7 4 0 4 2 3
2 2 5 5 5 3 1 2 1 2 5 5 4 0 3 1
2 2 7 2 3 3 3 2 4 4 3 3 5 4 0 4
8 0 4 2 4 2 3 7 6 3 3 2 3 2 2 0
;
enddata
max=@sum(circulation(i,j)|
(@mod(j-1,16) #ne# @floor((j-1)/16) #and# @mod(j-1,16) #ne# (i-1)):flow(i,j));
@for(circulation(i,j)|
(@mod(j-1,16) #eq# @floor((j-1)/16) #or# @mod(j-1,16) #eq# (i-1)):flow(i,j)=0);
@for(wh(j)| @mod(j-1,16) #ne# @floor((j-1)/16):
@sum(h(i)| @mod(j-1,16) #ne# (i-1) : flow(i,j)) <= ver(j));
@for(wh(j)| @mod(j-1,16) #ne# @floor((j-1)/16):
@sum(h(i)| @mod(j-1,16) #ne# (i-1) : flow(i,j)) =
@sum(circulation(m,n)| (m-1) #eq# @mod(j-1,16) #and# @mod(n-1,16) #eq# @floor((j-1)/16):flow(m,n)) );
end
本帖最后由 wahehehehehe 于 2010-11-20 10:46 编辑
坛子里下载的11. 12版都不好用。
找了一个9.0版的不报雅克比错误。但是当问题规模增大,变量数达到24*(24-1)(24-1)=12696时,又开始报错:not enough virtual system memory.
郁闷!:Q
帮你顶一下~ 唉,没人解释啊~ 你的软件问题,我的可以求解出:
Global optimal solution found.
Objective value: 750.0000
Infeasibilities: 0.000000
Total solver iterations: 1108
Variable Value Reduced Cost
VER( 1) 0.000000 0.000000
VER( 2) 4.000000 0.000000
VER( 3) 5.000000 0.000000
VER( 4) 3.000000 0.000000
VER( 5) 2.000000 0.000000
VER( 6) 5.000000 0.000000
VER( 7) 3.000000 0.000000
VER( 8) 6.000000 0.000000
VER( 9) 3.000000 0.000000
VER( 10) 2.000000 0.000000 你的软件问题,我的可以求解出:
Global optimal solution found.
Objective value: 750.0000
Infeasibilities: 0.000000
Total solver iterations: 1108
Variable Value Reduced Cost
VER( 1) 0.000000 0.000000
VER( 2) 4.000000 0.000000
VER( 3) 5.000000 0.000000
VER( 4) 3.000000 0.000000
VER( 5) 2.000000 0.000000
VER( 6) 5.000000 0.000000
VER( 7) 3.000000 0.000000
VER( 8) 6.000000 0.000000
VER( 9) 3.000000 0.000000
VER( 10) 2.000000 0.000000
页:
[1]