feat: add per-node limit on requeues and add safe skip zero-move Leid…#47
Merged
adsharma merged 1 commit intoJun 30, 2026
Conversation
Contributor
|
Look good. Merging. Minor comments for future reference:
I'll run a one time clang-format after the commit and add a linter in the next few days. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #35 for a initial discussion. This pull request diverges slightly. The following are the main changes:
Below is a diagram of various implementations we benchmarked and their runtimes, memory, and achieved total CPM on the ABM14 network (n=14mil, m=581mil). Each implementation is isolated from another (unless specified otherwise with the + symbol).
- BUGGY: This is the current Icebug Leiden-CPM, which suffers from the node-scheduling bug, i.e., nodes may not get relooked at after its neighbor successfully moves, as well as zero-move inner Leiden iterations.
- REQUEUE_FIX: This fixes the node-scheduling bug and adds a parameter which decides a per-node successful-move limit. This limit differs from the per-node requeue limit, since a node may be requeued and not successfully move when processed.
- QUICK: This checks if no moves have been made and that the refinement phase made no changes, and if so skips to the next outer iteration.
- PR_VERSION: This is this pull request's implementation, which combines QUICK and REQUEUE_FIX but using a per-node requeue limit instead of a per-node successful-move limit.
- SERIAL: This is leidenalg's serial Leiden-CPM.
For the default per-node requeue limiit, we choose 24, since our benchmarks show that it does not significantly increase runtime, while improving CPM significantly. Users should be careful not to choose a too-low value, such as 10, since we have seen high variance with runtimes, which may indicate a lower clustering quality.
Next Steps: We still want to confirm whether a per-node requeue limit or a per-node successful-move limit is more suitable, concerning runtime and clustering quality.