k_shortest_paths

Function k_shortest_paths 

Source
pub fn k_shortest_paths<N, E, Ix>(
    graph: &Graph<N, E, Ix>,
    source: &N,
    target: &N,
    k: usize,
) -> Result<Vec<(f64, Vec<N>)>>
where N: Node + Debug + Clone + Hash + Eq + Ord, E: EdgeWeight + Into<f64> + Clone + Zero + One + Add<Output = E> + PartialOrd + Copy + Debug + Default, Ix: IndexType,
Expand description

Finds K shortest paths between two nodes using Yen’s algorithm

Returns up to k shortest paths sorted by total weight. Each path includes the total weight and the sequence of nodes.