Rewiring graph


It might be an unnecessary question, but I can not find it in the documentation. How the function Graph.rewire() works? Does it take any argument? I found just this Graph analysis, and it is not very explanatory.

Thank you,

For an explanation, see Edge-switching Markov chain Monte Carlo (MCMC) methods and the associated figure in this paper:

As for “does it take an argument?”, see the documentation:

1 Like

Thank you! I have one more question. Am I right that the rewire function does not keep weights? Or is it somehow possible?

That is correct: weights are discarded.

It is not a trivial question whether there is a reasonable and useful way to retain weights during such a rewiring. If you can formulate such a way, or are aware of a paper discussing one, feel free to open a feature request. This would likely be a new and separate function though.