Trait ShortestPath

Source
pub trait ShortestPath<W> {
    // Required method
    fn shortest_path<I, OPT: ShortestPathOptions>(
        &self,
        origin_cell: H3Cell,
        destination_cells: I,
        options: &OPT,
    ) -> Result<Vec<Path<W>>, Error>
       where I: IntoIterator,
             I::Item: Borrow<H3Cell>;
}
Expand description

Implements a simple Dijkstra shortest path route finding.

While this is not the most efficient routing algorithm, it has the benefit of finding the nearest destinations first. So it can be used to answer questions like “which are the N nearest destinations” using a large amount of possible destinations.

Required Methods§

Source

fn shortest_path<I, OPT: ShortestPathOptions>( &self, origin_cell: H3Cell, destination_cells: I, options: &OPT, ) -> Result<Vec<Path<W>>, Error>
where I: IntoIterator, I::Item: Borrow<H3Cell>,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<W, G> ShortestPath<W> for G
where G: GetCellEdges<EdgeWeightType = W> + GetCellNode + HasH3Resolution + NearestGraphNodes, W: PartialOrd + PartialEq + Add + Copy + Ord + Zero,