pub trait DijkstraPerformanceData {
fn add_iteration(&mut self);
fn add_unnecessary_heap_element(&mut self);
fn iterations(&self) -> Option<u64>;
fn unnecessary_heap_elements(&self) -> Option<u64>;
}
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
fn add_iteration(&mut self)
fn add_iteration(&mut self)
Increment the number of iterations of the main loop of Dijkstra’s algorithm.
fn 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.
fn iterations(&self) -> Option<u64>
fn iterations(&self) -> Option<u64>
Get the number of iterations of the main loop of Dijkstra’s algorithm.
fn 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.