liveBook · Manning

Community detection

As explained in Knowledge Graphs and LLMs in Action

A community detection algorithm identifies groups of graph nodes that are more strongly or densely connected to one another than to nodes outside the groups.

Community detection identifies latent groups in a graph by finding nodes that connect more densely to one another than to nodes outside the group. It is an unsupervised, node-focused task that uses graph topology and relationships without labels. section 9.2 section 9.2.3

A practical analysis pipeline separates connectivity from community structure:

  • Represent the relevant nodes and relationships as a graph or in-memory graph projection. section 4.2.2
  • Use weakly connected components to find disconnected subgraphs when simple reachability defines group membership. section 4.2.2
  • Use Louvain modularity when groups should reflect denser internal connections than expected in a random network; it can reveal communities at multiple scales. section 4.2.2
  • Inspect community sizes, modularity, distributions, and representative members rather than treating assignments as self-explanatory. section 4.2.2

Protein–protein interaction network

A Neo4j analysis marks proteins connected through INTERACTS_WITH, projects an undirected PPI graph, and runs WCC. The 21,559 proteins form 27 connected components, including one component of 21,521 proteins. Louvain then produces 48 communities with modularity 0.5464; querying the largest groups returns member counts and highly connected representative proteins. section 4.2.2

Figure 9.4 Flow of community detection. The input is a graph, and the output is a mapping between nodes and groups (circled in the image).
figure

Shows community detection as a graph-to-group-mapping process, clarifying the expected input and output. section 9.2.3

How Knowledge Graphs and LLMs in Action covers it

How deep it goes
Explains topology, WCC, Louvain modularity, projections, statistics, and member inspection, but does not derive algorithm internals.
Examples
Uses researcher collaborations, genetic interaction networks, financial transactions, and a protein–protein interaction graph.
What it assumes
Assumes graph nodes and relationships, while teaching the distinction between unlabeled community discovery and label-based graph tasks.
What you can do after
Apply it via Neo4j Graph Data Science to project graphs, write component or community identifiers, and inspect resulting groups.
How it connects
Connects unsupervised learning with graph clustering, graph summarization, weakly connected components, modularity, and Louvain algorithms.

Also explained in

Compare how 4 books explain community detection →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Knowledge Graphs and LLMs in Action. The section links point to the parts of the book it draws on.