pub trait Accumulator<T> {
    // Required method
    fn accum(dist: T, weight: T) -> T;
}
Expand description

A binary operation used to accumulate edge weight and distance.

The default operation for Dijkstra’s algorithm is the sum, for Prim’s algorithm it is simply the edge weight ignoring the “distance”.

Required Methods§

source

fn accum(dist: T, weight: T) -> T

Implementors§

source§

impl<T> Accumulator<T> for SumAccumulatorwhere T: Add<Output = T>,