Find the Point Which Minimizes the Sum of Distance to Given Points

874 Views Asked by At

Part 1:

Given $n$ points $(x_1,y_1), \ldots, (x_n,y_n)$ on the plane, apply calculus tools to find equations on the point $(x,y)$ that minimizes the sum of distances from $(x,y)$ to the given points. You should formulate your answer in terms of vectors $r_1,r_2,\ldots,r_n$, where $r_i$ is the unit vector that points from $(x,y)$ to $(x_i,y_i)$ for all $i=1,2,\ldots,n$.

Diagram

I have tried to solve this part by finding the vector equations of the 5 points, where 2 diagonals intersect. For Eg, To find vector AC, it is the sum of AO and OC, which is in unit vector form according to the diagram, -r1+r3 .

AC= -r1 +r3 BD= -r2 + r4 CE= -r3 + r5 DA= -r4 + r1 EB= -r5 + r2

This forms like a irregular Pentagon. So, how do i find a point which minimises the sum of distances from the vertices of the pentagon?

But i do not know if this is the correct way to go about coz I had great difficulty to start with the question. Hence, it would be very helpful if you could help me with starting the question, if my method is wrong. Thank you :)

1

There are 1 best solutions below

2
On

Let's solve the Math and then think about the expected result.

Defining the matrix:

$$ A = \begin{bmatrix} {x}_{1} & {y}_{1} \\ {x}_{2} & {y}_{2} \\ \vdots & \vdots \\ {x}_{n} & {y}_{n} \end{bmatrix} $$

Then the problem is given by:

$$ \arg \min_{p} \frac{1}{2} {\left\| \boldsymbol{1} {p}^{T} - A \right\|}_{F}^{2} $$

Where $ p \in \mathbb{R}^{2} $ and $ \boldsymbol{1} \in \mathbb{R}^{n} $ with $ \boldsymbol{1} = {\left[ 1, 1, \ldots, 1 \right]}^{T} $.

The above is a convex problem with respect to $ p $.
The Gradient is given by:

$$\begin{align*} \frac{\partial {\left\| \boldsymbol{1} {p}^{T} - A \right\|}_{F}^{2} }{\partial p} & = \left( x \boldsymbol{1}^{T} - {A}^{T} \right) \boldsymbol{1} \\ & \Rightarrow \frac{\partial {\left\| \boldsymbol{1} {p}^{T} - A \right\|}_{F}^{2} }{\partial p} = 0 \\ & \Rightarrow p = {\left( \boldsymbol{1}^{T} \boldsymbol{1} \right)}^{-1} {A}^{T} \boldsymbol{1} \end{align*}$$

What's the meaning of the result?
Well, it is the expected solution as $ {\left( \boldsymbol{1}^{T} \boldsymbol{1} \right)}^{-1} = \frac{1}{n} $ and $ {A}^{T} \boldsymbol{1} $ is basically the summation of elements.
So basically the solution is given by the point which is the mean of all given points.

This is expected as we now that the mean value is the value which minimizes the $ {L}_{2} $ Distance.