pub trait DistanceMap<K> {
// Required methods
fn get(&self, node: NodeId) -> Option<&K>;
fn insert(&mut self, node: NodeId, dist: K);
// Provided method
fn contains(&self, node: NodeId) -> bool { ... }
}Expand description
A map from nodes to distances/costs.
This trait abstracts over different distance map implementations, allowing algorithms to work with various storage strategies.