# Euclidean single facility location problem
# Objective Function: convex
# Constraint Functions: none
param eps;
param m := 200; # number of existing facilities
param n1 := 5;
param n2 := 5;
param n := n1*n2; # number of new facilities
param a {1..m, 1..2}; # coordinates of existing facility
param w {1..m, 1..n}; # weights associated with old-new connections
param v {1..n, 1..n}; # weights associated with new-new connections
var x {1..n, 1..2};
minimize sumEucl:
sum {i in 1..m, j in 1..n}
w[i,j]*sqrt( eps + sum {k in 1..2} (x[j,k] - a[i,k])^2 )
+
sum {j in 1..n, jj in 1..n: j 0.5}: "%10f %10f \n%10f %10f \n\n",
a[i,1], a[i,2], x[j,1], x[j,2] > emfl_eps.out1;
printf {j in 1..n, jj in 1..n: j < jj}: "%10f %10f \n%10f %10f \n\n",
x[j,1], x[j,2], x[jj,1], x[jj,2] > emfl_eps.out2;