igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] : Infomap


From: Tamas Nepusz
Subject: Re: [igraph] : Infomap
Date: Thu, 27 Nov 2014 12:35:23 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

Assuming that you (still) work in C or C++, the membership vector that
igraph_community_infomap returns contains the index of the community each
vertex belongs to. So, if you are interested in the vertices belonging to
community X, you have to look for the indices of the elements that area equal
to X in the membership vector. You can their access their names the usual way
with the VAS macro:

http://igraph.org/c/doc/igraph-Attributes.html#VAS

If you work in R, take a look at the $membership component of the community
structure that the algorithm returned. If you work in Python, just treat the
community structure as a list and index it with the identifier of the community
you are interested in; e.g.:

>>> cl = g.community_infomap()
>>> cl[0]         # gives you the vertices in community 0
>>> g.vs[cl[0]]["name"]   # gives you the names of the vertices in community 0

On 11/27, patricia wrote:
> Hello,
> I would like your help to solve the following problem, using the Infomap 
> communities detection algorithm:
> Suppose that after the execution of the algorithm, four communities have been 
> reported, for example, the first three community has vertices, second 6, 
> third 8 and the fourth second.
> I want to know, how do I access the 3 vertices (nodes) contained within the 
> community 1 to then access their labels of the vertices belonging to the same 
> community.
> Example: Community 1 => V1, V2 and V3
> labels:
> V1 = 1;V2 = 1;V3 = 2;
> 
> Thank you
>                                         

> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help


-- 
T.



reply via email to

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