pub struct AdjacencyList {
pub num_vertices: usize,
pub row_offsets: Vec<usize>,
pub col_indices: Vec<usize>,
pub graph_type: GraphType,
}Expand description
Sparse adjacency representation of a graph in CSR-like format.
For vertex v, its neighbours are stored in
col_indices[row_offsets[v]..row_offsets[v + 1]].
Fields§
§num_vertices: usizeNumber of vertices.
row_offsets: Vec<usize>Row offset array of length num_vertices + 1.
col_indices: Vec<usize>Column index array containing neighbour vertex ids.
graph_type: GraphTypeWhether the graph is directed or undirected.
Implementations§
Source§impl AdjacencyList
impl AdjacencyList
Sourcepub fn degree(&self, v: usize) -> RandResult<usize>
pub fn degree(&self, v: usize) -> RandResult<usize>
Sourcepub fn neighbors(&self, v: usize) -> RandResult<&[usize]>
pub fn neighbors(&self, v: usize) -> RandResult<&[usize]>
Sourcepub fn stats(&self) -> GraphStats
pub fn stats(&self) -> GraphStats
Computes aggregate statistics of the graph.
Trait Implementations§
Source§impl Clone for AdjacencyList
impl Clone for AdjacencyList
Source§fn clone(&self) -> AdjacencyList
fn clone(&self) -> AdjacencyList
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 moreSource§impl Debug for AdjacencyList
impl Debug for AdjacencyList
Auto Trait Implementations§
impl Freeze for AdjacencyList
impl RefUnwindSafe for AdjacencyList
impl Send for AdjacencyList
impl Sync for AdjacencyList
impl Unpin for AdjacencyList
impl UnsafeUnpin for AdjacencyList
impl UnwindSafe for AdjacencyList
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