A weakly connected component (WCC) is a maximal group of vertices that remains connected when edge directions are ignored. In a knowledge graph, it reveals disconnected subgraphs and provides a first structural quality check. section 4.2.2 section 4.5
A practical Neo4j workflow is:
- Mark relevant nodes, such as proteins participating in INTERACTS_WITH relationships. section 4.2.2
- Create an in-memory graph projection and treat the interaction relationship as undirected. section 4.2.2
- Run gds.wcc.write and store each node’s componentId, together with component counts and distribution statistics. section 4.2.2
- Use Louvain instead when the goal is to find densely connected communities within a single connected component. section 4.2.2
PPI network inspection
A protein–protein interaction graph containing 21,559 proteins produced 27 WCCs: one component contained 21,521 proteins, while the remaining components were single nodes or small islands of up to four proteins. In entity resolution, WCCs similarly group connected person mentions in a META_PERSONS_SIMILAR metagraph before assigning a common representative name. section 4.2.2 section 6.1.4
Listing 4.9 Running the WCC on the PPI network
CALL gds.wcc.write('ppi-graph', { writeProperty: 'componentId' })
YIELD nodePropertiesWritten, componentCount, componentDistribution;
The runnable GDS procedure writes component identifiers and returns counts and distribution statistics for the projected graph. section 4.2.2

