get_hierarchy_tree

get_hierarchy_tree#

graph_tool.inference.get_hierarchy_tree(state, empty_branches=False)[git][source]#

Obtain the nested hierarchical levels as a tree.

This transforms a NestedBlockState instance into a single Graph instance containing the hierarchy tree.

Parameters:
stateNestedBlockState

Nested block model state.

empty_branchesbool (optional, default: False)

If empty_branches == False, dangling branches at the upper layers will be pruned.

Returns:
treeGraph

A directed graph, where vertices are blocks, and a directed edge points from an upper to a lower level in the hierarchy.

labelVertexPropertyMap

A vertex property map containing the block label for each node.

orderVertexPropertyMap

A vertex property map containing the relative ordering of each layer according to the total degree of the groups at the specific levels.

See also

NestedBlockState

Nested stochastic block model

minimize_nested_blockmodel_dl

Inference of the nested block model

graph_tool.draw.draw_hierarchy

Draw a nested block model hierarchy