Struct floyd_warshall::PathMatrix
[−]
[src]
pub struct PathMatrix<T> { /* fields omitted */ }
This matrix is a solution to the APSP problem, calculated by the Floyd-Warshall algorithm. It contains the intermediate nodes on the shortest path between every two nodes.
Methods
impl<T> PathMatrix<T>
[src]
fn new(n: usize) -> PathMatrix<T>
[src]
Creates a new PathMatrix
with the given dimension (n * n), where no paths were found yet.
That means, no nodes are yet connected in this matrix.
fn get_path_len(&self, i: usize, j: usize) -> usize
[src]
This method returns the value at the given position.
fn get_path(&self, i: usize, j: usize) -> &Path<T>
[src]
This method returns the shortest path possible between i and i.
fn get_path_iter<'a>(
&'a self,
i: usize,
j: usize
) -> impl DoubleEndedIterator<Item = &'a T>
[src]
&'a self,
i: usize,
j: usize
) -> impl DoubleEndedIterator<Item = &'a T>
This method returns the shortest path possible between i and i as an iterator.
fn does_path_exist(&self, i: usize, j: usize) -> bool
[src]
If the matrix contains a path between i and j (which means, it has a set length), this returns true.
fn set_path_len(&mut self, i: usize, j: usize, v: usize)
[src]
This method updates the value at the given position.