Dijkstra's algorithm: Difference between revisions

Line 2,763:
impl<T> Grid<T> {
fn new() -> Self {
SelfGrid { nodes: Vec::new() }
}
 
Line 2,784:
 
fn find_path(&self, start: usize, end: usize) -> Option<(Vec<usize>, usize)> {
let mut dist: Vec<= vec![(usize::MAX, Option<usize>None)> =; self.nodes.len()];
.iter()
.map(|_| (usize::MAX, None))
.collect();
 
let mut heap = BinaryHeap::new();