[graph-tool] About the blocks from the minimize_nested_blockmodel_dl

Matyas, Csongor cfm482 at mun.ca
Thu May 26 19:53:38 CEST 2016

Hi Rogelio

I'm just another user of graph tool, and I'm not familiar with the function
that you've mentioned, but I can tell you how I do my naming.

I create a vertex property map for my vertices and add a string value to
each vertex which is going to be their name (the vertex number as integer
transformed into a string). Now if I remove a vertex, or something changes,
the property map will stay with the vertices and I can call them.
If the function you are talking about will generate a new graph, I don't
know how to solve that, but if you make your graph to be simplified to that
graph, you will have the names.
I'm sure there is an easier way, but I will leave that to the experts :)

Good luck


On Wed, May 25, 2016 at 11:52 PM, Rogelio Basurto <rogelio.basurto at gmail.com
> wrote:

> Hello,
> I've been using graph tool for about 3 weeks now. I just ran into it while
> searching for a modularity method for a bipartite network.
> I am amazed by graph tool and the algorithms within. But I am having
> truble with a basic question (at least I think it is).
> I am reading a bipartite network from a graphml file, then I do some
> filtering and finally I construct the minimize_nested_blockmodel_dl as in
> the example. Then I draw it, just like in the example, and it looks great.
> I manage to draw it with the node names and they are fine.
> Then, I would like to check the names of the nodes in the different
> blocks, by the levels they are arranged from the stochastic nested block
> model. But I do not know how to do that.
> I found the function get_bstack() for the NestedBlockState object, but the
> index in those vertices are from 0 to N, where N is the number of vertices
> per level (of the model, not from my graph, I think), then how do I
> associate my original vertex index (which has its name) to those graphs
> from the different levels?
> In short, I want to write down (terminal or file) the vertices from the
> graph (with its node names) for each level and respective block. I suppose
> it can be done, because the info is in the draw, but I do not know how.
> Thanks in advance! Great job with graph tool, and the stochastic block
> model (which I haven't completely understood, but I will).
> Tech info:
> I work with graph-tool 2.16-1 under Arch Linux, with Python 3.5, if that
> matters.
> The bipartite network have 2230 vertices and 246764 edges .
> From the state summary:
> l: 0, N: 2230, B: 174
> l: 1, N: 174, B: 68
> l: 2, N: 68, B: 26
> l: 3, N: 26, B: 9
> l: 4, N: 9, B: 3
> l: 5, N: 3, B: 1
> Have a great day!
> ____
> *Rogelio Basurto Flores*
> Laboratorio de Sistemas Complejos
> *​Unidad Profesional Interdisciplinaria en Ingeniería y *
> *Tecnologías  Avanzadas,*
> *Instituto Politécnico Nacional,*
> *Av. IPN # 2580,  Col. Laguna Ticoman,*
> *​Ciudad de ​M​é​xico,  07340,  M​é​xico*
> *Mobile Phone: 33 1551 3665*
> *E-Mail: rogelio.basurto at gmail.com <rogelio.basurto at gmail.com>*
> _______________________________________________
> graph-tool mailing list
> graph-tool at skewed.de
> https://lists.skewed.de/mailman/listinfo/graph-tool
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.skewed.de/pipermail/graph-tool/attachments/20160526/efca6118/attachment.htm>

More information about the graph-tool mailing list