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

Update generation and flattening of dendrogram in Leiden #4347

Conversation

ChuckHastings
Copy link
Collaborator

The Leiden dendrogram was being populated with both Louvain cluster assignment and mapping between Leiden and Louvain clustering. The flattening of the dendrogram was being accomplished by applying the Louvain clustering, then mapping between the Leiden clusters at each level.

Unfortunately, the Leiden to Louvain mapping allows a many-to-one relationship, so in certain cases the flattening was non-deterministic. There wasn't enough information in the dendrogram to perform the mapping deterministically.

This PR modifies the dendrogram to be similar to Louvain, just keeping the cluster assignments at each level. The mapping between Louvain and Leiden clusters is done when creating the dendrogram, where there is sufficient information to perform this translation deterministically.

Closes #4072

@ChuckHastings ChuckHastings marked this pull request as ready for review April 16, 2024 00:48
@ChuckHastings ChuckHastings requested a review from a team as a code owner April 16, 2024 00:48
@ChuckHastings ChuckHastings added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Apr 16, 2024
Copy link
Contributor

@seunghwak seunghwak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

cpp/src/community/leiden_impl.cuh Outdated Show resolved Hide resolved
@naimnv
Copy link
Contributor

naimnv commented Apr 18, 2024

/okay to test

@ChuckHastings ChuckHastings requested a review from a team as a code owner April 18, 2024 22:51
@rlratzel
Copy link
Contributor

/merge

@rapids-bot rapids-bot bot merged commit ca88a47 into rapidsai:branch-24.06 Apr 22, 2024
132 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuGraph improvement Improvement / enhancement to an existing function non-breaking Non-breaking change python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

What is the expected repeatability of cugraph.leiden?
4 participants