Search code examples
algorithmcoordinatescartesian

Place N Point to Minimize Distance to a List of Points


Given a list of points on a 2D plane how could one place N points on the plane in such a way that that the total sum of all distances from the list of points to the closest placed point were as small as possible? The environment is discreet and the list will contain unique points within a range of [(0,0) ; (~200:~100)]

Preferably the algorithm's worst case performance should be polynomial (and thus with the small ranges computational in real time). Any approximations are welcome as well.


Solution

  • This sound really like what K-Means clustering algorithm do. In your case, the list of points are the input, and the number of points N is the number of clusters.

    Sadly, what it does is NP-hard. But there are many researches going on, and a lot ways to try to make it better (just scroll down the wiki page you'll find some).

    Also, I doubt there will be a better algorithm, since k-means is really heavily used by academics. I guess if there is a better algorithm they'd run for that one:)

    And again, I present you the best tutorial in Data Mining for me: Andrew Moore's slides. Although I don't know your purpose, this should be very close to what you need.