Basic questions about nested blockmodel in graph-tool

只愿长相守 提交于 2019-12-04 23:19:10

问题


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?


回答1:


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")

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.



来源:https://stackoverflow.com/questions/37944901/basic-questions-about-nested-blockmodel-in-graph-tool

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!