Ok, now i tried this :
START startNode = node(307093), endNode = node(307094)
MATCH path=allShortestPaths((startNode)-[:CAR_MAIN_NODES_RELATION*]->(
endNode))
RETURN path AS shortestPath, reduce(cost=0, rel in relationships(path) |cost
+ rel.edgeLength/rel.edgeRtSpeed) AS totalCost ORDER BY totalCost ASC
LIMIT 3
For points very close, one or more routes are calculated, but for two very
distant locations, there is no route calculated.
I'm sure that at least one path exists between the two locations because if
I run Dijkstra, in this way,
CostEvaluator<Double> costEvaluator =
CommonEvaluators.doubleCostEvaluator( "edgeLengthInserisci qui il codice...
");
PathFinder<WeightedPath> dijkstraPath =
GraphAlgoFactory.dijkstra(PathExpanders.forTypeAndDirection(relationType,
Direction.OUTGOING), costEvaluator);
WeightedPath path = dijkstraPath.findSinglePath(startNode, endNode);
//startNode.getId() = 307093 and endNode.getId() = 307094
the path is correctly returned.
This is really strange. Why do I have this behavior? there is some
limitation to allShortestPath algoritm?
thanks
Il giorno martedì 25 marzo 2014 09:20:19 UTC+1, Antonio Grimaldi ha scritto:
>
> 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 totalCost
> ORDER BY totalCost ASC
> LIMIT 3")
>
> ResourceIterator<Object> pathsList = this.executionEngine.execute(sb.
> toString()).columnAs("shortestPath");
>
> but, after 10 minutes, I have not had any results yet...
>
> My graph had 157689 nodes and 1063621 edges.
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.