Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

async-bfs

0.1.9 • Public • Published

Async breadth first search for node

Usage

var bfs = require(bfs);
bfs(starts, movefn, goalfn, callback);

where

  • start - array of possible start positions
  • movefn - function(node, callback) - a function called to retreive nodes connected to the specified node
    • callback should be called with the new nodes callback(err, newNodes)
  • goalfn - function(node, callback) - a function called to check if the node is a valid goal.
    • callback should be called with true or false callback(err, true|false)
  • callback - function(err, path)
    • path - the shortest path found.

Keywords

none

install

npm i async-bfs

Downloadsweekly downloads

9

version

0.1.9

license

none

last publish

collaborators

  • avatar
Report a vulnerability