Minimum distance between n points on a circular track Assume that we have the set $N$, which consists of $n$ points on a circle or other closed 2d track, and that the distances between each point are known. From those $n$ points, distances must be measured counter-clockwise around the track. There must be some point or points $x$ $\epsilon$ $N$ that minimize $d(1,x) + d(2,x) + ... + d(n,x)$. How can I find $x$?
Examples:
 $N = [\frac {\pi} {4}, \frac {7\pi}{4}]$
In order to minimize $d(1,x) + d(2,x)$,  $x= \frac {\pi}{4}$  
$N = [0, \frac \pi2, \pi, \frac {3\pi}{2}]$
To minimize $d(1,x) + d(2,x) + d(3,x) + d(4,x)$, $x=$ any point in $N$
 A: Note: Since you haven't specified a particular distribution of the points, this answer focuses on finding an efficient algorithm for determining the answer given any distribution.
Because of the restriction that distances are measured only in one direction, we can cut and unfold the circular track to produce a straight line. The line can begin with either of the $n$ points. Let $d_k$ be the distance between the $k$th and the consecutive point (note that $d_n$ is the distance between the last and first point). Now the lines can be viewed as being pieced together by the $d$'s. Note the ordering of the $d$'s: When going from investigating one starting point to the next, all we have to do is to take the piece of the line, we just investigated as the starting point, and glue it to the end of line instead, so that the whole line has been shifted. 
Now we want to go about measuring how long each point is from the starting point. To see the pattern, let us take an example where $n=3$ and we put $d_1$ first. The total length is then $$L_1=d_1+(d_1+d_2) + (d_1+d_2+d_3)$$
For $n$ points this then becomes $$L_1=(n-1)d_1+(n-2)d_2+...+2{n-2}+1d_{n-1}+0d_n$$
Note that when we proceed to investigate $L_2$, all we have to do is shift the $d$'s one place to the left (and to the end, with the $0$, if it was at the beginning). This can be generalized and written in the language of matrices as 
$$
        \begin{bmatrix}
        d_1 & d_2 & \cdots & d_{n-1} & d_n \\
        d_2 & d_3 & \cdots & d_{n} & d_1 \\
        \vdots & \vdots & \ddots  & \vdots & \vdots \\
        d_{n-1} & d_n & \cdots & d_{n-1} & d_{n-2} \\
        d_n & d_1 & \cdots & d_{n-2} & d_{n-1} \\
        \end{bmatrix}
\begin{bmatrix}
n-1 \\ n-2 \\ \vdots \\ 1 \\ 0
\end{bmatrix}
=\begin{bmatrix}
L_1 \\ L_2 \\ \vdots \\ L_{n-1} \\ L_n
\end{bmatrix}
$$
Given a list of the distances $d_k$, this list of $L_k$ (and its minimum) is easily calculated by a computer. Matlab, Octave or Mathematica are programs that handle matrix operations well, but many others will do just fine as well. 
I know I took a big leap in the calculations when writing it all on matrix form, but if you are familiar with linear algebra, you can figure it out.
If there's anything that's unclear, please let me know.

EDIT: Here's a Matlab program that'll do the trick: 
clear all; close all; clc;

n = 1000;
d = randi(100,1,n); % placing the points randomly along the track
d = d./sum(d); % array of distances that make up circle of unit length
D = zeros(n);

for i = 0:n-1 % creates the matrix with the distances
    D(i+1,:) = circshift(d,[0,-i]);
end

L = D*flipud([0:n-1]'); % calculates each scenario
k = find(L == min(L)) % finds the distance you should lay first

In this case it calculates the point you should be starting with (k) for a curve with $1000$ points on it. On my laptop it takes about 0.028 seconds. If you want to manually input the distances, just define them as you want in place of the two lines involving d =.
