Skip to content

Commit

Permalink
Fix maximum number of levels for leiden dendrogram
Browse files Browse the repository at this point in the history
  • Loading branch information
Naim committed Nov 15, 2023
1 parent 380539c commit 4f26e55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cpp/src/community/leiden_impl.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ std::pair<std::unique_ptr<Dendrogram<vertex_t>>, weight_t> leiden(

rmm::device_uvector<vertex_t> louvain_of_refined_graph(0, handle.get_stream()); // #V

while (dendrogram->num_levels() < max_level) {
while (dendrogram->num_levels() < 2 * max_level + 1) {
//
// Initialize every cluster to reference each vertex to itself
//
Expand Down Expand Up @@ -477,7 +477,7 @@ std::pair<std::unique_ptr<Dendrogram<vertex_t>>, weight_t> leiden(
(*cluster_assignment).data(),
(*cluster_assignment).size(),
false);

// louvain assignment of aggregated graph which is necessary to flatten dendrogram
dendrogram->add_level(current_graph_view.local_vertex_partition_range_first(),
current_graph_view.local_vertex_partition_range_size(),
handle.get_stream());
Expand Down

0 comments on commit 4f26e55

Please sign in to comment.