Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect inequality in watts_strogatz documentation #175

Conversation

simonschoelly
Copy link
Contributor

No description provided.

@simonschoelly simonschoelly merged commit c619e77 into JuliaGraphs:master Sep 25, 2022
aurorarossi added a commit to aurorarossi/Graphs.jl that referenced this pull request Sep 25, 2022
@aurorarossi
Copy link
Member

I don't agree with this change.
In the code there is the following check:

(rand(rng) < β && degree(g, s) < n - 1) || continue

which means that if r=rand(rng) is less than β then the edge is rewired otherwise (if r bigger or equal to β) the edge is left unaltered.
Indeed, in the special cases:

  • if β=0 then r is always bigger than 0 that leads to no change in the lattice.
  • if β=1 then r is always less than 1 and the whole graph is rewired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants