graphology-traversal
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -39,2 +39,4 @@ /** | ||
var queue = new BFSQueue(graph); | ||
var forEachNeighbor = | ||
@@ -48,3 +50,3 @@ graph['forEach' + capitalize(options.mode || 'outbound') + 'Neighbor'].bind( | ||
if (startingNode === null) { | ||
forEachNode = graph.forEachNode.bind(graph); | ||
forEachNode = queue.forEachNodeYetUnseen.bind(queue); | ||
} else { | ||
@@ -57,3 +59,2 @@ forEachNode = function (fn) { | ||
var queue = new BFSQueue(graph.order); | ||
var record, stop; | ||
@@ -69,4 +70,2 @@ | ||
forEachNode(function (node, attr) { | ||
if (queue.has(node)) return; | ||
queue.pushWith(node, new TraversalRecord(node, attr, 0)); | ||
@@ -73,0 +72,0 @@ |
@@ -39,2 +39,4 @@ /** | ||
var stack = new DFSStack(graph); | ||
var forEachNeighbor = | ||
@@ -48,3 +50,3 @@ graph['forEach' + capitalize(options.mode || 'outbound') + 'Neighbor'].bind( | ||
if (startingNode === null) { | ||
forEachNode = graph.forEachNode.bind(graph); | ||
forEachNode = stack.forEachNodeYetUnseen.bind(stack); | ||
} else { | ||
@@ -57,3 +59,2 @@ forEachNode = function (fn) { | ||
var stack = new DFSStack(graph.order); | ||
var record, stop; | ||
@@ -69,4 +70,2 @@ | ||
forEachNode(function (node, attr) { | ||
if (stack.has(node)) return; | ||
stack.pushWith(node, new TraversalRecord(node, attr, 0)); | ||
@@ -73,0 +72,0 @@ |
{ | ||
"name": "graphology-traversal", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Traversal functions for graphology.", | ||
@@ -44,5 +44,5 @@ "main": "index.js", | ||
"dependencies": { | ||
"graphology-indices": "^0.16.4", | ||
"graphology-indices": "^0.17.0", | ||
"graphology-utils": "^2.0.0" | ||
} | ||
} |
@@ -58,3 +58,3 @@ # Graphology Traversal | ||
// Stopping at depth 3 | ||
bfsFromNode(graph, function (node, attr, depth) { | ||
bfsFromNode(graph, 'node1', function (node, attr, depth) { | ||
return depth >= 3; | ||
@@ -112,3 +112,3 @@ }); | ||
// Stopping at depth 3 | ||
dfsFromNode(graph, function (node, attr, depth) { | ||
dfsFromNode(graph, 'node1', function (node, attr, depth) { | ||
return depth >= 3; | ||
@@ -115,0 +115,0 @@ }); |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
11882
197
+ Addedgraphology-indices@0.17.0(transitive)
- Removedgraphology-indices@0.16.6(transitive)
Updatedgraphology-indices@^0.17.0