# Meaning of vertex_corr in block stochastic?

Sorry for the late reply, but there was a problem with the mailing list.

ttfoley wrote

I can't figure out the precise meaning of 'proportional' to, and would
like to know where/how it enters into the the actual formulae for
stochastic blocks. I have tried playing with various limits, and of course
tried scaling the 'probability' to account for graph size. For example,
there does not appear to be a limit where all edges are within blocks,
though surely this should be possible(assuming the number of edges fits
within the blocks)? Any help would be greatly appreciated.

Proportional means exactly that: The probability will be what you give, up
to an overall constant, which is unimportant since the total number of edges
is always fixed.

To force the edges to always be inside the groups, you should set the
probability to zero, whenever r != s.

Dear Tiago,

I tried,
g, bm = gt.random_graph(
1000,
lambda: np.random.poisson(10),
vertex_corr = corr,
directed = False,
block_membership=lambda: random.randint(1, 10)
)

where corr is,
def corr(a, b):
if a == b:
return 1.
else:
return 0.

The edges are not forced to stay within the blocks, when I checked with,
gt.graph_draw(g, vertex_fill_color=bm, edge_color="black")

Am I missing something?

Thanks.

Best regards,
Tzu-Chi

If parallel edges and self-loops are not allowed (as is the default), the
algorithm implemented is an edge-switching Markov-Chain that needs time to
equilibrate (this is mentioned in the documentation).