pub struct Louvain {
pub resolution: f64,
pub max_iterations: usize,
pub min_improvement: f64,
}Expand description
Louvain algorithm for community detection
A greedy algorithm that optimizes modularity - a measure of how well the network is partitioned into communities where nodes are densely connected within communities but sparsely between them.
Fields§
§resolution: f64Resolution parameter (higher = smaller communities)
max_iterations: usizeMaximum iterations per phase
min_improvement: f64Minimum modularity improvement to continue
Implementations§
Source§impl Louvain
impl Louvain
Sourcepub fn resolution(self, resolution: f64) -> Self
pub fn resolution(self, resolution: f64) -> Self
Set resolution parameter (default: 1.0)
Sourcepub fn max_iterations(self, max: usize) -> Self
pub fn max_iterations(self, max: usize) -> Self
Set maximum iterations per phase (default: 10)
Sourcepub fn run(&self, graph: &GraphStore) -> LouvainResult
pub fn run(&self, graph: &GraphStore) -> LouvainResult
Run Louvain community detection (treats graph as undirected)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Louvain
impl RefUnwindSafe for Louvain
impl Send for Louvain
impl Sync for Louvain
impl Unpin for Louvain
impl UnsafeUnpin for Louvain
impl UnwindSafe for Louvain
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request