From fc09b3b9c02ffd04a005cffb7710743dc42328ac Mon Sep 17 00:00:00 2001 From: I <1091761+wx257osn2@users.noreply.github.com> Date: Tue, 23 Jun 2020 04:22:25 +0900 Subject: [PATCH] fix rust --- rust/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/src/main.rs b/rust/src/main.rs index cfdb382..45dd817 100644 --- a/rust/src/main.rs +++ b/rust/src/main.rs @@ -123,7 +123,7 @@ fn dijkstra(g: &G, start: NodeId, end: NodeId) -> (Distance, Vec) { let (to, weight) = (edge.first as usize, edge.second); let w = distance + weight; // println!("visiting:{} distance:{} to:{}, d[to]:{}, w:{}, qlen:{} visited:{}", here, distance, to, d[to], w, queue.len(), visited); - if d[to] == 0 || w < d[to] { + if w < d[to] { prev[to] = here; d[to] = w; // vv[to] = vv[to] + 1;