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§
Sourcefn add_iteration(&mut self)
fn add_iteration(&mut self)
Increment the number of iterations of the main loop of Dijkstra’s algorithm.
Sourcefn add_unnecessary_heap_element(&mut self)
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.
Sourcefn record_heap_size(&mut self, heap_size: usize)
fn record_heap_size(&mut self, heap_size: usize)
Record the current heap size of Dijkstra’s algorithm.
Sourcefn record_distance_array_size(&mut self, distance_array_size: usize)
fn record_distance_array_size(&mut self, distance_array_size: usize)
Record the current distance array size of Dijkstra’s algorithm.
Sourcefn finish_dijkstra(&mut self)
fn finish_dijkstra(&mut self)
Finish an invocation of Dijkstra’s algorithm. Performs finalisation of recorded metrics that are local to single Dijkstra invocations.
Sourcefn iterations(&self) -> Option<u64>
fn iterations(&self) -> Option<u64>
Get the number of iterations of the main loop of Dijkstra’s algorithm.
Sourcefn unnecessary_heap_elements(&self) -> Option<u64>
fn unnecessary_heap_elements(&self) -> Option<u64>
Get the number of unnecessary heap elements that were inserted during Dijkstra’s algorithm.
Sourcefn max_max_heap_size(&self) -> Option<usize>
fn max_max_heap_size(&self) -> Option<usize>
Get the maximum heap size encountered at any point during execution.
Sourcefn max_max_distance_array_size(&self) -> Option<usize>
fn max_max_distance_array_size(&self) -> Option<usize>
Get the maximum distance array size encountered at any point during execution.
Sourcefn average_max_heap_size(&self) -> Option<f64>
fn average_max_heap_size(&self) -> Option<f64>
Get the maximum heap size as average over all invocations of Dijkstra’s algorithm.
Sourcefn average_max_distance_array_size(&self) -> Option<f64>
fn average_max_distance_array_size(&self) -> Option<f64>
Get the maximum distance array size as average over all invocations of Dijkstra’s algorithm.