编程一部分求帮忙model:sets:si/1..7/;sj/1..5/;sij(si,sj):c,x;sp/1..7/;sq/1..5/;spq(sp,sq):a,b;endsetsdata:c=2 15 13 1 8 10 4 14 15 7 9 14 16 13 8 7 8 11 9 4 8 4 15 8 6 12 4 6 8 13 5 16 8 5 10;a=1 13 10 1 8 10 4 8 10 5 8 6 10 9 6 6 7 1
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/23 14:36:27
编程一部分求帮忙model:sets:si/1..7/;sj/1..5/;sij(si,sj):c,x;sp/1..7/;sq/1..5/;spq(sp,sq):a,b;endsetsdata:c=2 15 13 1 8 10 4 14 15 7 9 14 16 13 8 7 8 11 9 4 8 4 15 8 6 12 4 6 8 13 5 16 8 5 10;a=1 13 10 1 8 10 4 8 10 5 8 6 10 9 6 6 7 1
编程一部分求帮忙
model:
sets:
si/1..7/;
sj/1..5/;
sij(si,sj):c,x;
sp/1..7/;
sq/1..5/;
spq(sp,sq):a,b;
endsets
data:
c=2 15 13 1 8
10 4 14 15 7
9 14 16 13 8
7 8 11 9 4
8 4 15 8 6
12 4 6 8 13
5 16 8 5 10;
a=1 13 10 1 8
10 4 8 10 5
8 6 10 9 6
6 7 11 8 4
6 3 15 8 5
11 4 6 7 10
4 12 6 3 2;
enddata
min =
@for(sij:@bin(x));\x05!限制x为0-1变量;
@for(sj(j):@sum(si(i):x(i,j))=1);\x05
@for(si(i):@sum(sj(j):x(i,j))<=5);\x05
@for(spq:@bin(b));
@for(sq(q):@sum(sp(P):b(p,q))=1);
@for(sp(p):@sum(sq(q):b(p,q))<=5);
还有怎么写限制条件m,n不等?
编程一部分求帮忙model:sets:si/1..7/;sj/1..5/;sij(si,sj):c,x;sp/1..7/;sq/1..5/;spq(sp,sq):a,b;endsetsdata:c=2 15 13 1 8 10 4 14 15 7 9 14 16 13 8 7 8 11 9 4 8 4 15 8 6 12 4 6 8 13 5 16 8 5 10;a=1 13 10 1 8 10 4 8 10 5 8 6 10 9 6 6 7 1
反正没人回,给我吧