# Stochastic block model

Hi all,

I would like to draw a random graph by Sage. The general stochastic model is the following: The graph contains $n$ vertices and the n vertices are divided into $r$ communities $C_1\cdots,C_r$. For two vertices within the same community, there is a probability $P_r$ that they are connected directly by an edge. How do I plot such a graph in Sage? References appreciated.

Maybe use

Are the sizes of the communities given as part of the input? Maybe this is what the comment above is trying to address.

Is the probability of edges between vertices in different communities equal to 0?