Reputation: 797
I have a series of points (long, lat)
1) Found the haversine distance between all the points 2) Saved this to a csv file (source, destination, weight) 3) Read the csv file and generated weighted a graph (where weight is the haversine distance) 4) Used igraphs community detection algorithm - fastgreedy
I was expecting clusters with low distance to be highly each other, I was expecting something similar to kmeans (without the distinct partitions in space) but there was no order in my results.
Question: Why does the community detection algorithm not give me results similar kmeans clustering? If im using the same points/ distances between points then why is there so much overlap between the communities? I'm just looking for some intuition as to why this isnt work as I expected.
Thanks
Upvotes: 1
Views: 422
Reputation: 48071
Your approach doesn't work because the fast greedy community detection expects similarities as weights, not distances.
(Actually, this is probably only one of the reasons. The other is that the community detection algorithms in igraph were designed for sparse graphs. If you have calculated all the distances between all pairs of points, your graph is dense, and these algorithms will not be suitable).
Upvotes: 1