Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsnx.allPairsDijkstraPath fails with complex node types #57

Open
darendt opened this issue Dec 10, 2015 · 0 comments
Open

jsnx.allPairsDijkstraPath fails with complex node types #57

darendt opened this issue Dec 10, 2015 · 0 comments
Labels

Comments

@darendt
Copy link

darendt commented Dec 10, 2015

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.

@fkling fkling added the bug label Dec 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants