ShortestPath 找不到任何没有最大跳数限制的路径 [英] ShortestPath doesn't find any path without max hops limit

查看:11
本文介绍了ShortestPath 找不到任何没有最大跳数限制的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的图中,顶点 5 和 36 之间有一条路径,但是当我运行查询时:

In my graph there is a path between vertices 5 and 36 but when I run query:

match (n {Id:5}), (m {Id:36}), p=shortestPath(n-[*]->m) return length(p);

我返回了 0 行.但是,当我向路径添加最大跳数限制时,我得到了结果:

I get 0 rows returned. I get results though when I add maximum hops limit to a path:

match (n {Id:5}), (m {Id:36}), p=shortestPath(n-[*..100]->m) return length(p);

有人可以向我解释为什么没有最大跳数限制的查询不起作用吗?

Can someone explain to me why query without max hops limit doesn't work?

推荐答案

我也遇到了同样的问题,发现如果不告知最大跳数,shortestPath会限制最大跳数15.我正在使用 neo4j 2.2.1

I came across this same problem, and I found out that if you don't inform the maximum hops, the shortestPath will limit the maximum hops to 15. I'm using neo4j 2.2.1

这篇关于ShortestPath 找不到任何没有最大跳数限制的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆