I'm studying Operations Resarch and the professor give us the following problem:
• There is a 10*10 matrix in which there are 20 villages on random coordinates.
• We have to drop two supply packages (let's say a and b).
• Once a packages are dropped, each village is assigned to the closest package.
The objective is to find Xa,Ya and Xb,Yb in order to minimize the sum of these distances.
The problem is that the model has to be linear (Linear Programming) and with less than 300 variables. I think I found a model but I've used the non-linear distance function.
There's a way to linearize it?
Thanks.
Edit: my current model is:
$ X_1 $= row of the first package
$ Y_1 $= column of the first package
$ X_2 $= row of the second package
$ Y_2 $= column of the secondo package
$ X_vi $= row of the i-village
$ Y_vi $= column of the i-village
forall i from 1 to 20.
define $d_xi$ as the distance of the i-village from the x-package $$ d_1i = sqrt[2]((X_1 - X_vi)^2 + (Y_1 - Y_vi)^2) $$ $$ d_2i = sqrt[2]((X_2 - X_vi)^2 + (Y_2 - Y_vi)^2) $$
logic variables:
$ L_1i $= 1 iif d_1i less than d_2i, 0 otherwise
$ L_2i $= 1 iif d_2i less than d_1i, 0 otherwise
objective function:
minimize: $ \sum_{i=0}^{20} ((d_1i * L_1i) + (d_2i * L_2i)) $
constraints:
$ L_1i + L_2i = 1 \tag 1$
$ (d_2i - d_1i) * L_1i >= 0 \tag 2$
$ (d_1i - d_2i) * L_2i <= 0 \tag 3$
• all the coordinates are contained in {1,2,...,10}
i think this is less-equal-than 300 variables
I would say please give more details on your non linear function.
In general if you function can be expressed as a sum of something linear and something that is non-linear and this non-linear part isn't a dominant part that you can just omit\truncate this non linear part, as long as it remains a distance function. $$d(x,y)=L(x)+NL(x)\quad\text{become}\quad \tilde d(x,y)=L(x)$$
I would call $\tilde d$ an approximation of $d$. However, the distortion created by this linearization may change the final result, which hopefully remains in a range acceptable error, i.e. $$\|d(x,y)-\tilde d(x,y)\|<\epsilon,$$ otherwise I guess you cannot use this trick.