lingo入门代码

其他代码看不懂,然后优化了下代码,发现自己优化后的代码程序能跑,没错,也更容易让我看懂,然后记录下:

sets:
worker /jia yi bing ding/;
work /A B C D/;
matrix(work, worker):t, f;
endsets

data:
t = 15 18 21 24
    19 23 22 18
    26 17 16 19
    19 21 23 17;
enddata

@for(matrix(x,y):@gin(f(x,y)));

min = @sum(matrix(x,y):f(x,y)*t(x,y));

@for(work(j):@sum(worker(i):f(i,j))=1);
@for(worker(i):@sum(work(j):f(i,j))=1);
posted @ 2022-04-13 15:43  小默同学  阅读(339)  评论(0编辑  收藏  举报