cancel
Showing results for 
Search instead for 
Did you mean: 

Node depth (DFS/BFS)

Augustin
Node

Hi all,

My question is very simple : Is there anyway to obtain the node depths from the results produced by BFS/DFS algorithms.

I appears that these algos only produce the path they used to visit the graph.

Thank you in advanvce

Best,

Augustin

1 ACCEPTED SOLUTION

ameyasoft
Graph Maven

Use apoc.path.spanningTree with bfs filter setting to 'false' to get DFS results. Default value for bfs is 'true' and thus gives BFS results.

View solution in original post

1 REPLY 1

ameyasoft
Graph Maven

Use apoc.path.spanningTree with bfs filter setting to 'false' to get DFS results. Default value for bfs is 'true' and thus gives BFS results.

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.