match (target)
where size(()-->(target)) > 1
match p=((a)-[*..5]->(target))
with target, collect(distinct nodes(p)) as nodes
return *
You probably want to limit the length of the paths. In the query above, the limit is 5.
If you only care about paths that start from nodes with no incoming edge, you can use the query below:
match (source) where not ()-->(source)
with collect(distinct source) as sources
match (target)
where size(()-->(target)) > 1
unwind sources as source
match p=((source)-[*..5]->(target))
with target, collect(distinct nodes(p)) as nodes
return *