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.
----- -- Tiago de Paula Peixoto <tiago@skewed.de> -- View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/... Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.
Dear Tiago,
I tried, g, bm = gt.random_graph( 1000, lambda: np.random.poisson(10), model="blockmodel-traditional", 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
-- View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/... Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.
On 01.10.2016 10:13, Tzu-Chi Yen wrote:
Dear Tiago,
I tried, g, bm = gt.random_graph( 1000, lambda: np.random.poisson(10), model="blockmodel-traditional", 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?
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).
Try adding "niter=100" to random_graph(), and your groups will mostly likely separate. Alternatively, you can make "parallel_edges=True" and "self_loops=True", and the same thing will happen much faster.
Best, Tiago