Open darendt opened 8 years ago
The following code will work when nodes are primitive objects, but not when complex objects.
function test(p) { var G = new jsnx.Graph(); G.addStar(p, {weight: 1.0}); return jsnx.allPairsDijkstraPath(G) } test([1,2,3,4]); // works test([{name: "cat"},{name: "dog"},{name: "mouse"}]); // fails test([[0,0],[0,1],[1,0]]); // fails
The error message is
Uncaught TypeError: Cannot read property 'toString' of undefined(…) n @ jsnetworkx.js:1 d @ jsnetworkx.js:3 s @ jsnetworkx.js:3 b @ jsnetworkx.js:3
Note, that the code will work when allPairsDijkstraPath is replaced with allPairsShortestPath.
The following code will work when nodes are primitive objects, but not when complex objects.
The error message is
Note, that the code will work when allPairsDijkstraPath is replaced with allPairsShortestPath.