graph-paths is a small module for finding cheapest (shortest) paths in a dense graph (network).
Installation
$ npm install graph-paths
Example
var cheapest_paths = cheapest_paths; /* * The network is defined by a matrix describing the cost of getting from node i to node j. * If there is no way from node i to node j, then the cost is infinite. */var costs = 01720 Infinity0419 InfinityInfinity07 InfinityInfinityInfinity0; var cheapest_paths_from_0 = ;console;consoledircheapest_paths_from_0; console;consoledircheapest_paths_from_03path;