Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added Hierarchical Configuration Model to randgraphs.jl
I have tested its performance for small/medium numbers of nodes and communities, but further testing might be necessary.
This implementation allows self-loops and multiple edges (which are reduced here to a simple edge), so the resulting degree sequences might not exactly matched the specified sequences. Thus, I am wondering if this function might be better suited for Multigraph.jl, but since the repository includes the Configuration Model I figured it would make sense that it included the Hierarchical Configuration Model as well (as this is basically its extension to community structure).
Some external degree sequences cannot be realized even if they add up to an even number. To detect such sequences is not trivial, so when a external degree sequence is 'correct' (adds up to even number) but cannot be realized the function should return the closest possible realization.
Best regards,
Javier