The shortest path algorithm is currently the only bidirectional algorithm,
potentially reducing the number of relationships that need to be visited by
a great deal. If you give it a high enough max depth it will answer your
true/false question.

Otherwise you can use GraphAlgoFactory.allSimplePaths algo which is
basically a traversal from the start node and just see if it hits the target
node. It being single directional only would potentially make it visit more
relationships than the shortest path would. You could try out both for
comparison. It's easy to swap out since they are both PathFinder<Path>
implemenations.

2011/7/8 Lmhelp <lmhe...@orange.fr>

> Hi,
>
> I (only) need to know whether or not there exists A PATH between two
> nodes in a "Neo4j" graph.
> I am currently using the "GraphAlgoFactory.shortestPath()" method but I
> do not actually need the shortest path.
> I need a "true" or "false" answer.
> Is there any other method I could use which would solve my problem?
>
> (I don't remember whether it is faster to find *A PATH* or *A SHORTEST
> PATH* between two nodes in a graph supposing we use "efficient"
> algorithms in both cases? Can you refresh my memory?)
>
> Thank you for your help.
> Best regards,
> --
> Lmhelp
>
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Mattias Persson, [matt...@neotechnology.com]
Hacker, Neo Technology
www.neotechnology.com
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to