How to use the dijkstrajs.find_path function in dijkstrajs

To help you get started, we’ve selected a few dijkstrajs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fengyuanchen / vue-qrcode / dist / vue-qrcode.common.js View on Github external
exports.fromString = function fromString (data, version) {
  var segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled());

  var nodes = buildNodes(segs);
  var graph = buildGraph(nodes, version);
  var path = dijkstra.find_path(graph.map, 'start', 'end');

  var optimizedSegs = [];
  for (var i = 1; i < path.length - 1; i++) {
    optimizedSegs.push(graph.table[path[i]].node);
  }

  return exports.fromArray(mergeSegments(optimizedSegs))
};
github soldair / node-qrcode / lib / core / segments.js View on Github external
exports.fromString = function fromString (data, version) {
  var segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled())

  var nodes = buildNodes(segs)
  var graph = buildGraph(nodes, version)
  var path = dijkstra.find_path(graph.map, 'start', 'end')

  var optimizedSegs = []
  for (var i = 1; i < path.length - 1; i++) {
    optimizedSegs.push(graph.table[path[i]].node)
  }

  return exports.fromArray(mergeSegments(optimizedSegs))
}
github fengyuanchen / vue-qrcode / dist / vue-qrcode.js View on Github external
exports.fromString = function fromString (data, version) {
	  var segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled());

	  var nodes = buildNodes(segs);
	  var graph = buildGraph(nodes, version);
	  var path = dijkstra.find_path(graph.map, 'start', 'end');

	  var optimizedSegs = [];
	  for (var i = 1; i < path.length - 1; i++) {
	    optimizedSegs.push(graph.table[path[i]].node);
	  }

	  return exports.fromArray(mergeSegments(optimizedSegs))
	};
github fengyuanchen / vue-qrcode / dist / vue-qrcode.esm.js View on Github external
exports.fromString = function fromString (data, version) {
  var segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled());

  var nodes = buildNodes(segs);
  var graph = buildGraph(nodes, version);
  var path = dijkstra.find_path(graph.map, 'start', 'end');

  var optimizedSegs = [];
  for (var i = 1; i < path.length - 1; i++) {
    optimizedSegs.push(graph.table[path[i]].node);
  }

  return exports.fromArray(mergeSegments(optimizedSegs))
};

dijkstrajs

A simple JavaScript implementation of Dijkstra's single-source shortest-paths algorithm.

MIT
Latest version published 2 years ago

Package Health Score

67 / 100
Full package analysis

Popular dijkstrajs functions