pub struct Dijkstra<'a, W, E> { /* private fields */ }
Expand description
ダイクストラ法
Implementations§
Source§impl<'a, E> Dijkstra<'a, E::Weight, E>
impl<'a, E> Dijkstra<'a, E::Weight, E>
Sourcepub fn new(g: &'a Graph<impl Direction, E>, src: &[usize]) -> Self
pub fn new(g: &'a Graph<impl Direction, E>, src: &[usize]) -> Self
グラフg
上で、始点から各頂点への最短パスを求める。
Time complexity $O((E + V) \log V)$
Sourcepub fn min_dist_table(&self) -> &[Option<E::Weight>]
pub fn min_dist_table(&self) -> &[Option<E::Weight>]
最短距離の配列への参照を返す。
Sourcepub fn min_dist_to(&self, to: usize) -> Option<E::Weight>
pub fn min_dist_to(&self, to: usize) -> Option<E::Weight>
to
への最短距離を返す。
到達不可能ならば、None
を返す。
Auto Trait Implementations§
impl<'a, W, E> Freeze for Dijkstra<'a, W, E>
impl<'a, W, E> RefUnwindSafe for Dijkstra<'a, W, E>where
W: RefUnwindSafe,
E: RefUnwindSafe,
impl<'a, W, E> Send for Dijkstra<'a, W, E>
impl<'a, W, E> Sync for Dijkstra<'a, W, E>
impl<'a, W, E> Unpin for Dijkstra<'a, W, E>where
W: Unpin,
impl<'a, W, E> UnwindSafe for Dijkstra<'a, W, E>where
W: UnwindSafe,
E: RefUnwindSafe,
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