pub struct SSSPGraph {
pub adj: Vec<Vec<Edge>>,
pub n: usize,
}Expand description
Represents a graph for SSSP algorithms.
The graph is stored as an adjacency list.
Fields§
§adj: Vec<Vec<Edge>>Adjacency list: adj[u] contains edges from node u.
n: usizeNumber of nodes in the graph.
Implementations§
Source§impl SSSPGraph
impl SSSPGraph
Sourcepub fn bmssp(
&self,
sources: Vec<(usize, f64)>,
b_bound: f64,
u_bound: usize,
) -> (HashMap<usize, f64>, HashMap<usize, usize>)
pub fn bmssp( &self, sources: Vec<(usize, f64)>, b_bound: f64, u_bound: usize, ) -> (HashMap<usize, f64>, HashMap<usize, usize>)
Runs the Bounded Memory Shortest Path (BMSSP) algorithm.
This is an internal method used by the SSSP algorithm with bounds on distance and work.
§Arguments
sources- A vector of (node, initial_distance) pairs.b_bound- The maximum distance bound.u_bound- The maximum work bound (number of relaxations).
§Returns
A tuple of (distances, parents) HashMaps.
Auto Trait Implementations§
impl Freeze for SSSPGraph
impl RefUnwindSafe for SSSPGraph
impl Send for SSSPGraph
impl Sync for SSSPGraph
impl Unpin for SSSPGraph
impl UnwindSafe for SSSPGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more