Hi Mattias, Thanks for response. I will probably try patching it and send pull request. Also this will get me more involved more in it :) About the behavior, what should it be? `null` or a path starting from node to itself? I couldn't find relevant documentation for it
Jatin On Thu, Sep 18, 2014 at 1:21 PM, Mattias Persson <[email protected]> wrote: > Yup looks like a bug to me. I'm one of the authors of that algo > implementation, so I'll see if I can have a look at it soon. > > On Tue, Sep 16, 2014 at 7:17 PM, Jatin Puri <[email protected]> wrote: > >> There is a bug <https://github.com/neo4j/neo4j/issues/2987> in >> GraphAlgoFactory (trivial but never the less irritating). Basically if you >> try finding a single shortest path from a node to itself, it gives >> following behavior: >> >> Using `GraphAlgoFactory.astar`, it throws: >> org.neo4j.graphdb.NotFoundException: Relationship -1 not found >> >> Using `GraphAlgoFactory.dijskstra`, it returns: >> A Path starting (WeightedPath#startNode) from the node and ending >> (WeightedPath#endNode) at itself but with no relationship between them. >> >> I looked at the source and found the bug in each and was rectifying it. >> But I am not sure what the behavior should be. >> >> Documentation >> <https://github.com/neo4j/neo4j/blob/master/community/graph-algo/src/main/java/org/neo4j/graphalgo/PathFinder.java> >> says >> that it should return null if no path is found. But for a path from a node >> to itself, should we assume it as a self-loop with no weight, given there >> is no explicit relationship between node to itself? Or is the behavior of >> `dijkstra` correct? (I think its wrong) >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Neo4j" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Mattias Persson > Neo4j Hacker at Neo Technology > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Neo4j" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/neo4j/5B3BLyRR_ww/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- Jatin Puri http://jatinpuri.com <http://www.jatinpuri.com> -- You received this message because you are subscribed to the Google Groups "Neo4j" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
