pub struct Multilevel {
pub membership: Vec<i64>,
pub levels: Vec<Vec<i64>>,
pub modularities: Vec<f64>,
}Expand description
Result of the multi-level (Louvain) algorithm,
see Graph::community_multilevel.
Fields§
§membership: Vec<i64>Community id of each vertex in the final (best) level.
levels: Vec<Vec<i64>>Membership vector after each aggregation level, coarsest last (the
last one equals membership). Empty if no merge
improved modularity, in which case every vertex is its own community.
modularities: Vec<f64>Modularity (at the requested resolution) after each level, in the
order of levels; if levels is empty, the single
value is the modularity of the singleton partition.
Implementations§
Source§impl Multilevel
impl Multilevel
Sourcepub fn num_communities(&self) -> usize
pub fn num_communities(&self) -> usize
Number of communities in membership.
Sourcepub fn communities(&self) -> Vec<Vec<VertexId>>
pub fn communities(&self) -> Vec<Vec<VertexId>>
The vertices of each community, indexed by community id.
Source§impl Multilevel
impl Multilevel
Sourcepub fn modularity(&self) -> f64
pub fn modularity(&self) -> f64
Modularity of the final partition (the last entry of
modularities), NaN if it is empty.
Trait Implementations§
Source§impl Clone for Multilevel
impl Clone for Multilevel
Source§fn clone(&self) -> Multilevel
fn clone(&self) -> Multilevel
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Multilevel
impl Debug for Multilevel
Source§impl PartialEq for Multilevel
impl PartialEq for Multilevel
Source§fn eq(&self, other: &Multilevel) -> bool
fn eq(&self, other: &Multilevel) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Multilevel
Auto Trait Implementations§
impl Freeze for Multilevel
impl RefUnwindSafe for Multilevel
impl Send for Multilevel
impl Sync for Multilevel
impl Unpin for Multilevel
impl UnsafeUnpin for Multilevel
impl UnwindSafe for Multilevel
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