If I have a cloud of points on a plane, how can I make them collinear while minimizing translation distance? Say I have n points on a plane which are not collinear. What's the most efficient way to translate each point so that all points are collinear? I want to minimize the sum of the distances traveled.
I'm guessing that taking a linear regression using https://en.wikipedia.org/wiki/Least_absolute_deviations and then moving each point to the line along a perpendicular path is at least a close approximation. Is that the optimal solution though? I'm worried that it may be inaccurate since LAD seems to focus on the y-axis rather than my "distance traveled" metric.
I feel like this must be a solved problem, but maybe I don't have a good enough vocabulary to search for it. No urgency here, I'm just curious.
Edit: an interesting variation is minimizing the max distance, i.e. how does a crowd of people line up ASAP if they're all equally speedy.
 A: ADDED: 
OOps, I did the sum of distance squared problem by mistake, it's much simpler. The sum of distances seems much harder. 
I think it has to do with least squares and factor analysis, but we can try an ad  hoc approach. Below are  some hints. 


*

*First of all, the line must pass through the center of  mass of the points. If not, consider a parallel line passing through the center. One can check that the sum of the squares of distances is decreased. ( there is an elementary geometry formula for that).

*Consider now lines through the center of mass. May assume now this is the origin. The distance from vector $v$ to line with unit direction vector $v$ is 
$$|v|^2 - |\langle v,u\rangle|^2$$
Therefore, we need to find $u$ unit vector so that 
$$\sum_{i=1}^n |\langle v_i,u\rangle|^2 $$is maximum
Open the brackets and get a quadratic form in the components $(u_1, u_2)$ of $u$.  This transforms in the problem of maximizing a quadratic form on a sphere ($S^1$ in this case). There appear eigenvalues and eigenvectors. 
A: For any fixed direction of line, the maximum distance is minimized by placing the line midway between the two antipodal points on the convex hull of the point set. The corresponding distance is half the width of the convex hull in the direction perpendicular to the line. Therefore, the problem is equivalent to finding the direction in which the convex hull has minimum width, and can be solved using the rotating calipers algorithm.
Minimizing the total distance is likely to be harder: if you replace the unknown line with an unknown point, this is the problem of finding the geometric median, which does not have an analytical solution or a direct algorithm. However, an iteratively reweighted least-squares approach may work. Using the notation of the linked article, let $\beta$ be the unknown line and $f_i(\beta)$ the projection of the $i$th point $y_i$ onto it, so that you want to minimize $\sum\|y_i-f_i(\beta)\|$. Iteratively reweighted least-squares will require you to solve subproblems of the form $$\beta^{(t+1)}={\arg\min}_\beta\sum w_i^{(t)}\|y_i-f_i(\beta)\|^2$$ instead, where $w_i^{(t)}=\|y_i-f_i(\beta^{(t)})\|^{-1}$. This you can do using an eigendecomposition, as described in orangeskid's answer (albeit slightly modified to account for the weights $w_i^{(t)})$.
