Add support for graph "rewiring"
It is often useful to determine whether some statistical property of a graph is simply due to its degree distribution and/or correlation, or if it is something more subtle. One way of detecting this is to modify, i.e randomly rewire, the graph, such that the resulting graph has the same number of edges and vertices of the original, and where each vertex has the same degree as before, as well as (optionally) some of the following:
- degree-degree correlation: The target and source of each edge (and their degrees) are sampled according to the graph's original degree-degree correlation.
- "strict" degree-degree correlation: The degree of each target or source is kept the same, but the vertices themselves are randomly sampled
otherwise, everything else is random. Proper care should be taken to sample each possible random alternative with equal probability.