pub struct Dijkstra<Graph: GraphBase, WeightType: DijkstraWeight, NodeWeights: NodeWeightArray<WeightType>, Heap: DijkstraHeap<WeightType, Graph::NodeIndex>> { /* private fields */ }
Expand description

Data structure for Dijkstra’s shortest path algorithm.

This variant of Dijkstra’s algorithm supports only computing the length of a shortest path, and not the shortest path itself. Therefore it does not need an array of back pointers for each node, saving a bit of memory.

Implementations§

source§

impl<WeightType: DijkstraWeight + Eq + Debug, EdgeData: DijkstraWeightedEdgeData<WeightType>, Graph: StaticGraph<EdgeData = EdgeData>, NodeWeights: NodeWeightArray<WeightType>, Heap: DijkstraHeap<WeightType, Graph::NodeIndex>> Dijkstra<Graph, WeightType, NodeWeights, Heap>

source

pub fn new(graph: &Graph) -> Self

Create the data structures for the given graph.

source

pub fn shortest_path_lens<TargetMap: DijkstraTargetMap<Graph>, DijkstraPerformance: DijkstraPerformanceData>( &mut self, graph: &Graph, source: Graph::NodeIndex, targets: &TargetMap, target_amount: usize, max_weight: WeightType, forbid_source_target: bool, distances: &mut Vec<(Graph::NodeIndex, WeightType)>, max_node_weight_data_size: usize, max_heap_data_size: usize, performance_data: DijkstraPerformance ) -> DijkstraStatus<DijkstraPerformance>

Compute the shortest paths from source to all targets, with given maximum weight.

max_node_weight_data_size: the maximum number of nodes for which a weight can be stored before the search aborts.

Auto Trait Implementations§

§

impl<Graph, WeightType, NodeWeights, Heap> RefUnwindSafe for Dijkstra<Graph, WeightType, NodeWeights, Heap>where Graph: RefUnwindSafe, Heap: RefUnwindSafe, NodeWeights: RefUnwindSafe, WeightType: RefUnwindSafe,

§

impl<Graph, WeightType, NodeWeights, Heap> Send for Dijkstra<Graph, WeightType, NodeWeights, Heap>where Graph: Send, Heap: Send, NodeWeights: Send, WeightType: Send,

§

impl<Graph, WeightType, NodeWeights, Heap> Sync for Dijkstra<Graph, WeightType, NodeWeights, Heap>where Graph: Sync, Heap: Sync, NodeWeights: Sync, WeightType: Sync,

§

impl<Graph, WeightType, NodeWeights, Heap> Unpin for Dijkstra<Graph, WeightType, NodeWeights, Heap>where Graph: Unpin, Heap: Unpin, NodeWeights: Unpin, WeightType: Unpin,

§

impl<Graph, WeightType, NodeWeights, Heap> UnwindSafe for Dijkstra<Graph, WeightType, NodeWeights, Heap>where Graph: UnwindSafe, Heap: UnwindSafe, NodeWeights: UnwindSafe, WeightType: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V