pub struct DijkstraResult {
pub distances: HashMap<NodeId, f64>,
pub parents: HashMap<NodeId, NodeId>,
}Expand description
Result of a Dijkstra shortest-path search from one source node.
Contains shortest distances from the source and the parent map needed
to reconstruct any shortest path via reconstruct_path.
Fields§
§distances: HashMap<NodeId, f64>Map from NodeId to the shortest distance from the source.
Only nodes reachable from the source have an entry. Unreachable
nodes are absent (not f64::INFINITY).
parents: HashMap<NodeId, NodeId>Parent of each node in the shortest-path tree.
Follow parents[v] → parents[parents[v]] → … → source to recover
the shortest path. The source itself has no parent entry.
Auto Trait Implementations§
impl Freeze for DijkstraResult
impl RefUnwindSafe for DijkstraResult
impl Send for DijkstraResult
impl Sync for DijkstraResult
impl Unpin for DijkstraResult
impl UnwindSafe for DijkstraResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more