dijkstra-all.js 263 B

12345678910
  1. const dijkstra = require('./dijkstra')
  2. const _ = require('../lodash')
  3. module.exports = dijkstraAll
  4. function dijkstraAll (g, weightFunc, edgeFunc) {
  5. return _.transform(g.nodes(), function (acc, v) {
  6. acc[v] = dijkstra(g, v, weightFunc, edgeFunc)
  7. }, {})
  8. }