I'm sorry, I'll try to be more specific.
I eventually need a matrix that I can plot as done in this post by ulgenklc: https://nabble.skewed.de/Temporal-community-detection-with-DSBM-tt4028581.ht...
Here, I use a subgraph with only two layers to demonstrate this seemingly trivial issue:
state = minimize_nested_blockmodel_dl(g, state_args=dict(base_type=LayeredBlockState, state_args=dict(deg_corr=True, overlap=True, layers=True, ec=g.ep.layer, recs=[g.ep.weight], rec_types=["discrete-binomial"])))
<NestedBlockState object, with base <LayeredBlockState object with 4610 overlapping blocks, 2 layers, degree-corrected, with 2 edge covariates, for graph <Graph object, undirected, with 82 vertices and 2305 edges, 2 internal vertex properties, 4 internal edge properties, and 8 levels of sizes [(82, 3), (3, 1), (1, 1), (1, 1), (1, 1), (1, 1), (1, 1), (1, 1)] at 0x2b1aa8982dc0>
While there are 4610 overlapping blocks in this stage, state.draw() divides the nodes neatly into three sensible communities. Hence, I know that the snippet of code that I need already exists somewhere in draw_hierarchy.
Then, I filter the edges in state.g by layer and use get_edge_blocks() to extract the layer-specific half-edges:
lay =  for e in g.edges(): lay.append(g.ep.layer[e]==0) #edges in the first layer lay = np.array(lay, dtype="int") ft = g.new_edge_property("bool") ft.a = lay state.g.set_edge_filter(ft) be = state.levels.get_edge_blocks()
This is where I struggle to find a way to extract the desired information. My best guess on how to extract the layer-specific node memberships from _be_ is the following:
s = OverlapBlockState(state.g, b=be) #state.g with filter on mb = s.get_majority_blocks() for v in g.vertices(): print(mb[v])
If I compare the _mb_ for the discrete layers, the memberships vary slightly (this is what I need), but I'm unsure whether this is the correct way to extract this information?
Many thanks, Arttu