albertorestifo/node-dijkstra

Bidirectional paths?

Opened this issue · 1 comments

{ A: { B: 5, D: 5, E: 7 },B: { C: 4 },C: { D: 8, E: 2 },D: { C: 8, E: 6 },E: { B: 3 } }

Given the above graph data, when trying to get the path for ['B','B'], it returns null instead of ['B','E','C','B']

Is there a way to find a circular path for as single source, shortest route preferred?

I can see why that might be an interesting use case.

Right now the API doesn't allow searching a circular path. Implementing it it's not that straight forward either because of the priority queue optimization.

I might have a look about it this weekend if I have time. PRs welcome.