rows/cols/nz | dual | primal | barrier | |
---|---|---|---|---|
model 1 | 1e5/2e5/1.4e6 | 1247 | 857 | 8.7 |
model 2 | 1.1e5/2.1e5/6.1e5 | 195 | 1223 | 7.3 |
The GAMS models look like:
41 variable z,a1(j),a2(j),s1(i),s2(i),y(k);
42 positive variable s1,s2;
43 equation obj,e1(i),e2(k),e3(i);
44
45 option lp=cplex;
46 option iterlim=1000000;
47 option reslim=10000;
48
49 obj.. z =e= sum(i, s1(i)+s2(i));
50 e1(i).. sum(j, xx(i,j)*a1(j)) + s1(i) - s2(i) =e= b(i);
51 model m1 /obj,e1/;
52 solve m1 minimizing z using lp;
53
54 e2(k).. y(k) =e= sum(j, x(k,j)*a2(j));
55 e3(i).. sum(map(i,k), y(k)) + s1(i) - s2(i) =e= b(i);
56 model m2 /obj,e2,e3/;
57 *solve m2 minimizing z using lp;
Note that the SUM in line 55 is actually not a real summation. It just selects a k belonging to a particular i. A different, maybe better, way to write this would be:
equation e3(i,k);
e3(map(i,k)).. y(k) + s1(i) - s2(i) =e= b(i);
No comments:
Post a Comment