# Euclidean single facility location problem
# Objective Function: convex
# Constraint Functions: none
var eps >= 1.0e-8;
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:
eps +
sum {i in 1..m, j in 1..n}
w[i,j]*sqrt( eps^2 + 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_vareps.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_vareps.out2;