[graph-tool] confused with minimize_nested_blockmodel_dl

stephan bohacek at udel.edu
Wed Feb 3 14:59:56 CET 2021


I'm learning to use minimize_nested_blockmodel_dl. I tried a 4 vertex graph
that should result in two groups at the first level, but only one group is
found. The code is below.
I'm using v 2.35.

Thanks,

Stephan



g = Graph()

v0 = g.add_vertex()
v1 = g.add_vertex()
v2 = g.add_vertex()
v3 = g.add_vertex()

e01 = g.add_edge(v0, v1)
e10 = g.add_edge(v1, v0)            
e23 = g.add_edge(v2, v3)
e32 = g.add_edge(v3, v2)

e03 = g.add_edge(v0, v3)


edge_weights = g.new_edge_property('int')
edge_weights[e01] = 5
edge_weights[e10] = 5
edge_weights[e23] = 5
edge_weights[e32] = 5

edge_weights[e03] = 1


state = minimize_nested_blockmodel_dl(g, overlap=False, 
    state_args=dict(recs=[edge_weights], rec_types=['discrete-geometric']) ) 

print('Should be 2, but is ',state.levels[0].B)



--
Sent from: https://nabble.skewed.de/


More information about the graph-tool mailing list