pub struct DynamicCommunity {
pub node_memberships: Vec<Vec<usize>>,
pub n_snapshots: usize,
pub n_nodes: usize,
pub community_counts: Vec<usize>,
}Expand description
Result of dynamic community detection.
Stores the community assignment for each node at each snapshot.
node_memberships[snapshot][node] gives the community ID for node at
time snapshot. Community IDs are contiguous integers starting from 0.
Fields§
§node_memberships: Vec<Vec<usize>>node_memberships[t][v] = community of node v at snapshot t
n_snapshots: usizeNumber of snapshots
n_nodes: usizeNumber of nodes
community_counts: Vec<usize>Number of communities found at each snapshot
Implementations§
Source§impl DynamicCommunity
impl DynamicCommunity
Sourcepub fn new(node_memberships: Vec<Vec<usize>>) -> Self
pub fn new(node_memberships: Vec<Vec<usize>>) -> Self
Create a DynamicCommunity from a 2D membership matrix.
Sourcepub fn membership(&self, t: usize, v: usize) -> Option<usize>
pub fn membership(&self, t: usize, v: usize) -> Option<usize>
Get the community of node v at snapshot t.
Sourcepub fn temporal_stability(&self) -> f64
pub fn temporal_stability(&self) -> f64
Compute the average normalised mutual information (NMI) between adjacent snapshots as a measure of temporal stability (1.0 = perfectly stable).
Trait Implementations§
Source§impl Clone for DynamicCommunity
impl Clone for DynamicCommunity
Source§fn clone(&self) -> DynamicCommunity
fn clone(&self) -> DynamicCommunity
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DynamicCommunity
impl RefUnwindSafe for DynamicCommunity
impl Send for DynamicCommunity
impl Sync for DynamicCommunity
impl Unpin for DynamicCommunity
impl UnsafeUnpin for DynamicCommunity
impl UnwindSafe for DynamicCommunity
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more