pub struct ClusterHierarchy {
pub clusters: HashMap<u64, Cluster>,
/* private fields */
}Expand description
Multi-level cluster hierarchy
Fields§
§clusters: HashMap<u64, Cluster>All clusters indexed by ID
Implementations§
Source§impl ClusterHierarchy
impl ClusterHierarchy
Sourcepub fn new(graph: Arc<DynamicGraph>) -> Self
pub fn new(graph: Arc<DynamicGraph>) -> Self
Create a new hierarchy for the given graph
Sourcepub fn insert_edge(&mut self, _edge_id: EdgeId, u: VertexId, v: VertexId)
pub fn insert_edge(&mut self, _edge_id: EdgeId, u: VertexId, v: VertexId)
Handle edge insertion
Sourcepub fn delete_edge(&mut self, _edge_id: EdgeId, u: VertexId, v: VertexId)
pub fn delete_edge(&mut self, _edge_id: EdgeId, u: VertexId, v: VertexId)
Handle edge deletion
Sourcepub fn lowest_common_cluster(&self, u: VertexId, v: VertexId) -> Option<u64>
pub fn lowest_common_cluster(&self, u: VertexId, v: VertexId) -> Option<u64>
Find the smallest cluster containing both vertices
Sourcepub fn min_boundary(&self) -> u64
pub fn min_boundary(&self) -> u64
Get minimum boundary size across all clusters
Sourcepub fn get_cluster(&self, id: u64) -> Option<&Cluster>
pub fn get_cluster(&self, id: u64) -> Option<&Cluster>
Get cluster by ID
Sourcepub fn num_levels(&self) -> usize
pub fn num_levels(&self) -> usize
Get number of levels
Auto Trait Implementations§
impl Freeze for ClusterHierarchy
impl !RefUnwindSafe for ClusterHierarchy
impl Send for ClusterHierarchy
impl Sync for ClusterHierarchy
impl Unpin for ClusterHierarchy
impl !UnwindSafe for ClusterHierarchy
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