pub struct Dijkstra { /* private fields */ }
Expand description
A bidirectional implementation of Dijkstra’s algorithm. This implementation reuses the underlying datastructures to speedup multiple computations.
This implementation is correct for contracted and non-contracted graphs. However, the performance highly depends on a flag in the config, which has to be provided when computing the best path.
Implementations
sourceimpl Dijkstra
impl Dijkstra
pub fn new() -> Dijkstra
sourcepub fn compute_best_path(&mut self, query: Query<'_>) -> Option<Path>
pub fn compute_best_path(&mut self, query: Query<'_>) -> Option<Path>
None means no path exists, whereas an empty path is a path from a node to itself.
ATTENTION! If any alpha-value in the routing-config is negative, or any metric in the graph is negative, this method won’t terminate.
Auto Trait Implementations
impl RefUnwindSafe for Dijkstra
impl Send for Dijkstra
impl Sync for Dijkstra
impl Unpin for Dijkstra
impl UnwindSafe for Dijkstra
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.