neo4j - Find all shortest paths using TraversalDescription -
i need find all shortest paths between 2 nodes using traversaldescription.
(i cannot use cypher procedure allshortestpaths() because need add specific evaluator later: neo4j: shortest paths specific relation types sequence constrain )
node startnode = ...; node endnode = ...; traversaldescription td = graphdb.traversaldescription() .breadthfirst() .evaluator(evaluators.endnodeis(evaluation.include_and_prune, evaluation.exclude_and_continue, endnode)); (path path : td.traverse(startnode)) { // 1 path found } i 1 path.
but if run cypher query:
match (startnode{...}) match (endnode{...}) match path = allshortestpaths((startnode)-[*]-(endnode)) return path; there more 1 paths found same startnode , endnode.
how set traversaldescription find (shortest) paths?
some suggestions:
take @ how
shortestpath,allshortestpthsactually implemented. may able modify copy of code want. traversadescription not used @ all.there "experimental" bidirectionaltraversaldescription seems closer design of
shortestpath,allshortestpthsimplementations. might able use instead.
Comments
Post a Comment