https://www.neo4j.com/docs/apoc/current/graph-querying/expand-spanning-tree/
Expand a spanning tree - APOC Core Documentation
This section describes a procedure that finds a spanning tree that starts from a set of start nodes.
expand a spanning treeapoc coredocumentation