エッジの重みを含む次のグラフがあるとします。
ノード a から始まり、CYPHER を使用して重みの昇順でエッジに続くトラバーサルを実行できるかどうかを知りたいです。それはそれが戻るはずです(a)-4->(e)-3->(c)-3->(d)
これはサイファーを使用して可能ですか?
エッジの重みを含む次のグラフがあるとします。
ノード a から始まり、CYPHER を使用して重みの昇順でエッジに続くトラバーサルを実行できるかどうかを知りたいです。それはそれが戻るはずです(a)-4->(e)-3->(c)-3->(d)
これはサイファーを使用して可能ですか?
Your description is slightly wrong (based on your example), as you don't want to traverse relationships with an increasing weight, you want to traverse the relationship(s) with the maximum weight at each step.
You can't do it in a generic way in Cypher, because the result is built iteratively, and you can't know the maximum length of a result path.
In Cypher, you'd have to
The declarative nature of Cypher is not really compatible: it would be cumbersome, and probably slow as well. It would be much easier to build a procedure or function (in the upcoming Neo4j 3.1) traversing the longest path(s), with the PathExpander
only returning the relationships with the maximum weight from the current node.