Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

graph-data-structure

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graph-data-structure - npm Package Compare versions

Comparing version 1.6.0 to 1.7.0

5

graph-data-structure.js

@@ -280,5 +280,7 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.GraphDataStructure = f()}})(function(){var define,module,exports;return (function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(require,module,exports){

var nodeList = [];
var weight = 0;
var node = destination;
while(p[node]){
nodeList.push(node);
weight += getEdgeWeight(p[node], node);
node = p[node];

@@ -291,2 +293,3 @@ }

nodeList.reverse();
nodeList.weight = weight;
return nodeList;

@@ -333,2 +336,2 @@ }

},{}]},{},[1])(1)
});
});

3

index.js

@@ -279,5 +279,7 @@ // A graph data structure with depth-first search and topological sort.

var nodeList = [];
var weight = 0;
var node = destination;
while(p[node]){
nodeList.push(node);
weight += getEdgeWeight(p[node], node);
node = p[node];

@@ -290,2 +292,3 @@ }

nodeList.reverse();
nodeList.weight = weight;
return nodeList;

@@ -292,0 +295,0 @@ }

{
"name": "graph-data-structure",
"version": "1.6.0",
"version": "1.7.0",
"description": "A graph data structure with topological sort.",

@@ -30,2 +30,3 @@ "main": "index.js",

"devDependencies": {
"browserify": "^16.1.1",
"graph-diagrams": "^0.5.0",

@@ -32,0 +33,0 @@ "mocha": "^3.5.0"

@@ -220,3 +220,3 @@ # graph-data-structure

Performs [Dijkstras Algorithm](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm). Returns an array of node identifier strings. The returned array includes the nodes of the shortest path from source to destination node. Inspired by by Cormen et al. "Introduction to Algorithms" 3rd Ed. p. 658.
Performs [Dijkstras Algorithm](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm). Returns an array of node identifier strings. The returned array includes the nodes of the shortest path from source to destination node. The returned array also contains a `weight` property, which is the total weight over all edges in the path. Inspired by by Cormen et al. "Introduction to Algorithms" 3rd Ed. p. 658.

@@ -223,0 +223,0 @@ <p align="center">

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc