我需要找到包含特定类型节点的两个节点之间的最短路径。
以下是我的Cypher查询语句:
Match p = shortestpath((E1:Entity{seq:"123"}) –[*]-(E2:Entity{seq:"456"})))
Where any(x in nodes(path) where x:T)
Return path
T:标签,可以有数百万个节点 dbgraph大小为4GB
问题在于它只能在跳数限制到5时才能工作,这是不够的。
有没有优化重写的想法?当跳数达到6或以上时会崩溃。