pub struct GraphStats { /* private fields */ }Expand description
Structural statistics about a directed graph.
Implementations§
Source§impl GraphStats
impl GraphStats
Sourcepub fn new(node_count: usize, edge_count: usize, max_depth: usize) -> Self
pub fn new(node_count: usize, edge_count: usize, max_depth: usize) -> Self
Creates a GraphStats with the given raw values.
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Returns the number of nodes.
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Returns the number of directed edges.
Sourcepub fn avg_degree(&self) -> f64
pub fn avg_degree(&self) -> f64
Returns the average out-degree across all nodes.
Sourcepub fn depth(&self) -> usize
pub fn depth(&self) -> usize
Returns the maximum depth (length of the longest source-to-sink path).
Sourcepub fn complexity(&self) -> GraphComplexity
pub fn complexity(&self) -> GraphComplexity
Classifies the graph by complexity.
Sourcepub fn is_disconnected(&self) -> bool
pub fn is_disconnected(&self) -> bool
Returns true if the graph has no edges.
Trait Implementations§
Source§impl Clone for GraphStats
impl Clone for GraphStats
Source§fn clone(&self) -> GraphStats
fn clone(&self) -> GraphStats
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 moreAuto Trait Implementations§
impl Freeze for GraphStats
impl RefUnwindSafe for GraphStats
impl Send for GraphStats
impl Sync for GraphStats
impl Unpin for GraphStats
impl UnsafeUnpin for GraphStats
impl UnwindSafe for GraphStats
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