pub struct EigenvectorCentralityConfig {
pub direction: Direction,
pub max_iterations: usize,
pub tolerance: f64,
pub normalize: bool,
pub max_graph_nodes: Option<usize>,
}Expand description
Configuration for Eigenvector Centrality computation.
Fields§
§direction: DirectionDirection of edges to follow. Default: Both (treat as undirected)
max_iterations: usizeMaximum number of iterations before stopping. Default: 100
tolerance: f64Convergence tolerance. Algorithm stops when max score change < tolerance. Default: 1e-6
normalize: boolWhether to normalize scores to have unit L2 norm. Default: true
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 EigenvectorCentralityConfig
impl EigenvectorCentralityConfig
Sourcepub const fn with_direction(self, direction: Direction) -> Self
pub const fn with_direction(self, direction: Direction) -> Self
Set the direction for following edges.
Outgoing: Follow edges in their natural directionIncoming: Follow edges in reverseBoth: Treat graph as undirected (default)
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_tolerance(self, tolerance: f64) -> Self
pub const fn with_tolerance(self, tolerance: f64) -> Self
Set the convergence tolerance.
The algorithm stops when the maximum change in any node’s score between iterations is less than this value.
Sourcepub const fn with_normalize(self, normalize: bool) -> Self
pub const fn with_normalize(self, normalize: bool) -> Self
Set whether to normalize scores to have unit L2 norm.
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.
Set to None to disable the check (use with caution).
Trait Implementations§
Source§impl Clone for EigenvectorCentralityConfig
impl Clone for EigenvectorCentralityConfig
Source§fn clone(&self) -> EigenvectorCentralityConfig
fn clone(&self) -> EigenvectorCentralityConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more