Skip to content

Commit

Permalink
Louvain algorithm (#1425)
Browse files Browse the repository at this point in the history
* implement undirected modularity function

* actual louvain algorithm

* test files

* fix some issues

* add test on LFR benchmark

* louvain algorithm that seems to work

* make the network undirected

* better handling of tol in modularity

* clean up debug code

* add python wrapper

* removed println

---------

Co-authored-by: miratepuffin <[email protected]>
  • Loading branch information
ljeub-pometry and miratepuffin authored Dec 21, 2023
1 parent 5b592de commit 4a88a15
Show file tree
Hide file tree
Showing 12 changed files with 1,358 additions and 35 deletions.
84 changes: 84 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions python/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ fn raphtory(py: Python<'_>, m: &PyModule) -> PyResult<()> {
balance,
label_propagation,
temporal_SEIR,
louvain,
);
m.add_submodule(algorithm_module)?;

Expand Down
1 change: 1 addition & 0 deletions raphtory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ tempfile = "3.2"
tokio = { version = "1.27.0", features = ["full"]} # for vector testing
dotenv = "0.15.0" # for vector testing
streaming-stats = "0.2"
proptest = "1.4.0"

[features]
default = []
Expand Down
1 change: 1 addition & 0 deletions raphtory/resources/test/communities.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[[3, 7, 13, 14, 20, 23, 24, 27, 28, 29, 31, 36, 37, 39, 40, 46, 54, 55, 58, 63, 65, 69, 72, 75, 76, 78, 82, 83, 85, 89, 90, 93, 105, 106, 114, 117, 118, 122, 124, 125, 127, 129, 133, 134, 136, 142, 144, 153, 157, 158, 162, 167, 168, 169, 173, 175, 178, 180, 182, 184, 190, 193, 203, 209, 210, 216, 219, 224, 229, 239, 248, 249], [0, 1, 2, 4, 5, 6, 9, 10, 11, 15, 17, 25, 26, 30, 32, 35, 41, 42, 43, 47, 48, 49, 50, 51, 52, 53, 56, 57, 59, 60, 62, 64, 66, 67, 68, 71, 73, 74, 77, 79, 81, 84, 86, 87, 88, 91, 92, 94, 95, 96, 97, 98, 99, 100, 101, 103, 104, 107, 108, 109, 110, 111, 112, 113, 115, 116, 119, 120, 123, 126, 128, 130, 131, 132, 135, 137, 138, 139, 140, 141, 143, 145, 146, 147, 148, 149, 150, 151, 152, 154, 155, 156, 159, 160, 161, 163, 164, 165, 166, 170, 171, 172, 174, 176, 177, 179, 181, 183, 185, 186, 187, 188, 189, 191, 192, 194, 195, 196, 197, 198, 199, 200, 201, 202, 204, 205, 206, 207, 208, 211, 212, 213, 214, 215, 217, 218, 220, 221, 222, 223, 227, 228, 230, 231, 232, 233, 234, 235, 236, 238, 240, 241, 242, 243, 244, 245, 246], [70, 8, 12, 16, 80, 18, 19, 21, 22, 33, 34, 225, 226, 38, 102, 44, 45, 237, 247, 121, 61]]
Loading

0 comments on commit 4a88a15

Please sign in to comment.