apoc
apoc copied to clipboard
Add option on apoc.path.expandConfig() to only return "maximal" paths
Issue by dam-mond
Thursday Nov 18, 2021 at 11:11 GMT
Originally opened as https://github.com/neo4j-contrib/neo4j-apoc-procedures/issues/2339
Raising this feature request on behalf of a customer.
Feature description
Customer use case:
Currently customer is able to use the apoc.path.expand()
procedure to get all the paths from an input list of nodes.
At this point they're post-processing and manually extracting only "maximal" paths (paths that contain both the nodes and relationships of other paths and those that end at the same node).
They would like to have an option built-in directly into the APOC procedure to set this requirement, to only get these "maximal" paths.
This is also related to a Community request: https://community.neo4j.com/t/return-all-nodes-reachable-from-a-list-of-nodes-and-their-maximal-paths/47197
Considered alternatives
This can already be achieved by performing some manual Cypher post-processing of the apoc.path.expand()
result but users may not be able to optimise this post-processing phase for best performance.