Comparing version 1.2.6 to 1.2.7
@@ -5,3 +5,3 @@ // Generated by CoffeeScript 1.10.0 | ||
PriorityQueue = require("js-priority-queue"); | ||
PriorityQueue = require("heap"); | ||
@@ -21,6 +21,4 @@ dijkstra = function(graph, weightFn) { | ||
data = {}; | ||
pq = new PriorityQueue({ | ||
comparator: function(a, b) { | ||
return a.distance - b.distance; | ||
} | ||
pq = new PriorityQueue(function(a, b) { | ||
return a.distance - b.distance; | ||
}); | ||
@@ -34,3 +32,3 @@ data[src] = { | ||
i = ref[j]; | ||
pq.queue({ | ||
pq.push({ | ||
i: i, | ||
@@ -40,4 +38,4 @@ distance: weightFn(edges[i]) | ||
} | ||
while (pq.length > 0) { | ||
elem = pq.dequeue(); | ||
while (pq.size() > 0) { | ||
elem = pq.pop(); | ||
i = elem.i, distance = elem.distance; | ||
@@ -53,3 +51,3 @@ v = edges[i].dst; | ||
ee = ref1[k]; | ||
pq.queue({ | ||
pq.push({ | ||
i: ee, | ||
@@ -56,0 +54,0 @@ distance: distance + weightFn(edges[ee]) |
@@ -7,3 +7,3 @@ // Generated by CoffeeScript 1.10.0 | ||
PriorityQueue = require("js-priority-queue"); | ||
PriorityQueue = require("heap"); | ||
@@ -188,13 +188,11 @@ Graph = require("../"); | ||
})(this), {}); | ||
pq = new PriorityQueue({ | ||
comparator: function(a, b) { | ||
return a.distance - b.distance; | ||
} | ||
pq = new PriorityQueue(function(a, b) { | ||
return a.distance - b.distance; | ||
}); | ||
pq.queue({ | ||
pq.push({ | ||
node: src, | ||
distance: 0 | ||
}); | ||
while (pq.length > 0) { | ||
x = pq.dequeue(); | ||
while (pq.size() > 0) { | ||
x = pq.pop(); | ||
demsPerEdge = {}; | ||
@@ -232,3 +230,3 @@ edgesPerDem = {}; | ||
}; | ||
pq.queue(newNode); | ||
pq.push(newNode); | ||
load[e_dst] = {}; | ||
@@ -235,0 +233,0 @@ } |
{ | ||
"name": "libgraph", | ||
"version": "1.2.6", | ||
"version": "1.2.7", | ||
"description": "graph lib in js/coffee", | ||
@@ -31,3 +31,3 @@ "main": "Graph.js", | ||
"dependencies": { | ||
"js-priority-queue": "^0.1.3", | ||
"heap": "^0.2.6", | ||
"keep-n-first": "^1.0.0", | ||
@@ -34,0 +34,0 @@ "rat.js": "^1.2.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
139154
2429
+ Addedheap@^0.2.6
+ Addedheap@0.2.7(transitive)
- Removedjs-priority-queue@^0.1.3
- Removedjs-priority-queue@0.1.5(transitive)