graph_algorithms/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#![forbid(unsafe_code)]

pub mod dijkstra;

pub use dijkstra::*;

/// A trait for graph search algorithms.
pub trait GraphAlgorithm {
    /// Run the graph algorithm.
    ///
    /// # Arguments
    ///
    /// - `start`: The starting node.
    ///
    /// # Returns
    ///
    /// A vector of the shortest path from the starting node to all other nodes.
    fn run(&self, start: usize) -> Vec<usize>;
}