Neo4j k-shortest paths with property value

We use the built-in Neo4J 2.0; we have a schedule with approximately 1 million nodes and 50 million relationships; we must find N shortestPath, but with a well-known value. We saw that there is no such method in the GraphAlgo neo4j class, and we thought to use Chyper, but when running this query

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

after 10 minutes we have not had any results yet ...

Has anyone found a solution to this problem? How could we implement such functions?

Any suggestion really appreciated ... Thanks Antonio

+2
source share

Source: https://habr.com/ru/post/1677522/


All Articles