On Sunday, 29 April 2012 13:34:51 UTC+1, Mattias Persson wrote:
> Have you got an example where it returns a path that isn't the shortest?
> findSinglePath will by design return the shortest path. The maxLength (=4
> in your case) parameter is just to limit how far it is allowed to go if it
> doesn't find any shorter path along the way.
> 2012/4/29 Mirko Nasato <mirko.nas...@gmail.com>
>> Hi all,
>> Given
>> PathFinder<Path> finder = GraphAlgoFactory.shortestPath(expander, 4);
>> finder.findSinglePath(startNode, endNode);
>> seems like findSinglePath is not guaranteed to find the *shortest* path,
>> it just returns the first path it finds with length <= 4.
>> So it can return a path of length 4 even though one of length 3 exists -
>> and can be found using findAllPaths instead. Is that by design?
>> (I'm using Neo4j 1.7.)
>> Thanks
>> Mirko
> --
> Mattias Persson, [matt...@neotechnology.com]
> Hacker, Neo Technology
> www.neotechnology.com
On Sunday, 29 April 2012 13:34:51 UTC+1, Mattias Persson wrote:
> Have you got an example where it returns a path that isn't the shortest?
> findSinglePath will by design return the shortest path. The maxLength (=4
> in your case) parameter is just to limit how far it is allowed to go if it
> doesn't find any shorter path along the way.
> 2012/4/29 Mirko Nasato <mirko.nas...@gmail.com>
>> Hi all,
>> Given
>> PathFinder<Path> finder = GraphAlgoFactory.shortestPath(expander, 4);
>> finder.findSinglePath(startNode, endNode);
>> seems like findSinglePath is not guaranteed to find the *shortest* path,
>> it just returns the first path it finds with length <= 4.
>> So it can return a path of length 4 even though one of length 3 exists -
>> and can be found using findAllPaths instead. Is that by design?
>> (I'm using Neo4j 1.7.)
>> Thanks
>> Mirko
> --
> Mattias Persson, [matt...@neotechnology.com]
> Hacker, Neo Technology
> www.neotechnology.com
On Sunday, 29 April 2012 13:34:51 UTC+1, Mattias Persson wrote:
> Have you got an example where it returns a path that isn't the shortest?
> findSinglePath will by design return the shortest path. The maxLength (=4
> in your case) parameter is just to limit how far it is allowed to go if it
> doesn't find any shorter path along the way.
> 2012/4/29 Mirko Nasato <mirko.nas...@gmail.com>
>> Hi all,
>> Given
>> PathFinder<Path> finder = GraphAlgoFactory.shortestPath(expander, 4);
>> finder.findSinglePath(startNode, endNode);
>> seems like findSinglePath is not guaranteed to find the *shortest* path,
>> it just returns the first path it finds with length <= 4.
>> So it can return a path of length 4 even though one of length 3 exists -
>> and can be found using findAllPaths instead. Is that by design?
>> (I'm using Neo4j 1.7.)
>> Thanks
>> Mirko
> --
> Mattias Persson, [matt...@neotechnology.com]
> Hacker, Neo Technology
> www.neotechnology.com