Finding Least-Distances Lines

We consider the following problem related to both location theory and statistical linear regression. Given n points in the plane find a straight line L so as to minimize the weighted sum of the distances of the points to L relative to either the Euclidean metric or the $l_1 $-metric. We present $O ( n^2 \log n )$ and $O ( n\log ^2 n )$ time algorithms for the Euclidean and rectilinear cases, respectively.