There is a
bug 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 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)