1 of 20

Community Detection in R at SNH 2023Peter J. Mucha, Dartmouth College

Partitions

CHAMP

Fixed Points

Map Parameters

2 of 20

Facebook�Traud et al., “Comparing community structure to characteristics in �online collegiate social networks” (2011)�Traud et al., “Social structure of Facebook networks” (2012)

Caltech 2005:�Colors indicate residential “House” affiliations�Purple = Not provided

3 of 20

Facebook�Traud et al., “Comparing community structure to characteristics in �online collegiate social networks” (2011)�Traud et al., “Social structure of Facebook networks” (2012)

Caltech 2005:�Colors indicate residential “House” affiliations

4 of 20

Facebook�Traud et al., “Comparing community structure to characteristics in �online collegiate social networks” (2011)�Traud et al., “Social structure of Facebook networks” (2012)

Caltech 2005:�Colors indicate residential “House” affiliations�Purple = Not provided

5 of 20

Takeaway Messages

  1. CommunitiesSNH2023.Rmd file designed to�highlight upcoming IDEANet capabilities
  2. Community detection is “just” unsupervised �clustering of nodes in the network:
    • NFL: No single “right” way to cluster�(different tools, knobs)
    • “Meaning” of identified groups�depends on your application
  3. CHAMP and Iterative Parameter Maps in R:

Partitions

CHAMP

Fixed Points

Map Parameters

6 of 20

This is the typical user:

7 of 20

Network Scientists with Karate Trophies http://networkkarate.tumblr.com/

8 of 20

Zachary Karate Club

This partition optimizes modularity (at default resolution) which measures �the number of intra-community ties (relative to a random model)

“If your method doesn’t work on this network, then go home.”

9 of 20

  • Modularity is problematic

  • Modularity maximization remains most used method of community detection

  • Frequently misused
    • Heuristics 🡪 Stochastic
    • Pick resolution γ & coupling ω

  • If you’re going to use modularity, �we want to help you use it right

10 of 20

Modularity with resolution parameter γ(Newman & Girvan, 2004; Reichardt & Bornholdt, 2006)

Indicator on nodes i & j in

same community

Adjacency data:

Edge/weight from i to j

“Null model” expected edge weight,�typically product of node degrees (undirected): ki kj /(2m)

Optimization: Find partition σ of nodes in communities to maximize Q�Resolution parameter γ indirectly controls number/sizes of communities

“Modularity matrix”

11 of 20

Convex Hull of Admissible Modularity Partitions

12 of 20

How to pick γ? (1) CHAMP

50,000 Louvain calls

384 unique partitions

13 of 20

Qσ(γ) isn’t a point. Each partition σ defines a line.

50,000 Louvain calls

384 unique partitions

19 admissible partitions

14 of 20

Qσ(γ) isn’t a point. Each partition σ defines a line.

50,000 Louvain calls

384 unique partitions

19 admissible partitions

15 of 20

Modularity-SBM Equivalence (Newman, 2016)

K

  • Degree-corrected “planted partition” SBM with K blocks, ,

16 of 20

Fixing v. Varying K for �Zachary’s Karate Club

Fixing K=2

Varying K

17 of 20

Zachary Karate Club

This partition optimizes modularity (at default resolution) which measures �the number of intra-community ties (relative to a random model)

“If your method doesn’t work on this network, then go home.”

18 of 20

Karate Club: “ModularityPruning”�Iterative Map on Parameter Space

19 of 20

Takeaway Messages

  1. CommunitiesSNH2023.Rmd file designed to�highlight upcoming IDEANet capabilities
  2. Community detection is “just” unsupervised �clustering of nodes in the network:
    • NFL: No single “right” way to cluster�(different tools, knobs)
    • “Meaning” of identified groups�depends on your application
  3. CHAMP and Iterative Parameter Maps in R:

Partitions

CHAMP

Fixed Points

Map Parameters

20 of 20

Thank you!