A weakly connected component (WCC) is a maximal set of nodes connected by paths when relationship direction is ignored. Each component is an island: nodes inside it can reach one another, while other components remain disconnected. Running WCC early reveals graph connectivity, isolated parts, and candidates for later community detection or centrality analysis. section 5.3.1 section 5.6
A practical WCC workflow uses Neo4j Graph Data Science:
- Project or select a named in-memory graph, such as `follower-network`. section 5.3.1
- Run `gds.wcc.write` when component identifiers should be stored on database nodes: `CALL gds.wcc.write('follower-network', {writeProperty:'followerWcc'}) YIELD componentCount, componentDistribution`. section 5.3.1
- Inspect component counts and size distributions to find a dominant component, small islands, or unexpected single-member components. section 5.3.1 section 6.2.2
- Use stream mode when results should remain query output: aggregate `componentId` values, filter a size such as one member, and match the relevant graph pattern. section 6.2.2
Finding isolated retweet components
For a retweet amplification network, `gds.wcc.stats` reports 207 components, with a largest component of 1,082 members and minimum component size of one. To investigate the unexpected single-member components, stream node and component identifiers, group nodes by `componentId`, retain groups of size one, and match their retweet pattern. The resulting examples contain users who retweeted themselves. section 6.2.2

