I would like to prepare some stats based on clusters made by cluster_label_prop() method. When I use authority_score() and induced_subgraph() within a loop, it shows weak performance and I am looking for a workaround to speed up the code. My network contains approx. 3.000.000 edges and 250.000 clusters. I think calculation of these measure for the clusters without the loop could be a good point, however I didn't find a way in the docs for this.
library("igraph")
library("plyr")
setwd("C:/Projects/R/igraph")
g_in = read.csv("my_network.csv", sep=" ")
g = graph.data.frame(g_in, directed=FALSE)
clust = groups(cluster_label_prop(g, weights=E(g)$weight))
clust_count <- length(clust)
clustm <- as.matrix(ldply((clust), data.matrix))
clustm1 <- clustm[clustm[, ".id"] == 1, 2]
g_sub = induced_subgraph(g, clustm1)
auth_scr = as.matrix(authority_score(g_sub)$vector)
for (i in 2:clust_count) {
g_sub = induced_subgraph(g, clustm[clustm[, ".id"] == i, 2])
auth_scr = rbind(as.matrix(auth_scr), as.matrix(authority_score(g_sub)$vector))
}