The nodes of same color are belong to the same community. The red edges are
edges between different communities.

在 2012年4月5日 下午4:41,Narges Zarrabi <[email protected]>写道:

> Hi,
>
> I am also using the following code, taken from igraph examples (
> http://igraph.sourceforge.net/screenshots2.html#8) , to detect
> communities in networks.
> Could you please let me know what the nodes color and the red color of the
> edges represent in this example? Thanks in advance!
>
> library(igraph)
> g <- read.graph("karate.net", format="pajek")
>
> 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), 10, 20)
> E(g)$color <- "grey"
> E(g)[ V(g)[ color=="lightblue" ] %--% V(g)[ color=="green" ] ]$color <-
> "red"
>
> tkplot(g, layout=layout.kamada.kawai, vertex.label.font=2)
>
> Regards,
> Narges
>
> _______________________________________________
> igraph-help mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>
>
_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help

Reply via email to