Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Sorting by geographical proximity / clumping groups of items based on X and Y

by bedk (Pilgrim)
on Jul 18, 2002 at 17:40 UTC ( #182929=note: print w/replies, xml ) Need Help??


in reply to Sorting by geographical proximity / clumping groups of items based on X and Y

You're describing a clustering problem. If you know how many clumps you want to end up with, you can run a k-means clustering algorithm, which is just a mathematical formulation of Notromda's suggestion. Because you have a desired maximum distance, you can choose the number of clusters (K) by starting with K=1, and running k-means clustering. If the distance between elements in any cluster is too big, increment K and recluster. Iterate until until all clusters meet the maximum distance criterion.

Brian
  • Comment on Re: Sorting by geographical proximity / clumping groups of items based on X and Y

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://182929]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2022-12-08 02:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?