7
$\begingroup$

Given a set of points (x,y), I would like to create K clusters of these points similar to the k-means algorithm. The difference is that I would like to define the number of points contained in a cluster, in my situation I would like them to all be equal. For example, take 30 points and put them into 3 sets of 10 points so that the total distance between points in all clusters is minimized. Ideally I would like to implement the solution using R. Thanks for your help!

$\endgroup$
1
  • 3
    $\begingroup$ I don't think this would have a unique solution in some circumstances. It seems very close to asking for quantiles in more than one dimension. Are you sure you really want to constrain the clustering in such a way? (Imagine if you had 11 of the points in the exact same location) In a brief search I was able to turn up this paper, but I could not tell if any R implementation existed. Try checking out the Cran Task view for clustering. $\endgroup$
    – Andy W
    Aug 19 '11 at 20:04
1
$\begingroup$

Give the spatstat package a go - the package was designed by CSIRO for spatial point pattern analysis. There's a very extensive paper going over the use of the package on the CSIRO website.

$\endgroup$
1
$\begingroup$

How different are your cluster sizes with plain k-means ? Take a look at k-means-algorithm-variation-with-equal-cluster-size (Python, not R).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.