Girvan-Newman – betweenness-based communities

The preceding examples used the modularity-based Clauset-Newman-Moore method for finding communities, which is only one of many existing community detection algorithms. NetworkX supports several others, which may be more appropriate in some cases. For example, the Girvan-Newman algorithm works by first assigning all nodes to a single large community and repeatedly splitting it into smaller communities.

In particular, the Girvan-Newman method is based on betweenness centrality (discussed in Chapter 5, The Small Scale – Nodes and Centrality). Betweenness centralities are first assigned to edges, and then the most central edges are removed until one of the communities is divided into two. This procedure ...

Get Network Science with Python and NetworkX Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.