pub trait GraphIterators<T, G, A>where
    T: Node,
    A: AdjContainer<T>,
{ fn contained_iter(&self) -> ContainedIter<'_, T, A>Notable traits for ContainedIter<'a, T, A>impl<'a, T, A> Iterator for ContainedIter<'a, T, A>where
    T: 'a + Node,
    A: AdjContainer<T>,
type Item = &'a T;
; fn contained_iter_neighbors(
        &self,
        index: usize
    ) -> NContainedIter<'_, T, A, IterWrapper<'_>>Notable traits for NContainedIter<'a, T, A, I>impl<'a, T, A, I> Iterator for NContainedIter<'a, T, A, I>where
    T: 'a,
    A: AdjContainer<T>,
    I: Iterator<Item = &'a usize> + 'a,
type Item = &'a T;
; fn contained_iter_neighbors_with_index(
        &self,
        index: usize
    ) -> NIContainedIter<'_, T, A>Notable traits for NIContainedIter<'a, T, A>impl<'a, T, A> Iterator for NIContainedIter<'a, T, A>where
    T: 'a + Node,
    A: AdjContainer<T>,
type Item = (usize, &'a T);
; fn container_iter(&self) -> Iter<'_, A>; fn container_iter_neighbors(
        &self,
        index: usize
    ) -> NContainerIter<'_, T, A, IterWrapper<'_>>Notable traits for NContainerIter<'a, T, A, I>impl<'a, T, A, I> Iterator for NContainerIter<'a, T, A, I>where
    T: 'a,
    A: AdjContainer<T>,
    I: Iterator<Item = &'a usize> + 'a,
type Item = &'a A;
; fn dfs(&self, index: usize) -> Dfs<'_, T, A>Notable traits for Dfs<'a, T, A>impl<'a, T, A> Iterator for Dfs<'a, T, A>where
    T: 'a,
    A: AdjContainer<T>,
type Item = &'a T;
; fn dfs_with_index(&self, index: usize) -> DfsWithIndex<'_, T, A>Notable traits for DfsWithIndex<'a, T, A>impl<'a, T, A> Iterator for DfsWithIndex<'a, T, A>where
    T: 'a,
    A: AdjContainer<T>,
type Item = (usize, &'a T);
; fn bfs_index_depth(&self, index: usize) -> Bfs<'_, T, A>Notable traits for Bfs<'a, T, A>impl<'a, T, A> Iterator for Bfs<'a, T, A>where
    T: 'a,
    A: AdjContainer<T>,
type Item = (usize, &'a T, usize);
; }
Expand description

Collection of Graph iterators

Required Methods

  • get iterator over additional information stored at each vertex in order of the indices
  • iterator returns a Node (for example EmptyNode or whatever you used)
  • similar to self.container_iter().map(|container| container.contained())
  • iterate over additional information of neighbors of vertex index
  • iterator returns &T
  • sort_adj will affect the order
  • panics if index out of bounds
  • iterate over additional information of neighbors of vertex index
  • iterator returns (index_neighbor,&T)
  • sort_adj will affect the order
  • panics if index out of bounds
  • get iterator over AdjContainer in order of the indices
  • iterator returns AdjContainer<Node>, i.e., A
  • iterate over additional information of neighbors of vertex index
  • iterator returns &T
  • sort_adj will affect the order
  • panics if index out of bounds
returns Iterator
  • the iterator will iterate over the vertices in depth first search order, beginning with vertex index.
  • iterator returns node
Order

Order is guaranteed to be in DFS order, however if this order is not unambigouse adding edges and especially removing edges will shuffle the order.

Note:

Will only iterate over vertices within the connected component that contains vertex index

returns Iterator
  • the iterator will iterate over the vertices in depth first search order, beginning with vertex index.
  • Iterator returns tuple (index, node)
Order

Order is guaranteed to be in DFS order, however if this order is not unambigouse adding edges and especially removing edges will shuffle the order.

Note:

Will only iterate over vertices within the connected component that contains vertex index

returns Iterator
  • the iterator will iterate over the vertices in breadth first search order, beginning with vertex index.
  • Iterator returns tuple (index, node, depth)
depth
  • starts at 0 (i.e. the first element in the iterator will have depth = 0)
  • depth equals number of edges in the shortest path from the current vertex to the first vertex (i.e. to the vertex with index index)
Order

Order is guaranteed to be in BFS order, however if this order is not unambigouse adding edges and especially removing edges will shuffle the order.

Note:

Will only iterate over vertices within the connected component that contains vertex index

Implementors