Conversation
|
|
Pull Request Test Coverage Report for Build 4032314256
💛 - Coveralls |
IvanIsCoding
left a comment
There was a problem hiding this comment.
Thanks for contributing this! This is neat.
I will have to read the paper to give a better review of the code, but I do have a question about graph realization right off the bat
| Some(seed) => Pcg64::seed_from_u64(seed), | ||
| None => Pcg64::from_entropy(), | ||
| }; | ||
| let degree_sequence = match core_generators::DegreeSequence::new(degree_sequence) { |
There was a problem hiding this comment.
Do you need to check this degree sequence with Erdős–Gallai? Or do you return a graph that might not be a simple graph?
There was a problem hiding this comment.
The graph may not be simple. The generator in NetworkX works in a similar fashion: https://networkx.org/documentation/stable/reference/generated/networkx.generators.degree_seq.configuration_model.html#configuration-model
At some point, it would be good to add a parameter to DegreeSequence constructors that specifies that the degree sequence must be graphical.
|
Also, you'll have to update |
| } | ||
| if sum % 2 == 1 { | ||
| let index = rng.gen_range(0..length); | ||
| degree_sequence[index] += 1; |
There was a problem hiding this comment.
This felt like a "pragmatic" way of ensuring that the sum is even. However, this could lead to out-of-distribution values in the sequence which is probably confusing for the user. Not sure how to fix it. Probably just retry n times?
Added a possibility to generate a random graph using a configuration model. The result is a random graph with a given degree sequence. The Rust library can additionally generate degree sequences from any
Distribution.