python - Neo4J 通过索引中节点的最短路径

标签 python graph neo4j shortest-path cypher

我目前正在使用此 Cypher 查询来查找两个节点之间的最短路径:

START topic=node:cities(name='amsterdam'), top=node:categories(name='world')
MATCH p=shortestPath(topic-[*]->top)
RETURN p

但是,我需要路径中的节点具有特定属性,或者更好的是位于索引类别中。我怎样才能做到这一点?

谢谢

最佳答案

这是更复杂的事情,您可能应该在 https://github.com/neo4j/neo4j/tree/master/community/graph-algo/src/main/java/org/neo4j/graphalgo/impl/shortestpath 查看遍历框架和 ShortestPath 的实现。

关于python - Neo4J 通过索引中节点的最短路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15762099/

相关文章:

neo4j - 查找最常见的属性 - cypher

neo4j - Neo4j apoc 查询中参数 limit 和 maxLevel 意味着什么?

java - 这是 TransactionEventHandler 的正常行为吗?

python - 如何制作接受元组输入的Python函数?

python - 将多列合并为 1 列 [python,pandas]

Python有没有办法计算字符串插入字符串的数量?

Python:编译成 Unix 命令行应用程序

algorithm - 向图形添加边对 SCC 的影响

r - 将绘图保存在 data.table 列表列中

c# - 如何将更新传播到 Colectica DDI 项目图表中的所有项目?