Skip to content

Commit b48f7bf

Browse files
author
aureooms
committed
Update dijkstra.js
1 parent 0e97057 commit b48f7bf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

js/src/001 undirected/offline/algo/sp/dijkstra.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ var dijkstra_t = function(priority_queue_t){
3333
dist[y[0]] = v;
3434
prev[y[0]] = m[0];
3535
}
36-
36+
// /!\ FLAWED : if updated element y already in the queue
37+
// the priority queue doesn't guarantee that the predicate will hold
38+
// true --> should use a pq allowing updating operations.
3739
if(!busy[y[0]]){
3840
left.push(y);
3941
busy[y[0]] = true;
@@ -50,4 +52,4 @@ var dijkstra_t = function(priority_queue_t){
5052
};
5153

5254

53-
exports.dijkstra_t = dijkstra_t;
55+
exports.dijkstra_t = dijkstra_t;

0 commit comments

Comments
 (0)