pub struct Dijkstra<'a, N, E, A, H, S = DefaultHashBuilder>where
A: GraphProps,
H: HyperGraph<N, E, A>,{ /* private fields */ }
Expand description
Dijkstra’s shortest path algorithm for hypergraphs
Implementations§
Source§impl<'a, N, E, A, H, S> Dijkstra<'a, N, E, A, H, S>
impl<'a, N, E, A, H, S> Dijkstra<'a, N, E, A, H, S>
Sourcepub const fn distances(&self) -> &HashMap<VertexId<A::Ix>, E, S>
pub const fn distances(&self) -> &HashMap<VertexId<A::Ix>, E, S>
returns a reference to the distances
Sourcepub const fn distances_mut(&mut self) -> &mut HashMap<VertexId<A::Ix>, E, S>
pub const fn distances_mut(&mut self) -> &mut HashMap<VertexId<A::Ix>, E, S>
returns a mutable reference to the distances
Sourcepub const fn previous(&self) -> &HashMap<VertexId<A::Ix>, VertexId<A::Ix>, S>
pub const fn previous(&self) -> &HashMap<VertexId<A::Ix>, VertexId<A::Ix>, S>
returns a reference to the previous history
Sourcepub const fn previous_mut(
&mut self,
) -> &mut HashMap<VertexId<A::Ix>, VertexId<A::Ix>, S>
pub const fn previous_mut( &mut self, ) -> &mut HashMap<VertexId<A::Ix>, VertexId<A::Ix>, S>
returns a mutable reference to the previous history
Sourcepub const fn visited(&self) -> &VertexSet<A::Ix, S>
pub const fn visited(&self) -> &VertexSet<A::Ix, S>
returns a reference to the visited vertices
Sourcepub const fn visited_mut(&mut self) -> &mut VertexSet<A::Ix, S>
pub const fn visited_mut(&mut self) -> &mut VertexSet<A::Ix, S>
returns a mutable reference to the visited vertices
Sourcepub fn set_distances(
&mut self,
distances: HashMap<VertexId<A::Ix>, E, S>,
) -> &mut Self
pub fn set_distances( &mut self, distances: HashMap<VertexId<A::Ix>, E, S>, ) -> &mut Self
update the distances and returns a mutable reference to the instance
Sourcepub fn set_previous(
&mut self,
previous: HashMap<VertexId<A::Ix>, VertexId<A::Ix>, S>,
) -> &mut Self
pub fn set_previous( &mut self, previous: HashMap<VertexId<A::Ix>, VertexId<A::Ix>, S>, ) -> &mut Self
update the previous history and returns a mutable reference to the instance
Sourcepub fn set_visited(&mut self, visited: VertexSet<A::Ix, S>) -> &mut Self
pub fn set_visited(&mut self, visited: VertexSet<A::Ix, S>) -> &mut Self
update the visited vertices and returns a mutable reference to the instance
Sourcepub fn add_distance(
&mut self,
vertex: VertexId<A::Ix>,
distance: E,
) -> &mut Self
pub fn add_distance( &mut self, vertex: VertexId<A::Ix>, distance: E, ) -> &mut Self
add a new node to the distances
Sourcepub fn add_previous(
&mut self,
vertex: VertexId<A::Ix>,
previous: VertexId<A::Ix>,
) -> &mut Self
pub fn add_previous( &mut self, vertex: VertexId<A::Ix>, previous: VertexId<A::Ix>, ) -> &mut Self
add a vertex to the previous history
Sourcepub fn add_visited(&mut self, vertex: VertexId<A::Ix>) -> &mut Self
pub fn add_visited(&mut self, vertex: VertexId<A::Ix>) -> &mut Self
record a vertex as visited
Sourcepub fn find_path(
&mut self,
start: VertexId<A::Ix>,
dest: VertexId<A::Ix>,
) -> Result<<Self as PathFinder<A::Ix>>::Path>where
Self: PathFinder<A::Ix>,
pub fn find_path(
&mut self,
start: VertexId<A::Ix>,
dest: VertexId<A::Ix>,
) -> Result<<Self as PathFinder<A::Ix>>::Path>where
Self: PathFinder<A::Ix>,
Find the shortest path from start
to goal
Sourcepub fn search(
&mut self,
start: VertexId<A::Ix>,
) -> Result<<Self as Search<VertexId<A::Ix>>>::Output>
pub fn search( &mut self, start: VertexId<A::Ix>, ) -> Result<<Self as Search<VertexId<A::Ix>>>::Output>
search for a path starting from start
to the vertex with the largest ID
Sourcepub fn has_visited<Q>(&self, vertex: &Q) -> bool
pub fn has_visited<Q>(&self, vertex: &Q) -> bool
returns true if the vertex is visited