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

Connected graphs result in RangeError: Maximum call stack size exceeded #2

Open
Leoooob opened this issue Mar 20, 2017 · 2 comments
Open

Comments

@Leoooob
Copy link

Leoooob commented Mar 20, 2017

When you are trying to build all paths for a connected graph you end up in an infinite loop in Graph.js line 113.

Example:

Graph = require('node-all-paths');
const route = new Graph();

route.addNode('A', { B:2, C:3, D:4 });
route.addNode('B', { A:2, C:4, D:5 });
route.addNode('C', { A:3, B:4, D:6 });
route.addNode('D', { A:4, B:5, C:6 });
 
var possible_routes = route.path('A', 'D', { cost:true });

A redesign of the findAll function in Graph.js would fix the issue.

@alexnault
Copy link

He's right. The current algorithm results in an infinite loop for cyclic graphs.

finn0 referenced this issue in finn0/node-all-paths Apr 11, 2018
…iable depth to limit max depth search path in a graph
@finn0 finn0 mentioned this issue Apr 11, 2018
@macasas
Copy link

macasas commented Dec 1, 2018

It's now 1 December 2018, and I am still getting this error, so I am guessing this is not fixed as stated.

I have just 13 entries, with varying values, and I either get RangeError: Maximum call stack size exceeded or it crashes my debugger in vscode.

Is this project supported, should I be looking for a different module to do this, do you have any recommendations?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants