pub struct CommunityDetectionConfig {
pub max_iterations: usize,
pub direction: Direction,
pub seed: Option<u64>,
pub min_improvement: f64,
pub max_graph_nodes: Option<usize>,
}Expand description
Configuration for Community Detection.
Fields§
§max_iterations: usizeMaximum number of iterations. Default: 100
direction: DirectionDirection of edges to follow. Default: Both (treat as undirected)
seed: Option<u64>Seed for random number generation (for reproducibility). Default: None (use system entropy)
min_improvement: f64Minimum improvement in modularity to continue iterating. Set to 0.0 to only check for label stability. Default: 0.0
max_graph_nodes: Option<usize>Maximum number of nodes allowed before returning an error.
Set to None to disable the check.
Default: 10,000,000 (10M nodes)
Implementations§
Source§impl CommunityDetectionConfig
impl CommunityDetectionConfig
Sourcepub const fn with_max_iterations(self, max_iterations: usize) -> Self
pub const fn with_max_iterations(self, max_iterations: usize) -> Self
Set the maximum number of iterations.
Sourcepub const fn with_direction(self, direction: Direction) -> Self
pub const fn with_direction(self, direction: Direction) -> Self
Set the direction to follow edges.
Sourcepub const fn with_min_improvement(self, min_improvement: f64) -> Self
pub const fn with_min_improvement(self, min_improvement: f64) -> Self
Set the minimum improvement threshold.
Sourcepub const fn with_max_graph_nodes(self, limit: Option<usize>) -> Self
pub const fn with_max_graph_nodes(self, limit: Option<usize>) -> Self
Set the maximum number of nodes allowed.
If the graph has more nodes than this limit, the algorithm will
return a GraphError::GraphTooLarge error instead of attempting
to allocate potentially gigabytes of memory.
Set to None to disable the check (use with caution).
Trait Implementations§
Source§impl Clone for CommunityDetectionConfig
impl Clone for CommunityDetectionConfig
Source§fn clone(&self) -> CommunityDetectionConfig
fn clone(&self) -> CommunityDetectionConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more