liveBook · Manning

Weakly connected component

As explained in Graph Algorithms for Data Science

A weakly connected component algorithm identifies maximal node sets that are connected when the directions of relationships are disregarded.

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

How Graph Algorithms for Data Science covers it

How deep it goes
Explains direction-insensitive connectivity and demonstrates write, stats, and stream workflows, without covering algorithm internals.
Examples
Demonstrates follower and retweet networks, component distributions, network visualizations, and self-retweet single-member components.
What it assumes
Assumes a named projected graph and basic GDS procedure syntax while teaching graph connectivity through concrete network examples.
What you can do after
Operate/configure Neo4j GDS WCC procedures, store component identifiers, summarize sizes, and investigate disconnected or anomalous components.
How it connects
Connects WCC with graph connectivity, community detection, centrality analysis, strongly connected components, and graph projection.

Also explained in

Compare how 2 books explain weakly connected component →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Graph Algorithms for Data Science. The section links point to the parts of the book it draws on.