[Top][All Lists]
[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:23:38 -0400 |
Hi!
On Tue, Apr 3, 2012 at 10:35 AM, Narges Zarrabi <address@hidden> wrote:
> 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).
What exactly is your question? The algorithm itself is described
briefly in the 'edge.betweenness.community' manual page, and in detail
in the paper that is referred in the manual page.
The object that is returned by the function is also described in the
manual page.
> - I am also using the following code, taken from igraph examples
> (http://igraph.sourceforge.net/screenshots2.html#8) .
I assume you mean screenshot #2. There are no communities in #8.
> I suppose nodes having
> the same color (blue or green) belong to same community ?
That is correct.
> And the red links
> are connections between communities.
Yes.
> 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.
What you do here is not really community detection, just part of it,
because you only take a single step with the leading eigenvector
method. It is very likely that if you apply the method again, then the
community that has nodes on both sides of the plot will be split into
two and you end up with three communities.
Gabor
> 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
>
>
>
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>
--
Gabor Csardi <address@hidden> MTA KFKI RMKI