Finding connected components in graph


(Thej Kamal Rao Menneni) #1

How do you query dgraph to get all connected sub graphs in graph?

Lets say we have 100 nodes in dgraph and there are 5 connected components, each with 20 nodes. I want to retrieve all such connected components.

At high level, I might not need to retrieve all properties of nodes or edges, just to show 5 clusters with number of nodes in each cluster.


(Michel Conrado (Support Engineer)) #2

I guess Recurse Query can help https://docs.dgraph.io/query-language/#recurse-query