图形工具中有关嵌套块模型的基本问题 [英] Basic questions about nested blockmodel in graph-tool

查看:95
本文介绍了图形工具中有关嵌套块模型的基本问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于 graph-tool library 中的minimize_nested_blockmodel_dl 函数.有没有办法找出哪个顶点落在哪个块上?换句话说,要从每个块中提取一个列表,其中包含其顶点的标签.

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?

推荐答案

关于第一个问题,这很简单:minimize_nested_blockmodel_dl()函数返回一个NestedBlockState对象:

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]

这是一个BlockState对象,我们可以通过get_blocks()方法从中获取组成员身份:

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.

这篇关于图形工具中有关嵌套块模型的基本问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆