[Neo4j] Re: Shortest Path Algoritm with cost?

2014-03-24 Thread Antonio Grimaldi
i tried to execute this cypher query : StringBuilder sb = new StringBuilder("START startNode = node(269604), endNode = node(269605) MATCH path=(startNode)-[:CAR_MAIN_NODES_RELATION*]-(endNode) RETURN path AS shortestPath, reduce(cost=0, rel in relationships(path) | cost + rel.edgeLength) AS t

[Neo4j] Re: Shortest Path Algoritm with cost?

2014-03-24 Thread Antonio Grimaldi
So, how can I change this default behavior for Dijkstra's algorithm, to allow for returning paths with different and diminishing cost? Thank you Antonio Grimaldi -- You received this message because you are subscribed to the Google Groups "Neo4j" group. To unsubscribe from this group and stop

Re: [Neo4j] Re: Shortest Path Algoritm with cost?

2014-03-24 Thread Mattias Persson
There's a limiter in Dijkstra and A* that will stop the iterator after all paths with the lowest cost (if there are multiple) have been returned. This could and probably should be changed to allow for returning paths with diminishing cost as long as the user of the iterator pulls items. 2014-03-2

[Neo4j] Re: Shortest Path Algoritm with cost?

2014-03-23 Thread Antonio Grimaldi
Hi Michael, thanks for your answer. I tried to use WeightedPath path = dijkstraPath.findAllPaths(startNode, endNode); But always one path is returned, except when there are two or more paths with the same cost. Instead i would like to found the firts 3 alternative path, with different cost. Ant

[Neo4j] Re: Shortest Path Algoritm with cost?

2014-03-23 Thread Antonio Grimaldi
Nobody can help me? -- You received this message because you are subscribed to the Google Groups "Neo4j" group. To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.