Aaaaaand - done. http://docs.neo4j.org/chunked/snapshot/gremlin-plugin.html#rest-api-flow-algroithms-with-gremlin
Enjoy! Cheers, /peter neubauer 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 - NOSQL for the Enterprise. http://startupbootcamp.org/ - Ă–resund - Innovation happens HERE. On Sat, Nov 19, 2011 at 8:41 AM, Peter Neubauer < peter.neuba...@neotechnology.com> wrote: > Guys, > I could put this into the docs, just for future reference. Great > contributions Marko and Alfredas! > On Nov 18, 2011 11:58 PM, "Marko Rodriguez" <okramma...@gmail.com> wrote: > >> > This seems to calculate the max flow (edges have "capacity"): >> > >> > source.outE.inV.loop(2){!it.object.equals(sink)}.paths.each{flow = >> > it.capacity.min(); maxFlow += flow; >> > it.findAll{it.capacity}.each{it.capacity -= flow}}; >> > >> > I can't believe this is so short! >> >> Thats the beauty of Gremlin. Once you "get it," you can rip some very >> complex traversals in just a few characters. >> >> NOTES: For speed, make it.capacity -> it.getProperty('capacity') >> Some good notes here: >> https://github.com/tinkerpop/gremlin/wiki/Gremlin-Groovy-Path-Optimizations >> >> Glad we could help you with your problem. >> >> Enjoy!, >> Marko. >> >> http://markorodriguez.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