pub struct TemporalDijkstra;Expand description
Dijkstra-style algorithms adapted for temporal (time-respecting) paths.
Implementations§
Source§impl TemporalDijkstra
impl TemporalDijkstra
Sourcepub fn earliest_arrival(
src: usize,
dst: usize,
start_time: f64,
edges: &[(usize, usize, f64, f64)],
n_nodes: usize,
) -> Option<TemporalPath>
pub fn earliest_arrival( src: usize, dst: usize, start_time: f64, edges: &[(usize, usize, f64, f64)], n_nodes: usize, ) -> Option<TemporalPath>
Find the earliest-arrival path from src to dst in a temporal graph.
§Arguments
src– source node iddst– destination node idstart_time– earliest time the source may be departededges– temporal edge list:(u, v, departure_time, travel_time)n_nodes– total number of nodes (node ids must be in0..n_nodes)
Returns None when no time-respecting path exists.
Sourcepub fn latest_departure(
src: usize,
dst: usize,
deadline: f64,
edges: &[(usize, usize, f64, f64)],
n_nodes: usize,
) -> Option<TemporalPath>
pub fn latest_departure( src: usize, dst: usize, deadline: f64, edges: &[(usize, usize, f64, f64)], n_nodes: usize, ) -> Option<TemporalPath>
Find the latest-departure path that still arrives at dst by deadline.
Uses a time-reversed earliest-arrival search on a reversed graph.
Sourcepub fn fastest_path(
src: usize,
dst: usize,
start_time: f64,
edges: &[(usize, usize, f64, f64)],
n_nodes: usize,
) -> Option<TemporalPath>
pub fn fastest_path( src: usize, dst: usize, start_time: f64, edges: &[(usize, usize, f64, f64)], n_nodes: usize, ) -> Option<TemporalPath>
Find the fastest temporal path (minimises total elapsed duration).
The search extends the state space with the departure time so that we
track (node, departure_time) pairs and minimise arrival - start_time.
Auto Trait Implementations§
impl Freeze for TemporalDijkstra
impl RefUnwindSafe for TemporalDijkstra
impl Send for TemporalDijkstra
impl Sync for TemporalDijkstra
impl Unpin for TemporalDijkstra
impl UnsafeUnpin for TemporalDijkstra
impl UnwindSafe for TemporalDijkstra
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more