Hello Tiago,

I am trying to generate a stochastic block model but with the

degree-sequence preserved. I am fine even if the degree-distribution is

preserved instead of the exact sequence. I tried the following:

def prob(a, b):

if a == b :

return 0.999

else:

return 0.001

g, bm = gt.random_graph(N, lambda: 1 + np.random.poisson(5), model =

"blockmodel-degree", directed = False,

block_membership=np.random.randint(0, b, N), edge_probs = prob)

However, this generates an ER graph. What can I do to retain the

block-structure?

Thank you

attachment.html (912 Bytes)