I have been using the apoc.path.subgraphAll procedure to find nodes reachable according to certain label/relationship criteria from a given starting node and in general this has been working as expected. However when I specify endNodes the returned set of nodes and relationships only includes nodes that are included in the endNodes parameter.
Why does subgraphAll behave like this? The documentation would suggest it should return the entire expansion which includes all possible paths to these end nodes?
When using the "spanningTree" procedure I get something similar to what I want, although a spanning tree by definition returns the least number of required returned and so some relationships might not be returned when using this.
Finally I tried using expandConfig which seems to return what I wanted without the potential for missing relationships that the spanningTree procedure causes. But I can't see what's substantively different about the settings for expandConfig and subgraphAll in this case.
This expertly drawn diagram illustrates my question:
Why does specifying the set of blue nodes as the endNodes property in a subgraphAll procedure call with the red node as the starting node return only the blue nodes circled red instead of the nodes along the entire expansion circled in green?