Neo4j k-shortest paths with cost property

核能气质少年 提交于 2019-12-24 00:56:40

问题


We are using Neo4J 2.0 embedded; we have a Graph with around 1 Million of Nodes, and 50 Million of relationships; we have to find N shortestPath but with a well known cost property We saw that there is no such method in GraphAlgo class of neo4j and we were thinking to use Chyper, but when run 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...

Did anybody find a solution to this problem? How could we implement such functionality?

Any suggestion is really apreciated... Thank you Antonio

来源:https://stackoverflow.com/questions/22637194/neo4j-k-shortest-paths-with-cost-property

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!