![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Lingo
weixin_45622770
这个作者很懒,什么都没留下…
展开
-
TSP问题
model: sets: city/1..280/:u; !定义280个点; link(city,city):dist,x; !dist 为距离矩阵 x为决策变量; endsets data: dist =@OLE('C:\Users\86185\A题\cij.xlsx','cij'); @OLE('C:\Users\86185\A题\最优路线.xlsx','最优路') = x; enddata n = @size(city); !目标函数; min = @sum(link(i,j):dist(i.原创 2021-07-28 10:06:07 · 78 阅读 · 0 评论 -
目标规划lingo
!求第一级目标; model: sets: value/1..2/:x; !x为变量; num/1..4/:g,dz,df; !g为柔性约束等号右侧目标值,dz为正偏差变量,df为负偏差变量; cost(num,value):c; !c为柔性约束系数值; endsets data: g = 1500 0 16 15; c = 200 300 2 -1 4 0 0 5; enddata min = df(1); 2*x(1) + 2*x(2) <=12;!刚性约..原创 2021-07-22 22:46:55 · 1947 阅读 · 0 评论 -
分配问题lingo
例题效率矩阵cost为: model: sets: worker/1..7/; job/1..7/; coo(worker,job):c,x; endsets data: c =6 2 6 7 4 2 5 4 9 5 3 8 5 8 5 2 1 9 7 4 3 7 6 7 3 9 2 7 2 3 9 5 7 2 6 5 5 2 2 8 11 4 9 2 3 12 4 5 10; enddata !目标函数; min = @sum(coo(i,j):c(i,j)*x(i,j)); !工作约束; @fo.原创 2021-07-22 20:39:41 · 780 阅读 · 0 评论 -
运输问题lingo
model: sets: factory/1..6/: e; plant/1..8/: d; coo(factory,plant): x,c; endsets data: e = 60 55 51 43 41 52; d = 35 37 22 32 41 32 43 38; c = 6 2 6 7 4 2 9 5 4 9 5 3 8 5 8 2 5 2 1 9 7 4 3 3 7 6 7 3 9 2 7 1 2 3 9 5 7 2 6 5 5 5 2 2 8 1 4 3; enddata !目标函数..原创 2021-07-22 20:18:34 · 764 阅读 · 0 评论 -
线性规划(LP问题)
代码: min = 2*x1 + 3*x2; x1 + x2 >= 350; x1 >= 100; 2*x1 + x2 <= 600;原创 2021-07-22 19:58:41 · 343 阅读 · 0 评论 -
lingo线性规划
model: sets: factory /1..6/ : a; plant /1..8/ : d; Cooperation(factory,plant) : c, x; endsets data: a=60,55,51,43,41,52; d=35,37,22,32,41,32,43,38; c=6,2,6,7,4,2,5,8 4,9,5,3,8,5,8,2 5,2,1,9,7,4,3,3 7,6,7,3,9,2,7,1 2,3,9,5,7,2,6,5 5,5,2,2,8,1,4,.原创 2021-07-21 18:42:07 · 267 阅读 · 0 评论