Skip to main content

Crate sdivi_detection

Crate sdivi_detection 

Source
Expand description

Native Leiden community detection for sdivi-rust.

Provides a fully deterministic, native Rust port of the Leiden algorithm (Traag et al. 2019) with Modularity and CPM quality functions.

§Quick Start

use sdivi_detection::leiden::run_leiden;
use sdivi_detection::partition::{LeidenConfig, LeidenPartition};
use sdivi_graph::dependency_graph::build_dependency_graph_from_edges;

let dg = build_dependency_graph_from_edges(&[], &[]);
let cfg = LeidenConfig::default();
let partition = run_leiden(&dg, &cfg, None);
assert_eq!(partition.community_count(), 0);

Re-exports§

pub use leiden::run_leiden;
pub use leiden::run_leiden_with_weights;
pub use partition::LeidenConfig;
pub use partition::LeidenPartition;
pub use partition::QualityFunction;
pub use warm_start::initial_assignment_from_cache;
pub use warm_start::CACHE_FILENAME;

Modules§

leiden
Native Leiden community detection algorithm.
partition
LeidenPartition — the output type of the Leiden community detection stage.
warm_start
Warm-start support for the Leiden algorithm.