当前位置:   article > 正文

neo4j 最短路径规划_neo4j车间搬运路径规划

neo4j车间搬运路径规划

1、用快速算法检索最短路径

match (n) ,(n1),p=shortestPath((n)-[r]-(n1)) where all (r in rels where exists(r.role)) return p

    因为没有断言需要查看所有路径

2、使用穷举搜索

match (n),(n1),p=shortestPath ((n)-[*]-(n1)) where length(p)>1 return p

   在知道哪条是最短路径之前,需要检查所有路径。

3、禁止使用穷举搜索

match (n),(n1),p=shortestPath ((n)-[*]-(n1))  with where length(p)>1 return p

使用with 语句使得查询计划不使用穷举搜索算法,可能会导致没有结果返回。

 

 

查询计划怎么看?

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/天景科技苑/article/detail/1013727
推荐阅读
相关标签
  

闽ICP备14008679号