# ig.degree.betweenness: A community detection algorithm for "more descrptive" communities

**URL:** https://igraph.discourse.group/t/ig-degree-betweenness-a-community-detection-algorithm-for-more-descrptive-communities/1887
**Category:** Showcase and Applications
**Created:** [5 November 2024 05:40 UTC](https://igraph.discourse.group/t/ig-degree-betweenness-a-community-detection-algorithm-for-more-descrptive-communities/1887 "2024-11-05T05:40:44Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![benyamindsmith](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/benyamindsmith/32/1025_2.png) [@benyamindsmith](https://igraph.discourse.group/u/benyamindsmith)
#### Post date: [5 November 2024 05:40 UTC](https://igraph.discourse.group/t/ig-degree-betweenness-a-community-detection-algorithm-for-more-descrptive-communities/1887/1 "2024-11-05T05:40:44Z")

</div>

Hello everyone!

I am in the process of synthesizing everything I worked on this past year with SNA. Among the work was the development of some “methodology” where we extended the Girvan Newman algorithm by also considering Node-Degree.

Check the GitHub here: [GitHub - benyamindsmith/ig.degree.betweenness: An R package for the implementation of the "Smith-Pittman" community detection algorithm. Compatible with the igraph ecosystem.](https://github.com/benyamindsmith/ig.degree.betweenness/)

Working paper: [[2411.01394] Centrality in Collaboration: A Novel Algorithm for Social Partitioning Gradients in Community Detection for Multiple Oncology Clinical Trial Enrollments](https://arxiv.org/abs/2411.01394)

The code is written in R and definitely does not have the `igraph` best practices (e.g. graphs need to have named nodes for this to work, so there’s a utility function that does that for unnamed nodes).

However I’m pretty proud of the work and intend on submitting a JOSS article soon to “market” the method.

---

<div class="post-metadata">

### Author: ![benyamindsmith](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/benyamindsmith/32/1025_2.png) [@benyamindsmith](https://igraph.discourse.group/u/benyamindsmith)
#### Post date: [5 November 2024 05:44 UTC](https://igraph.discourse.group/t/ig-degree-betweenness-a-community-detection-algorithm-for-more-descrptive-communities/1887/2 "2024-11-05T05:44:15Z")

</div>

Here’s a working example which I just did this week:

(Writeup was for a non SNA audience so please forgive the simplifications)

I decided to try my hand with this past week’s TidyTuesday Dataset: Monster Movies.

Taking a Social Network Analysis (SNA) approach I decided to look at the the relationships between genres and monster movies.

**Legend:**

- Bigger Nodes- More connections with a given Genre
- Thicker Edges- Stronger connections
- Convex Hulls/Colored Nodes- Identified Clusters

The first visual is the constructed network.

The other visuals are clusters based on the Girvan Newman (Edge Betweenness), Louvain (Direct Modularity Maximization) and Smith(thats me!)-Pittman (Node Degree + Edge Betweenness) [paper: [[2411.01394] Centrality in Collaboration: A Novel Algorithm for Social Partitioning Gradients in Community Detection for Multiple Oncology Clinical Trial Enrollments](https://arxiv.org/abs/2411.01394)].

Girvan Newman doesn’t tell any story (clustering everything in one group isn’t much of a story). Louvain might be telling us something in terms of strength of clustering but doesn’t necessarily speak about the reality of “monster” movie genre interactions. Smith-Pittman clustering tells the best story (albeit biased) with popular genres forming the primary working group followed by more ambivalent smaller subgroups and outlier nodes.

 ![image (6)](https://global.discourse-cdn.com/free1/uploads/igraph/original/2X/b/b011e5f1faabc453d42cefe3712b5558fbbe8a72.png)  
 ![image (7)](https://global.discourse-cdn.com/free1/uploads/igraph/original/2X/a/ac0d7cd33612be4ddd7ac021097ed3abcfa01db3.png)  
 ![image (9)](https://global.discourse-cdn.com/free1/uploads/igraph/original/2X/d/d83f98d69d95275baffa4a0c6d6487196e62c87a.png)  
 ![image (8)](https://global.discourse-cdn.com/free1/uploads/igraph/original/2X/6/648a8d6bd260a94ede16b8670c412f039cb2342e.png)  
 ![image (10)](https://global.discourse-cdn.com/free1/uploads/igraph/original/2X/0/0e4906f02029a2aed8a00b62c2772c3e3f69db0e.png)

This aligns with the degree (popularity) distribution (the bar graph) of the nodes as well (which is what our working paper asserts as well for certain contexts).
