From 3710657d500502a7c945d3c19ff772488d155ffb Mon Sep 17 00:00:00 2001 From: Arpit Jain Date: Wed, 30 Sep 2026 03:15:56 -0400 Subject: [PATCH] Credit the moved node's volume to the community it moved into Signed-off-by: Arpit Jain --- hypernetx/algorithms/clustering/hypergraph_modularity.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hypernetx/algorithms/clustering/hypergraph_modularity.py b/hypernetx/algorithms/clustering/hypergraph_modularity.py index 67ef9e97..fde549dc 100644 --- a/hypernetx/algorithms/clustering/hypergraph_modularity.py +++ b/hypernetx/algorithms/clustering/hypergraph_modularity.py @@ -481,7 +481,7 @@ def _last_step_weighted(H, A, wdc, delta=0.01, verbose=False): if best_del_q > 0.1: ## this avoids some precision issues n_moves += 1 dct_A[v] = best - VolA[m] += str_v + VolA[best] += str_v VolA[dct_A_v] -= str_v VolV = np.sum(VolA) else: @@ -564,7 +564,7 @@ def _last_step_unweighted(H, A, wdc, delta=0.01, verbose=False): if best_del_q > 0.1: ## this avoids some numerical precision issues n_moves += 1 dct_A[v] = best - VolA[m] += deg_v + VolA[best] += deg_v VolA[dct_A_v] -= deg_v VolV = np.sum(VolA) else: