pub struct AdjacencyList { /* private fields */ }Expand description
Simple undirected graph represented by adjacency lists.
Vertices are 0-based indices.
Implementations§
Source§impl AdjacencyList
impl AdjacencyList
pub fn empty() -> AdjacencyList
pub fn from_unsorted_adjacency_lists( adjacency: Vec<Vec<usize>>, ) -> AdjacencyList
pub fn from_sorted_adjacency_lists(adjacency: Vec<Vec<usize>>) -> AdjacencyList
pub fn num_vertices(&self) -> usize
pub fn degree(&self, v: usize) -> usize
pub fn neighbors(&self, v: usize) -> &[usize]
pub fn contains(&self, v: usize, neighbor: usize) -> bool
pub fn adjacency_lists(&self) -> &[Vec<usize>]
pub fn into_adjacency_lists(self) -> Vec<Vec<usize>>
Trait Implementations§
Source§impl AdjacencyStore for AdjacencyList
impl AdjacencyStore for AdjacencyList
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 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