How to instantiate a NestedBlockState from node labels

Hello, given a graph with node labels at different levels of a hierarchy (supposedly communities), how can I instantiate a NestedBlockState object properly? I mean, suppose I have 6 nodes and the following labels (one line for each level):

A A B B C C
A A A A B B
A A A A A A

and I want a NestedBlockState, represented as

[[A, A, B, B, C, C], [A, B], [A]]

what would be the proper way to go?
Thanks

Davide

Nevermind, apparently

state = gt.NestedBlockState(g, bs=[[A,A, B,B,C, C], [A, A, A, A, B, B], [A, A, A, A, A, A]])

does the job.

1 Like