如何通过起点,寻找经过几个点的最短路径,剩下几个点顺序先后顺序不固定,找到经过这几个点的最短路径,如何查询
with ["player100","player101","player125"] as planN match p = (v1:player)-[:follow*2]->(v2:player) where id(v1) in planN and reduce(ll=list[],x in nodes(p)|case id(x) in ll or id(x) not in planN when false then ll + id(x) end ) with p,relationships(p) as ee return p, reduce (degree=0, xx in ee| degree+xx.degree) as totaldegree order by totaldegree desc
先回复,mark 下
去掉使用路径:with [“player100”,“player101”,“player125”] as planN match (v1:player)-[e:follow*2]->(v2:player) where id(v1) in planN and id(v2) in planN and reduce(ll=list[id(v1)],x in e| case dst(x) in ll or dst(x) not in planN when false then ll + dst(x) end) with e return e, reduce(degree=0, xx in e| degree+xx.degree) as totaldegree order by totaldegree desc
此话题已在最后回复的 30 天后被自动关闭。不再允许新回复。