记录学习过程中的问题
1、最短路径
allshortestpaths 或者 shortestpath 返回的是最短路径(不考虑权重),即仅考虑最短跳转次数。限定最大深度为7时,它们只返回最短跳转的路径
(1)shortestpath 当最短路径长度为3的路径条数一共有2两条,它只会返回其中一条
p2=graph.run('match p=shortestpath((a:node)-[r:rel*..7]->(b:node)) where a.name="a" and b.name="d" return p').data()
实验结果
{'p': Path(Node('node', name='a'), rel(Node('node', name='a'), Node('node', name='f')), rel(Node('node', name='f'), Node('node', name='k')), rel(Node('node', name='k'), Node('node', name='d')))}
(2)allshortestpaths当最短路径长度为3的路径条数一共有2两条,它只全部返回
p2=graph.run(