chriswongtv / node-all-paths

JavaScript implementation to find all possible paths in a graph
MIT License
6 stars 3 forks source link

Possibly missing path #1

Open takotuesday opened 8 years ago

takotuesday commented 8 years ago

Hi, I created a graph with the following nodes/edges:

graph.addNode('ES_INSTANCE', {'ES_CLUSTER': 1});
graph.addNode('ES_INSTANCE', {'ES_NODE': 1});
graph.addNode('ES_NODE', {'ES_TEST': 1});
graph.addNode('ES_CLUSTER', {'ES_INSTANCE': 1});
graph.addNode('ES_NODE', {'ES_INSTANCE': 1});
graph.addNode('ES_TEST', {'ES_NODE': 1});
graph.addNode('ES_CLUSTER', {'ES_TEST': 1});
graph.addNode('ES_TEST', {'ES_CLUSTER': 1});

Running graph.path('ES_CLUSTER', 'ES_TEST')) should result in two paths since there are two ways to reach ES_TEST from ES_NODE : [ [ 'ES_CLUSTER', 'ES_TEST' ],[ 'ES_CLUSTER','ES_INSTANCE','ES_NODE', 'ES_TEST' ] ] but instead I am only getting: [ [ 'ES_CLUSTER', 'ES_TEST' ] ]