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 > [email protected] > https://lists.nongnu.org/mailman/listinfo/igraph-help -- T. _______________________________________________ igraph-help mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/igraph-help
