pub struct Graph<N, E> { /* private fields */ }Implementations§
Source§impl<N, E> Graph<N, E>
impl<N, E> Graph<N, E>
pub const fn new() -> Self
pub fn node_data_slice(&self) -> &[N]
pub fn add_node(&mut self, node_data: N) -> usize
pub fn add_edge( &mut self, n1: usize, n2: usize, edge_data: E, weight: f32, ) -> Option<usize>
pub fn count_nodes(&self) -> usize
pub fn try_get_edge_between(&self, n1: usize, n2: usize) -> Option<&EdgeInfo<E>>
Source§impl<N: Send + Sync, E: Send + Sync> Graph<N, E>
impl<N: Send + Sync, E: Send + Sync> Graph<N, E>
pub fn initial_community(&self) -> HashMap<usize, CommunityId>
pub fn compute_modularity( &self, assignments: &HashMap<usize, CommunityId>, ) -> f32
pub fn compute_modularity_with_local_move( &self, assignments: &HashMap<usize, CommunityId>, local_move: LocalMove, ) -> f32
pub fn leiden( &self, max_iter: Option<usize>, optimizer: &mut impl ModularityOptimizer, ) -> Graph<Community, ()>
Trait Implementations§
Source§impl<'de, N, E> Deserialize<'de> for Graph<N, E>where
N: Deserialize<'de>,
E: Deserialize<'de>,
impl<'de, N, E> Deserialize<'de> for Graph<N, E>where
N: Deserialize<'de>,
E: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<N, E> Freeze for Graph<N, E>
impl<N, E> RefUnwindSafe for Graph<N, E>where
N: RefUnwindSafe,
E: RefUnwindSafe,
impl<N, E> Send for Graph<N, E>
impl<N, E> Sync for Graph<N, E>
impl<N, E> Unpin for Graph<N, E>
impl<N, E> UnwindSafe for Graph<N, E>where
N: UnwindSafe,
E: UnwindSafe,
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> 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