you can check out k-means clustering algorithm [here][1].

> In data mining, k-means clustering is a method of cluster analysis
> which aims to partition n observations into k clusters in which each
> observation belongs to the cluster with the nearest mean. This results
> into a partitioning of the data space into Voronoi cells.

kmeans-postgresql implementation [here][2].. and i newly meet this topic Spatial clustering with PostGIS , you can check out [here][3] from @Mike Toews with ST_MinimumBoundingCircle function..

![mikey][4]

-----------
![kmeans][5]

i hope it helps you...


  [1]: http://en.wikipedia.org/wiki/K-means_clustering
  [2]: https://github.com/umitanuki/kmeans-postgresql
  [3]: https://gis.stackexchange.com/a/11778/3071
  [4]: https://i.sstatic.net/6i5g9.png
  [5]: https://i.sstatic.net/fqyXu.gif