Hi again, I just solved the problem... it was a bug because your example found a path which contained a relationship in two places, which isn't even loops (where a node can be found in more than one place in a path).
So now I'd guess it's working as you'd expect. Please let me know otherwise. It's in the trunk of the graph-algo component, latest SNAPSHOT, that is. 2010/10/18 Mattias Persson <matt...@neotechnology.com> > 2010/10/18, Yaniv Ben Yosef <yani...@gmail.com>: > > Hi Mattias, > > > > While taking a closer look at the code, I realized there's an > AllSimplePaths > > class, which can be easily modified to filter paths whose length isn't > > maxDepth (with an extra argument or subclass). I think that's the > simplest > > solution, but I'm not clear on why pathsWithLength() uses ShortestPath > > rather than AllPaths.. Is there an efficiency gain here that I don't see? > > > > Currently the AllSimplePaths traverses in one direction only, whereas > ShortestPath traverser from both directions (start and end node) > interleaved, making it more efficient. > > Filtering paths from AllSimplePaths will do the trick, but patching > ShortestPath will give better performance! > > > And a newbie question: I checked out the algo component (via the > 0.7-1.2.M01 > > tag). I have no trouble building it, but Maven doesn't create a JAR > package > > of it (the target directory only has classes). Is there a different > pom.xml > > I should use (I used the one in the root of the component directory)? I > > gather it has to be automated somewhere. > > > > Thanks! > > > > --- Yaniv > > > > > > > > On Mon, Oct 18, 2010 at 11:27 AM, Mattias Persson < > matt...@neotechnology.com > >> wrote: > > > >> 2010/10/18 Yaniv Ben Yosef <yani...@gmail.com> > >> > >> > Thanks, I figured that.. > >> > Would you be so kind reviewing the code once I finish it? > >> > > >> Sure! > >> > >> > > >> > --- Yaniv > >> > > >> > > >> > > >> > On Mon, Oct 18, 2010 at 8:20 AM, Mattias Persson > >> > <matt...@neotechnology.com>wrote: > >> > > >> > > 2010/10/18, Yaniv Ben Yosef <yani...@gmail.com>: > >> > > > Thanks Mattias! > >> > > > Do you have an expected time-frame for that? Alternatively, do you > >> have > >> > > any > >> > > > quick tips on how I would go and implement this myself? I very > >> briefly > >> > > > scanned the code in org.neo4j.graphalgo.impl.path.ShortestPath and > I > >> > > suspect > >> > > > I should test whether a node has already been visited (in > >> > > > goOneStep() > >> > > > perhaps?). > >> > > > Would you say that's the right approach? > >> > > > > >> > > > Thanks again, > >> > > > >> > > Unfortunately it's hard to estimate when there's time to do it. > >> > > > >> > > Your suggestion sounds reasonable, but keep in mind that the algo is > >> > > used for the shortest path calculation as well. So an extra argument > >> > > in the constructor for ignoring loopy paths when finding paths of a > >> > > certain length would be the way to go IMO. > >> > > > >> > > > > >> > > > --- Yaniv > >> > > > > >> > > > > >> > > > > >> > > > On Sun, Oct 17, 2010 at 10:18 PM, Mattias Persson < > >> > > matt...@neotechnology.com > >> > > >> wrote: > >> > > > > >> > > >> I just realized (it was me who put it there) that the > documentation > >> is > >> > > >> wrong. That one allows cyclic paths, as you obviously noticed :). > >> I'll > >> > > try > >> > > >> to add a simplePathsWithLength method also to take care of > that... > >> > > >> > >> > > >> 2010/10/17 Yaniv Ben Yosef <yani...@gmail.com> > >> > > >> > >> > > >> > Sure :) Will be happy to get your feedback. > >> > > >> > > >> > > >> > --- Yaniv > >> > > >> > > >> > > >> > On Sun, Oct 17, 2010 at 6:24 PM, Peter Neubauer < > >> > > >> > peter.neuba...@neotechnology.com> wrote: > >> > > >> > > >> > > >> > > Hi Yaniv, > >> > > >> > > thanks for the report, I will take a look at it tomorrow if > >> > > >> > > that > >> > is > >> > > >> > > ok? > >> > > >> > > > >> > > >> > > Cheers, > >> > > >> > > > >> > > >> > > /peter neubauer > >> > > >> > > > >> > > >> > > VP Product Management, Neo Technology > >> > > >> > > > >> > > >> > > GTalk: neubauer.peter > >> > > >> > > Skype peter.neubauer > >> > > >> > > Phone +46 704 106975 > >> > > >> > > LinkedIn http://www.linkedin.com/in/neubauer > >> > > >> > > Twitter http://twitter.com/peterneubauer > >> > > >> > > > >> > > >> > > http://www.neo4j.org - Your high performance > >> graph > >> > > >> > database. > >> > > >> > > http://www.thoughtmade.com - Scandinavia's coolest > >> Bring-a-Thing > >> > > >> party. > >> > > >> > > > >> > > >> > > > >> > > >> > > > >> > > >> > > On Sun, Oct 17, 2010 at 1:28 PM, Yaniv Ben Yosef < > >> > yani...@gmail.com > >> > > > > >> > > >> > > wrote: > >> > > >> > > > Hi, > >> > > >> > > > > >> > > >> > > > I am playing with Neo4J version 1.2 M1, specifically > >> > > >> > > > with GraphAlgoFactory.pathsWithLength(). According to the > >> > javadoc, > >> > > >> > > > it > >> > > >> > > should > >> > > >> > > > never return paths with loops. > >> > > >> > > > However, it seems like it does. I created a simple test > case > >> to > >> > > >> > > demonstrate > >> > > >> > > > that: http://snipt.org/kpwn/ > >> > > >> > > > > >> > > >> > > > I expect the code not to show any path, but instead it > prints > >> > the > >> > > >> > > following > >> > > >> > > > path: > >> > > >> > > > > >> > > >> > > > Path: A -> B -> C -> B > >> > > >> > > > > >> > > >> > > > Please let me know if there's any fault on my side, or if > >> that's > >> > a > >> > > >> bug. > >> > > >> > > > > >> > > >> > > > Thanks, > >> > > >> > > > Yaniv > >> > > >> > > > _______________________________________________ > >> > > >> > > > Neo4j mailing list > >> > > >> > > > User@lists.neo4j.org > >> > > >> > > > https://lists.neo4j.org/mailman/listinfo/user > >> > > >> > > > > >> > > >> > > _______________________________________________ > >> > > >> > > Neo4j mailing list > >> > > >> > > User@lists.neo4j.org > >> > > >> > > https://lists.neo4j.org/mailman/listinfo/user > >> > > >> > > > >> > > >> > _______________________________________________ > >> > > >> > 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 > >> > > >> > >> > > > _______________________________________________ > >> > > > 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 > >> > > > >> > _______________________________________________ > >> > 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 > >> > > _______________________________________________ > > 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 > -- 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