igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Detecting communities in networks


From: Gábor Csárdi
Subject: Re: [igraph] Detecting communities in networks
Date: Thu, 5 Apr 2012 09:33:42 -0400

On Thu, Apr 5, 2012 at 4:41 AM, Narges Zarrabi <address@hidden> wrote:
> 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!

I answered this in your other email, but just for te records and the
mailing list archive:

Node colors represent community membership. Red edges go between communities.

Gabor

> 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
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>



-- 
Gabor Csardi <address@hidden>     MTA KFKI RMKI



reply via email to

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