Skip to content

Commit

Permalink
Merge pull request #10 from wx257osn2/fix-dijkstra-for-rust
Browse files Browse the repository at this point in the history
Rustのdijkstraアルゴリズムのバグの修正漏れに対応
  • Loading branch information
reki2000 authored Jun 22, 2020
2 parents 10b505d + fc09b3b commit 17dbe4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rust/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ fn dijkstra(g: &G, start: NodeId, end: NodeId) -> (Distance, Vec<NodeId>) {
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;
Expand Down

0 comments on commit 17dbe4c

Please sign in to comment.