Trait CostFn
pub trait CostFn {
type Weight: EdgeObservableRead + Send;
type Cost: Clone + PartialOrd + Send + Sync;
// Required methods
fn initial_cost(&self) -> Self::Cost;
fn min_cost(&self) -> Option<Self::Cost>;
fn into_cost_fn(
self,
) -> Box<dyn Fn(Self::Cost, &Self::Weight, usize) -> Self::Cost>;
}Expand description
Definition of a fold like cost function usable with graph traversal trait.
Required Associated Types§
type Weight: EdgeObservableRead + Send
type Cost: Clone + PartialOrd + Send + Sync
Required Methods§
fn initial_cost(&self) -> Self::Cost
fn initial_cost(&self) -> Self::Cost
The initial cost that will be modified by the cost function.