igraph-help
[Top][All Lists]
Advanced

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

[igraph] RE: your spinglass.community function in the R igraph library


From: Coghlan, Avril
Subject: [igraph] RE: your spinglass.community function in the R igraph library
Date: Sat, 6 Feb 2010 18:39:26 -0000

Dear Gabor, and igraph developers,

Thank you Gabor for your helpful reply about spinglass.community(). That makes 
a lot of sense that it gives different results each time because it is starting 
from different random start-points each time.

By the way, I found spinglass.community() very nice because it returns a vector 
"membership" that tells you which community each vertex belongs to.
I looked at other igraph functions for finding communities (eg. 
fastgreedy.community(), walktrap.community()) and found that they don't seem to 
return any information on which community each vertex is a member of - or at 
least, I couldn't figure out how to infer that information from their output - 
is there a way to do that? (sorry if I am being very slow)

One last thing, I wrote a function that makes a plot of a graph (using 
Rgraphviz) and plots the communities found by spinglass.community() on the 
graph, by colouring in the vertices belonging to each particular community in a 
different colour (eg. one community in red, a second community in green etc.)
Do you think that this function would be useful enough that it would be worth 
including in igraph (or in Rgraphviz)? If so, I would be happy to send you the 
code for my function.

Kind regards,
Avril
Avril Coghlan
University College Cork, Ireland

-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Gábor Csárdi
Sent: 19 January 2010 19:41
To: Coghlan, Avril
Subject: Re: your spinglass.community function in the R igraph library

Dear Avril,

I think you got Jörg's email address wrong, you are supposed to
replace the 'lastname' part with his last name.

On Tue, Jan 19, 2010 at 1:11 PM, Coghlan, Avril <address@hidden> wrote:
> Dear Jorg and Gabor,
>
>
>
> I have been using your spinglass.community() function in the R "igraph"
> library for identifying communities in a network, and am finding it very
> useful.
>
> I noticed that sometimes when I run this function repeatedly on the same
> graph, it gives slightly different answers for the communities.
>
> I am wondering if this is expected?

It is. It is a randomized algorithm, or at least it starts from a
random configuration of spins.

> I imagine that you might be using a random number generator in this
> function, and this is the reason why when you run it again and again on the
> same input graph, it gives slightly different answers each time - is this
> right?

It is perfectly right. The version in the igraph package uses R's
RNG's so if you set the R RNG seed with 'set.seed()', then you should
always get the same results. This is useful if you want to reproduce
things.

Btw. it is better to write to the igraph-help mailing list, than to me
directly, see http://igraph.sf.net for details. Thanks.

Best,
Gabor

>
>
> Regards,
>
> Avril Coghlan
>
> University College Cork, Ireland
>
>



-- 
Gabor Csardi <address@hidden>     UNIL DGM




reply via email to

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