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:

  1. take @ how shortestpath , allshortestpths actually implemented. may able modify copy of code want. traversadescription not used @ all.

  2. there "experimental" bidirectionaltraversaldescription seems closer design of shortestpath , allshortestpths implementations. might able use instead.


Comments

Popular posts from this blog

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

android - ConstraintLayout: Realign baseline constraint in case if dependent view visibility was set to GONE -

c# - Populating Gridview inside Listview ItemTemplate On Web User Control from Code Behind -