Skip to content

Commit a5c5240

Browse files
committed
fix a bug in dijkstra
1 parent bc16e44 commit a5c5240

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/dijkstra.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ namespace alg {
7676
list_for_each_entry(v, &u->v_head, v_node){
7777
uint32_t alt = dist_u + v->weight;
7878
uint32_t dist_v = dist[v->id];
79-
if (alt < dist_v && !visited[v->id]) {
79+
if (alt < dist_v) {
8080
/*
8181
uint32_t tmp = dist[v->id];
8282
if (tmp != INT_MAX) {

0 commit comments

Comments
 (0)