Trait DijkstraPerformanceData

Source
pub trait DijkstraPerformanceData {
    // Required methods
    fn add_iteration(&mut self);
    fn add_unnecessary_heap_element(&mut self);
    fn record_heap_size(&mut self, heap_size: usize);
    fn record_distance_array_size(&mut self, distance_array_size: usize);
    fn finish_dijkstra(&mut self);
    fn iterations(&self) -> Option<u64>;
    fn unnecessary_heap_elements(&self) -> Option<u64>;
    fn max_max_heap_size(&self) -> Option<usize>;
    fn max_max_distance_array_size(&self) -> Option<usize>;
    fn average_max_heap_size(&self) -> Option<f64>;
    fn average_max_distance_array_size(&self) -> Option<f64>;
}
Expand description

Performance data collected by Dijkstra’s algorithm. This trait allows to collect the performance data optionally, by providing a type that either collects it, or ignores it.

Required Methods§

Source

fn add_iteration(&mut self)

Increment the number of iterations of the main loop of Dijkstra’s algorithm.

Source

fn add_unnecessary_heap_element(&mut self)

Increment the number of heap elements that already have a lower weight than what was stored in the heap. These are wasted cycles because our heap does not support the decrease_key operation.

Source

fn record_heap_size(&mut self, heap_size: usize)

Record the current heap size of Dijkstra’s algorithm.

Source

fn record_distance_array_size(&mut self, distance_array_size: usize)

Record the current distance array size of Dijkstra’s algorithm.

Source

fn finish_dijkstra(&mut self)

Finish an invocation of Dijkstra’s algorithm. Performs finalisation of recorded metrics that are local to single Dijkstra invocations.

Source

fn iterations(&self) -> Option<u64>

Get the number of iterations of the main loop of Dijkstra’s algorithm.

Source

fn unnecessary_heap_elements(&self) -> Option<u64>

Get the number of unnecessary heap elements that were inserted during Dijkstra’s algorithm.

Source

fn max_max_heap_size(&self) -> Option<usize>

Get the maximum heap size encountered at any point during execution.

Source

fn max_max_distance_array_size(&self) -> Option<usize>

Get the maximum distance array size encountered at any point during execution.

Source

fn average_max_heap_size(&self) -> Option<f64>

Get the maximum heap size as average over all invocations of Dijkstra’s algorithm.

Source

fn average_max_distance_array_size(&self) -> Option<f64>

Get the maximum distance array size as average over all invocations of Dijkstra’s algorithm.

Implementors§