I have a map of stores for a retailer. I am trying to form clusters (of these stores) such that each member of a cluster is at most 5km away from any other member and any non-member is at least 10 km from any member. I also would like to create a field in the point dataset indicating to which cluster a specific store beongs to. What would be the easiest way to do this? Thanks
As @whuber says, I think you're going to need to relax your criteria, because it won't work as stands. One possible algorithm would be:
- for each point calculate the distance to the nearest other point - in Mapinfo this can be done using the Distance Calculator tool, or in MapBasic
- arrange these distances in descending order
- for the smallest nearest distance, select all points that are within 5km (or whatever parameter you choose) of that point -
- draw a convex hull around these points (a shape that encloses all points)
- remove those points from the list and continue down the descending list of nearest distances, only selecting those points which have not already been made into a convex hull
There are automated routines to do this sort of analysis in packages like ArcGIS or R, but processing time will be significant if you have a large number of points. You will probably have to experiment to get the best results, I don't think it's possible to lay down hard rules about clusters as you have above.