Basic questions about nested blockmodel in graph-tool
Asked Answered
S

1

7

Very briefly, two-three basic questions about the minimize_nested_blockmodel_dl function in graph-tool library. Is there a way to figure out which vertex falls onto which block? In other words, to extract a list from each block, containing the labels of its vertices.

The hierarchical visualization is rather difficult to understand for amateurs in network theory, e.g. are the squares with directed edges that are drawn meant to implicate the main direction of the underlying edges between two blocks under consideration? The blocks are nicely shown using different colors, but on a very conceptual level, which types of patterns or edge/vertex properties are behind the block categorization of vertices? In other words, when two vertices are in the same block, what can I say about their common properties?

Sellingplater answered 21/6, 2016 at 12:47 Comment(0)
P
11

Regarding your first question, it is fairly straightforward: The minimize_nested_blockmodel_dl() function returns a NestedBlockState object:

 g = collection.data["football"]
 state = minimize_nested_blockmodel_dl(g)

you can query the group membership of the nodes by inspecting the first level of the hierarchy:

 lstate = state.levels[0]

This is a BlockState object, from which we get the group memberships via the get_blocks() method:

 b = lstate.get_blocks()
 print(b[30])  # prints the group membership of node 30

Regarding your second question, the stochastic block model assumes that nodes that belong to the same group have the same probability of connecting to the rest of the network. Hence, nodes that get classified in the same group by the function above have similar connectivity patterns. For example, if we look at the fit for the football network:

state.draw(output="football.png")

enter image description here

We see that nodes that belong to the same group tend to have more connections to other nodes of the same group --- a typical example of community structure. However, this is just one of the many possibilities that can be uncovered by the stochastic block model. Other topological patterns include core-periphery organization, bipartiteness, etc.

Piccaninny answered 21/6, 2016 at 20:41 Comment(7)
Many many thanks for taking the time and answering, just wonderful! Two subquestions if I may: (i) so is it fair to assume that blocks are likely to represent components of the network? (ii) What do the squares with directed edges represent in the drawing?Sellingplater
(i) Yes, this the typical interpretation of this model. (ii) The squares represent the hierarchical organization, i.e. what happens when we model the network of groups in the first level using the same model. You can learn more about this here: dx.doi.org/10.1103/PhysRevX.4.011047Piccaninny
Thanks again, in fact I had already started reading your paper on arXiv (beautiful work), but progressing with it very slowly as I am new to the field, hence my naive questions :(( So if I understand correctly, the spline lines denote the edges of the actual network, without showing their direction, moreover in the first level hierarchy visualization, the direction of the edges between squares does not really depict the direction of the original edges of the network, right? because in the digram you ve shown here, I see green splines going to teal, but there's no such path with the squares.Sellingplater
That network is undirected. If if were directed, you would see an arrow. You see an arrow in the hierarchy edges just as a visualization aid, it has nothing to do with the underlying network.Piccaninny
(The plot is a very powerful visualization for large graphs) Is there a way to get a similar plot with gt, but for ones own clustering/communities? i.e. If I run a hierarchical clustering with saltons cosine, and get a bunch of clusters, but I would like to visualize them like this plot in gt, could that be done? (I'll post a separate question if necessary, sorry for hijacking this one; also very new to gt.)Katharyn
@Katharyn Yes it's possible, but surely you don't expect me to explain how in this tiny comment box.Piccaninny
Surely I don't! I'm just grateful for gt and you taking time to answer at all. Also, I forgot to go back here to mention that I did post a separate question about this right after the above comment: #66062525Katharyn

© 2022 - 2024 — McMap. All rights reserved.