cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Efficiently go over all connected components in graph, and add a node to each one

Hey,

So we're trying to efficiently go over all of the connected components in the graph,
and add a node with an "updateTime" property to each component - so we can easily reference recently changed components for exporting purposes.

I checked the graph data science WCC algorithm, but it seems like it requires loading the graph into memory (and a graph with 60 million nodes and counting makes it a bit tricky).

I know there's an APOC library function - like path.subgraphAll etc, but if I want to use it on every node in the graph, it becomes extremely inefficient.

Is there a better way that we're missing?

1 REPLY 1

use the gds functionality for wcc it's really fast, especially for huge graphs.

and then after you've written back the communities you can add the timestamps, e.g. by using

apoc.periodic.iterate for each community id