Skip to content

Commit 7a0525d

Browse files
author
Ian
committed
Changed StandardMoving a little, should work better now
1 parent 0760e20 commit 7a0525d

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "single-clustering"
3-
version = "0.2.0"
3+
version = "0.3.0"
44
edition = "2024"
55
authors = ["Ian F. Diks"]
66
homepage = "https://singlerust.com"

src/moving/standard.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ where
5656

5757
let two_m = total_edge_weight_2m;
5858
let term1 = k_i_in / two_m;
59-
let term2 = (node_weight * cluster_tot * self.resolution) / (two_m * two_m);
59+
let term2 = (node_weight * cluster_tot * self.resolution) / (T::from(2).unwrap() * two_m * two_m);
6060

6161
term1 - term2
6262
}
@@ -103,8 +103,9 @@ where
103103
self.node_order.clear();
104104
self.node_order.extend(0..node_count);
105105
self.node_order.shuffle(rng);
106-
107-
let total_edge_weight_2m = network.get_total_edge_weight() * T::from(2).unwrap();
106+
107+
//changed here
108+
let total_edge_weight_2m = network.get_total_edge_weight();
108109
let mut global_update = false;
109110

110111
// Keep iterating until no improvements are found

0 commit comments

Comments
 (0)