[][src]Struct algorithms_edu::algo::graph::UnweightedAdjacencyList

pub struct UnweightedAdjacencyList { /* fields omitted */ }

Implementations

impl UnweightedAdjacencyList[src]

pub fn bfs(&self, start: usize) -> BfsResult[src]

Perform a breadth first search on a graph a starting node start.

impl UnweightedAdjacencyList[src]

pub fn dfs(&self, start: usize) -> usize[src]

Perform a depth first search on a graph with n nodes from a starting point to count the number of nodes in a given component.

impl UnweightedAdjacencyList[src]

pub fn eulerian_path(&self) -> Result<Vec<usize>, EulerianPathError>[src]

Returns a list of edges_count + 1 node ids that give the Eulerian path or an EulerianPathError if no path exists or the graph is disconnected.

impl UnweightedAdjacencyList[src]

pub fn scc(&self) -> SccResult[src]

impl UnweightedAdjacencyList[src]

impl UnweightedAdjacencyList[src]

pub fn with_size(n: usize) -> Self[src]

Initialize an empty adjacency list that can hold up to n nodes.

pub fn is_empty(&self) -> bool[src]

pub fn add_directed_edge(&mut self, u: usize, v: usize)[src]

Add a directed edge from node u to node v

pub fn add_undirected_edge(&mut self, u: usize, v: usize)[src]

Add an undirected edge between nodes u and v.

pub fn new_directed(size: usize, edges: &[[usize; 2]]) -> Self[src]

pub fn new_undirected(size: usize, edges: &[[usize; 2]]) -> Self[src]

pub fn edges(&self) -> impl Iterator<Item = [usize; 2]> + '_[src]

pub fn edges_count(&self) -> usize[src]

pub fn vertices(&self) -> impl Iterator<Item = (usize, &Vec<usize>)>[src]

pub fn vertices_count(&self) -> usize[src]

Trait Implementations

impl BfsReconstructPath for UnweightedAdjacencyList[src]

pub fn bfs<T: Queue<usize>>(&self, start: usize) -> Vec<Option<usize>>[src]

Perform a breadth first search on a graph a starting node start.

impl Debug for UnweightedAdjacencyList[src]

impl DfsRecursive for UnweightedAdjacencyList[src]

impl Index<usize> for UnweightedAdjacencyList[src]

type Output = Vec<usize>

The returned type after indexing.

impl TreeCenter for UnweightedAdjacencyList[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,