From 04de39f16f5889a859bc7e9433d3a832e6ef7df1 Mon Sep 17 00:00:00 2001 From: nameearly <2741313455@qq.com> Date: Wed, 4 Mar 2026 21:58:19 +0800 Subject: [PATCH] remove unused efinement_gamma --- src/cli/run.rs | 1 - src/core/algorithm/hit_leiden.rs | 6 ------ src/core/config.rs | 5 ----- 3 files changed, 12 deletions(-) diff --git a/src/cli/run.rs b/src/cli/run.rs index f67ac15..1006cd8 100644 --- a/src/cli/run.rs +++ b/src/cli/run.rs @@ -36,7 +36,6 @@ pub fn run_from_cli( max_iterations: 10, pinned_profile: None, resolution: 1.0, - refinement_gamma: 0.05, }; crate::run(graph, &config) diff --git a/src/core/algorithm/hit_leiden.rs b/src/core/algorithm/hit_leiden.rs index 981f28a..91cefab 100644 --- a/src/core/algorithm/hit_leiden.rs +++ b/src/core/algorithm/hit_leiden.rs @@ -56,7 +56,6 @@ pub fn run(graph: &GraphInput, config: &RunConfig) -> Result (usize, Vec>) { @@ -197,12 +195,10 @@ fn multilevel_leiden( // Refinement: within each community, merge singletons into subcommunities. // Uses the SAME resolution as movement for the quality function. - // The refinement_gamma (0.05) is only for the connectivity criterion. let mut subcommunities = refine_singleton_merge( &state.supergraphs[0], &state.community_mapping_per_level[0], gamma, - refinement_gamma, ); // The community assignment (for final output) comes from movement @@ -279,7 +275,6 @@ fn multilevel_leiden( &state.supergraphs[0], &state.node_to_comm, gamma, - refinement_gamma, ); let new_subcomm_count = count_unique(&subcommunities); @@ -455,7 +450,6 @@ fn refine_singleton_merge( graph: &crate::core::graph::in_memory::InMemoryGraph, node_to_community: &[usize], gamma: f64, - _refinement_gamma: f64, ) -> Vec { let n = graph.node_count; if n == 0 { diff --git a/src/core/config.rs b/src/core/config.rs index b8b81fb..0ef26ca 100644 --- a/src/core/config.rs +++ b/src/core/config.rs @@ -34,10 +34,6 @@ pub struct RunConfig { /// Default 1.0 matches the HIT-Leiden paper (standard modularity). /// Used for both movement and refinement quality functions. pub resolution: f64, - /// Refinement connectivity criterion gamma. Controls which nodes participate - /// in refinement merging (must satisfy cut_size >= gamma * v_total * (S - v_total)). - /// Default 0.05. NOT used for quality function. - pub refinement_gamma: f64, } impl Default for RunConfig { @@ -50,7 +46,6 @@ impl Default for RunConfig { max_iterations: 10, pinned_profile: None, resolution: 1.0, - refinement_gamma: 0.05, } } }