utilizzare il pacchetto IGRAPH per R: http://igraph.sourceforge.net/doc/R/fastgreedy.community.html questo implementa un algoritmo veloce per accertamento comunità utilizzando il metodo modularità massimizzazione del Newman-Girvan.
il codice sarà simile a questa:
library(igraph)
# read graph from csv file
G<-read.graph("edgelist.txt", format="ncol")
fgreedy<-fastgreedy.community(G,merges=TRUE, modularity=TRUE)
memberships <-community.to.membership(G, fgreedy$merges, steps=which.max(fgreedy$modularity)-1)
print(paste('Number of detected communities=',length(memberships$csize)))
# Community sizes:
print(memberships$csize)
# modularity:
max(fgreedy$modularity)
Si può anche provare su stats.stackexchange.com. – mbq
@mbq: fantastico, molte grazie. lo proverò :) – laramichaels
Sembra funzionasse ;-) – mbq