早教吧 育儿知识 作业答案 考试题库 百科 知识分享

lingo程序错了...model:sets:renshu/1..4/:x,v;xianliang/1..4/:b;link(xianliang,renshu):a;endsetsdata:v=1,1,1,1;b=21,18,16,29;a=1,1,0,0,0,1,1,0,0,0,1,1,1,0,0,1;enddatamin=@sum(renshu:x*v);@for(xianliang(i):@sum(renshu(j):a(i,j)*x(j))

题目详情
lingo程序错了...
model:
sets:
renshu/1..4/:x,v;
xianliang/1..4/:b;
link(xianliang,renshu):a;
endsets
data:
v=1,1,1,1;
b=21,18,16,29;
a=1,1,0,0,0,1,1,0,0,0,1,1,1,0,0,1;
enddata
min=@sum(renshu:x*v);
@for(xianliang(i):
@sum(renshu(j):a(i,j)*x(j))
▼优质解答
答案和解析
语法上倒是没什么错误 数据也不必非要按行写
model:
sets:
renshu/1..4/:x,v;
xianliang/1..4/:b;
link(xianliang,renshu):a;
endsets
data:
v=1,1,1,1;
b=21,18,16,29;
a=1,1,0,0,0,1,1,0,0,0,1,1,1,0,0,1;
enddata
min=@sum(renshu:x*v);
@for(xianliang(i):
@sum(renshu(j):a(i,j)*x(j))