We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e97057 commit b48f7bfCopy full SHA for b48f7bf
js/src/001 undirected/offline/algo/sp/dijkstra.js
@@ -33,7 +33,9 @@ var dijkstra_t = function(priority_queue_t){
33
dist[y[0]] = v;
34
prev[y[0]] = m[0];
35
}
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.
39
if(!busy[y[0]]){
40
left.push(y);
41
busy[y[0]] = true;
@@ -50,4 +52,4 @@ var dijkstra_t = function(priority_queue_t){
50
52
};
51
53
54
-exports.dijkstra_t = dijkstra_t;
55
+exports.dijkstra_t = dijkstra_t;
0 commit comments