之前没用过lingo,这次遇到一个线性整数规划的问题,尝试用了lingo求解,发现上手还是很容易的。将题目和求解放置在此,以便查阅~
问题:
使用lingo求解,输入以下代码
代码语言:javascript复制model:
min=10*x11 10.1*x12 10.2*x13 13.3*x21 13.3*x22 13*x23 15.4*x31 15.8*x32 15.8*x33 7.2*x41 7.6*x42 7.5*x43 4.8*x51 5.3*x52 5.1*x53 4.7*x61 5.3*x62 5.1*x63;
x11 x12 x13=4660;
x21 x22 x33=4660;
x31 x32 x33=4660;
x41 x42 x43=4660;
x51 x52 x53=4660;
x61 x62 x63=4660;
x11 x21 x31 x41 x51 x61=3891;
x12 x22 x32 x42 x52 x62=10375;
x13 x23 x33 x43 x53 x63=13694;
@gin(x11);
@gin(x12);
@gin(x13);
@gin(x21);
@gin(x22);
@gin(x23);
@gin(x31);
@gin(x32);
@gin(x33);
@gin(x41);
@gin(x42);
@gin(x43);
@gin(x51);
@gin(x52);
@gin(x53);
@gin(x61);
@gin(x62);
@gin(x63);
end
其中model: end 为固有格式 @gin为整数约束 点击solve即可求解 若出现错误码11,则说明输入中有中文 若出现错误码72,则说明无解