pub struct DijkstraPaths {
pub distances: Vec<Option<f64>>,
pub parents: Vec<Option<VertexId>>,
pub inbound_edges: Vec<Option<u32>>,
}Expand description
Output of dijkstra_paths. parents[v] is the predecessor of
v along the shortest-path tree from the single source (or None
for the source itself and for unreachable vertices — the caller can
disambiguate via distances[v]). inbound_edges[v] is the edge id
v was reached through; None for the source and unreachable
vertices.
Counterpart of the vertices+parents+inbound_edges outputs of
igraph_get_shortest_paths_dijkstra. Upstream uses sentinels
-1/-2 instead of Options; this Rust port uses None for both
“source” and “unreachable”, so callers should consult distances
to distinguish them.
Fields§
§distances: Vec<Option<f64>>distances[v] is Some(d) if v is reachable from the
source, else None. distances[source] == Some(0.0).
parents: Vec<Option<VertexId>>parents[v] is the vertex u such that the shortest-path
tree edge into v goes u → v. None for the source and
for unreachable vertices.
inbound_edges: Vec<Option<u32>>inbound_edges[v] is the edge id used to reach v in the
shortest-path tree. None for the source and for unreachable
vertices.
Trait Implementations§
Source§impl Clone for DijkstraPaths
impl Clone for DijkstraPaths
Source§fn clone(&self) -> DijkstraPaths
fn clone(&self) -> DijkstraPaths
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more