igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] Detecting communities in networks


From: Narges Zarrabi
Subject: [igraph] Detecting communities in networks
Date: Tue, 3 Apr 2012 16:35:33 +0200

Hi,

I have a network (edgelist.txt file attached) and I am trying to detect communities in that. Through visualization, I can visualy detect two densely connected parts.
- To confirm the existence of visually detected communities, I am using Using edge betweenness in igraph. But I have some difficulties in understanding the information collected through the run of the algorithm. I would appreciate any reference, source or advice to interperate the results.
eb <- edge.betweenness.community(g).

- I am also using the following code, taken from igraph examples (http://igraph.sourceforge.net/screenshots2.html#8) . I suppose nodes having the same color (blue or green) belong to same community ? And the red links are connections between communities. But, I don't understand the appearance of green nodes and red links on the other side of the network. Any advise to for me to understand the results of running this code are very much appreciated.
g <- read.graph("edgelist.txt" , format ="edgelist", directed = T)
g<-delete.vertices(g, 0)

cs <- leading.eigenvector.community.step(g)
V(g)$color <- ifelse(cs$membership==0, "lightblue", "green")

scale <- function(v, a, b) {
  v <- v-min(v) ; v <- v/max(v) ; v <- v * (b-a) ; v+a
}

V(g)$size <- scale(abs(cs$eigenvector), 2, 12)
E(g)$color <- "grey"
E(g)[ V(g)[ color=="lightblue" ] %--% V(g)[ color=="green" ] ]$color <- "red"
plot(g,layout=layout.fruchterman.reingold, vertex.label= "", edge.arrow.size=0.2)

Thanks in advance!

~Narcis




Attachment: edgelist.txt
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]