Find point which sum of distances to set of other points is minimal
Posted
by
Pawel Markowski
on Stack Overflow
See other posts from Stack Overflow
or by Pawel Markowski
Published on 2011-01-05T22:27:04Z
Indexed on
2011/01/06
1:54 UTC
Read the original article
Hit count: 279
I have one set (X) of points (not very big let's say 1-20 points) and the second (Y), much larger set of points. I need to choose some point from Y which sum of distances to all points from X is minimal.
I came up with an idea that I would treat X as a vertices of a polygon and find centroid of this polygon, and then I will choose a point from Y nearest to the centroid. But I'm not sure whether centroid minimizes sum of its distances to the vertices of polygon, so I'm not sure whether this is a good way? Is there any algorithm for solving this problem?
Points are defined by geographical coordinates.
© Stack Overflow or respective owner