jrgemignani commented on issue #195:
URL: https://github.com/apache/incubator-age/issues/195#issuecomment-1072649865


   I am not aware of an openCypher [language specification] query or command 
that will allow what you asked (provided I understand what you are asking) to 
be done - other than using LIMIT to only output a specified number of results, 
but that has issues of its own -
   
   Each vertex selected and processed by the VLE in a match query can have a 
different minimum length path based on the starting vertex, edge, and ending 
vertex criteria. And the returned matching paths, and path lengths, will vary 
in order by which path finding algorithm is used. 
   
   DFS, which is used here, starts by going down one side [say left] of the 
graph from the specified starting vertex, working its way across to the other 
side [say right]. It is possible, in a graph, that only the longer matching 
paths are on the left side of the graph and they might be found first. And this 
is from an arbitrary starting vertex. So, if you stop after the first matching 
path is found, you won't necessarily get the shortest path.
   
   If BFS were used instead, the shortest matching paths would be found first, 
but the order would be from one side of the graph to the other, depending on 
the order of discovered edges. And, the minimum matching path length would be 
based on that arbitrary starting vertex. So, again, if you stop after the first 
one is found, you won't necessarily get the shortest path.
   
   In either case, you would need to go through all vertices in order to find 
the matching paths with the shortest lengths. So, if that is what you are 
looking for, you can't just stop after the first one, you need to collect all 
of them.
   
   Now, you can sort the results by the length of the path. You can also give a 
range [2..2] or [3..7] to look in.  


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to