SETS:
nodi/1..24/;
 
archi(nodi,nodi)/
1, 2, 1, 4, 1, 5,
 2, 3, 2, 5, 2, 6,
 3, 6, 3, 9, 3, 15,
 4, 5, 4, 8,
 5, 6, 5, 7, 5, 8, 5, 10,
 6, 7, 6, 9, 
7, 9, 7, 10,
 8, 10, 8, 11, 8, 13, 8,  20,
 9, 10, 9, 12, 
10, 11, 10, 12, 10, 14,
 11, 13, 11, 14, 
12, 14, 12, 15,   12, 19,
 13, 14, 13, 16, 13, 17, 13, 20,
 14, 16, 14, 18, 14, 19, 
15, 19,
 16, 17, 16, 18, 16, 23,
 17, 20, 17, 21, 17, 23, 
18, 19, 18, 22, 18, 23,    18, 24,
 19, 22, 
20, 21, 
21, 23, 
22, 24, 
23, 24
/:c, x1,x2,d;
 
 
 
ENDSETS
 
DATA:
c= 73, 5, 53, 48, 92, 45, 97, 22, 97, 10, 44, 43, 5, 49, 86, 73, 94, 71, 
    85, 78, 71, 23, 29, 72, 74, 53, 77, 69, 6, 22, 98, 90, 82, 86, 19, 66,
  64, 26, 36, 97, 75, 5, 51, 51, 77, 76, 37, 47, 100, 68, 1, 98, 2, 64, 44, 
    56;
 
d= 49, 80, 53, 50, 56, 67, 55, 142, 293, 106, 103, 71, 50, 116, 116, 54, 
 88, 70, 88, 92, 105, 164, 239, 95, 117, 54, 138, 119, 72, 85, 91, 35, 80, 
   63, 63, 46, 82, 32, 52, 95, 49, 45, 29, 54, 48, 39, 61, 68, 50, 40, 38, 
   33, 36, 44, 30, 36;
 
  
source=1;sink=24;
 
ENDDATA
 
 
 min= cc;
 
  
 
cc=@SUM(archi: c*x1)+@SUM(archi: c*x2);
 
dist=@SUM(archi:d*x1)+@SUM(archi:d*x2);
 
 dist< 400;
 
 
@FOR(nodi(i)|(i#NE#source)#AND#(i#NE#sink):[v]
     @SUM(archi(i,j):x1(i,j)) - @SUM(archi(i,j): x2(i,j)) -
     @SUM(archi(j,i): x1(j,i)) + @SUM(archi(j,i):x2(j,i)) = 0 );
 
@FOR(nodi(i)|(i#EQ#source) :[v]
     @SUM(archi(i,j):x1(i,j)) - @SUM(archi(i,j): x2(i,j)) -
     @SUM(archi(j,i):  x1(j,i)) + @SUM(archi(j,i):x2(j,i)) = 1 );
 
@FOR(archi:@GIN(x1);@GIN(x2));