model: sets: demand/1..1000/:; supply/1..100/:d; link(demand,supply):a,c,x; endsets min=@sum(link(demand,supply):a(i,j)*x(i,j)); a=@if(c#gt#0,c,0); data: d=10 40 15 20 20 12 30 33 35 25 29 31 28 61 2 28 28 26 31 38 34 29 35 22 29 81 1 19 25 41 29 35 1 40 39 5 106 30 29 2 110 6 15 36 34 11 32 25 2 64 40 26 33 26 61 2 11 38 44 36 27 31 42 44 12 81 10 35 33 30 2 40 15 11 28 24 20 88 9 28 31 8 22 3 70 21 34 4 38 27 39 28 24 15 50 24 36 55 2 40; c=@ole('table.xls'); enddata @for(demand(i) sum(supply(j):x(i,j))<=d(j);); @for(supply(j) sum(demand(i):x(i,j))<=3;); @for(demand(i) for(supply(j) bin(x(i,j)))); end
|