lingo程序在10行@for(jihe4(i,j)|j#1t#14:x(i,j,3)*x(i,j+1,1)+(1-x(i,j,3))*(1-x(i,j+1,1))=1);错了 求sets:jihe1/1..9/;jihe2/1..14/;jihe3/1..4/;jihe4(jihe1,jihe2);jihe5(jihe1,jihe2,jihe3):x;endsetsmin=@sum(jihe4(i,j):(x(i,j,1)*x(i,j,2)+x(i,j,2)*x(i,j,3))+(x(i,j,3)*x(i,j,4)+x(i,j,4)*x(i,j,1)));@for(jihe4(i,j):@sum(jihe3(k):x(i,j,k))=2);@for(jihe4(i,j)|j#1t#14:x(i,j,3)*x(i,j+1,1)+(1-x(i,j,3))*(1-x(i,j+1,1))=1);@for(jihe4(i,j)|i#1t#9:x(i,j,2)*x(i+1,j,4)+(1-x(i,j,2))
问题描述:
lingo程序在10行@for(jihe4(i,j)|j#1t#14:x(i,j,3)*x(i,j+1,1)+(1-x(i,j,3))*(1-x(i,j+1,1))=1);错了 求
sets:
jihe1/1..9/;
jihe2/1..14/;
jihe3/1..4/;
jihe4(jihe1,jihe2);
jihe5(jihe1,jihe2,jihe3):x;
endsets
min=@sum(jihe4(i,j):(x(i,j,1)*x(i,j,2)+x(i,j,2)*x(i,j,3))+(x(i,j,3)*x(i,j,4)+x(i,j,4)*x(i,j,1)));
@for(jihe4(i,j):@sum(jihe3(k):x(i,j,k))=2);
@for(jihe4(i,j)|j#1t#14:x(i,j,3)*x(i,j+1,1)+(1-x(i,j,3))*(1-x(i,j+1,1))=1);
@for(jihe4(i,j)|i#1t#9:x(i,j,2)*x(i+1,j,4)+(1-x(i,j,2))*(1-x(i+1,j,4))=1);
@for(jihe5(i,j,k):@bin(x(i,j,k)));
end
答
sets:jihe1/1..9/;jihe2/1..14/;jihe3/1..4/;jihe4(jihe1,jihe2);jihe5(jihe1,jihe2,jihe3):x;endsetsmin=@sum(jihe4(i,j):(x(i,j,1)*x(i,j,2)+x(i,j,2)*x(i,j,3))+(x(i,j,3)*x(i,j,4)+x(i,j,4)*x(i,j,1)));@for(jih...