graph.js
graph.js copied to clipboard
Other traversal algorithms
Do any of the methods here accomplish either a depth-first or breadth-first traversal directly? It doesn't seem like that is the case, although there are clearly other algorithms sprinkled in.
If they are not included, is it because they are not difficult to implement by hand?
Just searching around, I've come to discover a lot more tree traversal algorithms.
I suppose issue is similar to (if not an outright duplicated of) #8. Do you think this library will expose some sort of "plugin" infrastructure to add different algorithms? Or are you thinking that these libraries are standalone?
var Graph = require('graph.js');
var DFT = require('depth-first-traversal');
var graph = new Graph();
// standalone
DFT(graph, function (key, value) {
// visit vertex
});
// plugin
graph.use(DFT);
graph.walk('depth-first', function (key, value) {
// visit vertex
});