How would I cluster an unordered list of locations? [duplicate]

怎甘沉沦 提交于 2019-12-10 11:15:18

问题


Possible Duplicate:
Clustering Algorithm for Mapping Application

I have an unordered List of locations (containing their co-ordinates). I know to use the Haversine formula to calculate the distance between two points. But solutions for clustering I've looked at say I'd need to order the list first. What is the correct ordering for locations? I want to cluster (i.e. put all locations into a single clusteredLocation object) all locations which are within 1 metre of each other, is this feasible without sorting first?


回答1:


Actually none of the cluster-analysis algorithms I know requires the points to be ordered. That would somewhat defeat the whole purpose of cluster analysis. But maybe you are more thinking of web2.0 marker-clusterer kind of aggregation?

Have a look at k-means, single-link and DBSCAN. All well described on Wikipedia, with Hub article Cluster Analysis. None of these require your points to be ordered.

Note that Haversine distance is not appropriate for k-means or average-linkage clustering, unless you find a smart way of computing the mean that minimizes variance. Do not use the arithmetic average if you have the -180/+180 wrap-around of latitude-longitude coordinates. Single-linkage, complete-linkage, DBSCAN, OPTICS all should be fine.



来源:https://stackoverflow.com/questions/11085384/how-would-i-cluster-an-unordered-list-of-locations

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!