All pastes #3193514 Raw Edit

Someone

public unlisted text v1 · immutable
#3193514 ·published 2015-10-12 15:34 UTC
rendered paste body
set i /i1*i5/
set j /j1*j5/;

table f(i, j) flow
         j1       j2     j3      j4      j5
i1       5         4      2      3        7
i2       6        10     20      21      12
i3       15        7      2      9       21
i4       10        8      8      13      23
i5        2        4      2       6      21;

parameters
l1(i)     /i1 10
          i2 15
          i3 7
          i4 13
          i5 10/

l2(j)     /j1 10
          j2 15
          j3 7
          j4 13
          j5 21/;


variables
x(i)
y(j)
z;
positive variables
x
y;


equation
obj
const;

obj.. z=e=sum((i,j),f(i,j)*abs(x(i)-y(j)));
const(i,j).. abs(x(i)-y(j))=g=0.5*(l1(i)-l2(j))+10;

model problem /all/;

solve problem using dnlp minimizing z;

display x.l, x.m, y.l, y.m;