On 27.09.2017 03:57, Snehal Shekatkar wrote:
> 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?

I believe this is a bug with the alias method used. Try with the option
"alias=False", and don't forget to use a large value of "n_iter".

I'll provide a fix in git soon.

Best,
Tiago


-- 
Tiago de Paula Peixoto <[email protected]>

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
graph-tool mailing list
[email protected]
https://lists.skewed.de/mailman/listinfo/graph-tool

Reply via email to