-
Notifications
You must be signed in to change notification settings - Fork 33
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
feat: hypergraph random edge shuffle #531
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Thanks, @doabell! Two small comments to address, but otherwise, I think that it is good to go.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #531 +/- ##
==========================================
+ Coverage 92.12% 92.16% +0.04%
==========================================
Files 60 60
Lines 4393 4417 +24
==========================================
+ Hits 4047 4071 +24
Misses 346 346 ☔ View full report in Codecov by Sentry. |
Resolved these comments, could you take another look? Thanks. |
Looks great! Thanks so much! Merging now. |
This PR implements
random_edge_shuffle
for hypergraphs, as described in Configuration models of random hypergraphs, Philip S C., 2020.Given two edges, the existing
double_edge_swap
swaps two nodes, whereasrandom_edge_shuffle
puts all nodes in a bucket and shuffles them.This preserves the edge sizes and node degrees.
If the same node appears in both hyperedges, then this is still true after reshuffling.
The user can also use this to shuffle two randomly selected hyperedges, if no edge IDs are specified.