graph_algorithms

Trait GraphAlgorithm

source
pub trait GraphAlgorithm {
    // Required method
    fn run(&self, start: usize) -> Vec<usize>;
}
Expand description

A trait for graph search algorithms.

Required Methods§

source

fn run(&self, start: usize) -> Vec<usize>

Run the graph algorithm.

§Arguments
  • start: The starting node.
§Returns

A vector of the shortest path from the starting node to all other nodes.

Implementors§