[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-glpk] 0-ary slice not allowed
From: |
Andrew Makhorin |
Subject: |
Re: [Bug-glpk] 0-ary slice not allowed |
Date: |
Thu, 27 Nov 2008 04:28:16 +0300 |
>>> Just for clarity.
>>> Do you agree that the following notation is meaningless?
>>> sum{(2,3) in E} c[i,j] * x[i,j]
> The following model is correctly solved by GLPK:
> set E := {(2,3)};
> var v{(i,j) in E};
> s.t. con1 {(i,j) in E} : v[i,j] - sum{(2,k) in E : k == j} 1 = 0;
> var w{(i,j) in E};
> s.t. con2 {(i,j) in E} : w[i,j] - sum{(k,3) in E : k == i} 1 = 0;
> solve;
> display v,w;
> Why shoudn't
> s.t. con1 {(i,j) in E} : v[i,j] - sum{(2,3) in E} 1 = 0;
> work?
I do not know what to say. The notation sum{(2,3) in E} is just
mathematically incorrect. It can be written in other, correct ways,
say, sum{(i,j) in E: i = 2 and j = 3} or (if (2,3) in E then ...), so
in this case it is reasonable to follow the principle "Entia non sunt
multiplicanda praeter necessitatem" :)