【发布时间】:2018-06-23 22:20:12
【问题描述】:
我目前正在使用 Neo4j 的内置 Dijkstra 来查找最短路径,并且它有效。
START start=node(123), end=node(203454)
MATCH p=(start)-[:CONNECTS]->(end)
RETURN p as shortestPath,
REDUCE(distance=0, r in relationships(p) | distance+r.distance) AS totalDistance
ORDER BY totalDistance ASC
LIMIT 1
我希望能够使用 A* 算法,因为我的节点有纬度和经度。是否有针对此的 Cypher 查询?
【问题讨论】:
标签: neo4j cypher shortest-path a-star