Thanks Anders However not only is my graph weighted but also I want to traverse only in the outgoing direction so FindSinglePath does not seem to be appropriate. I can ignore the weights for now but the direction is really important. So I need more suggestions. Ideally I would like to somehow extend Dijkstra to limit it to a maximum degree of depth. By looking at the source code, I think I will have to duplicate a lot of code in the subclass to do that. Is there any elegant way to go about this? Extending the FindSinglePath to limit it to one direction seems to be easier but its not exactly what I want.
Thanks again for your help. Regards Nabeel Mukhtar ----- Original Message ---- From: Anders Nawroth <and...@neotechnology.com> To: Neo user discussions <user@lists.neo4j.org> Sent: Wed, October 14, 2009 4:13:27 PM Subject: Re: [Neo] Limiting Dijkstra's search algorithm to maximum degrees of depth. Hi! If you have an unweighted graph, you could look into using the FindSinglePath class: http://components.neo4j.org/graph-algo/apidocs/org/neo4j/graphalgo/shortestpath/FindSinglePath.html /anders Nabeel Siddiqui wrote: > Hi All > I have a question about the graph algo components of neo4j. Specifically the > org.neo4j.graphalgo.shortestpath.Dijkstra algorithm. Can we limit the search > for shortest path to a maximum degree of depth? For example: if i have a the > maximum degree of depth set to 2 then the following path between Node1 and > Node4 (though shortest) should not be returned. > Node1 -> Node2 -> Node3 -> Node4 > > In fact the traversal should immediately stop after the degree of depth has > reached. > I know there are limitMaxRelationShipsToTraverse() and > limitMaxNodesToTraverse() methods but none of them seem to limit the search > to the degrees of depth. > > Are there any alternatives? > > Thanks for your help. > > Regards > > Nabeel Mukhtar > > > > > _______________________________________________ > Neo mailing list > User@lists.neo4j.org > https://lists.neo4j.org/mailman/listinfo/user > _______________________________________________ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user _______________________________________________ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user