Dear Tiago,
I happened to be looking at the code for random graph generation
(graph_generation.hh). The code checks whether a generated degree
sequence is Graphic or not using Erdos-Gallai condition. If the
condition is not satisfied, the code seems to randomly choose a vertex
and re-generate its degree. This is logical in most cases.
However, if any of the degree value is greater than "n-1", the size of
the graph, clearly a simple graph cannot be generated from such
sequence, and it should be immediately changed by re-generating degrees
for such vertices. This happens a lot when the degrees are sampled from
a right-skewed distribution. But I don't see anything like this in the
code. My question is, isn't it inefficient to keep randomly choosing
vertices one at a time and change their degrees until the vertices with
degree greater than n-1 are reassigned degrees? Is it being done for
correctly sampling from a given degree distribution? Or am I missing
something? Thank you.
Best regards,
SMS
--
Snehal M. Shekatkar
https://inferred.in
PGP key -> https://inferred.in/snehal_pub_key.txt
Hello Tiago and community,
I have a network that I'd like to infer a hierarchical SBM from, but it has
weighted edges.
After reading the weighted SBM paper [1] and looking at the graph-tool
docs, I think I might be able to use `*minimize_nested_blockmodel_dl*` and
pass the `*BlockState*` `*eweight*` argument via `*state_args*`. The
weights are discrete and non-negative, so maybe I also need to specify "
discrete-geometric" via `*rec_types`*. The edge weights could also be seen
as multiple edges in a multigraph.
1]: https://arxiv.org/pdf/1708.01432.pdf
After searching through old mailing list posts, here is my current attempt
for the weighted case:
```
g = Graph()
# Add vertices here
# Add edges here
edge_weights = g.new_edge_property('int')
# Specify edge weights here
state = minimize_nested_blockmodel_dl(g,
state_args=dict(eweight=edge_weights,
rec_types=['discrete-geometric']) )
```
Am I on the right track? And would it be better to specify the edge
weights via the `*BlockState*` `*recs*` parameter instead of using `
*eweight*`?
Thank you,
Alexander
Alexander T. J. Barron
https://cogentmentat.github.io/academic/