Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 ( [id://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?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-24 21:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found