# edge weights vs multi-graphs in minimize_blockmodel_dl

How does minimize_blockmodel_dl deal with multi-graphs (graphs where multiple
edges can exist between two vertices)?

Is the information discarded, or is it incorporated as edge weight, and if
so, how?

Sorry if this is addressed in the documentation.

If there are parallel edges in the graph, they are taken into account,
since the underlying SBM accepts multigraphs. This is done
automatically, and there is nothing special that needs to be done.

Thanks.

Could you clarify the difference between

minimize_blockmodel_dl(g) on it

(2) loading a graph with simple edges but an edge property equal to the
number of parallel edges and running:
state_args=dict(recs=[g.ep.weight], rec_types=["discrete-poisson"]))

stochastic block models", "Efficient Monte Carlo and greedy heuristic for
the inference of stochastic block models", and "Nonparametric Bayesian
inference of the microcanonical stochastic block model" papers. I am just
not 100% clear on the mapping from the papers to what the function does, in
this case. I am getting some quite different results depending on whether I
use method (1) or (2), but that may be due to randomness.

The first is the regular degree-corrected Poisson SBM. The second is a
version with edge covariates, where we first sample from the Poisson
SBM, and then we sample weights on edges according to a specific
distribution (in your case, again a Poisson). This is not equivalent to
sampling from a single Poisson, since the 'weight' Poisson covariates
are sampled only on the non-zero entries of the first Poisson. So, for
example, we may have a sparse graph, with most pairs of nodes not being
connected, but where every edge has an integer covariate that is very
high, say on the order of 100, which would not be possible to generate
with model 1 without the whole graph becoming dense.

Best,
Tiago

thanks, that's a great explanation and helps explain the difference in
results. thanks for building this excellent package!