# cluster\_edge\_betweenness in MovieLense

**URL:** <https://igraph.discourse.group/t/cluster-edge-betweenness-in-movielense/1144>\
**Category:** Usage\
**Created:** [13 March 2022 16:19 UTC](https://igraph.discourse.group/t/cluster-edge-betweenness-in-movielense/1144 "2022-03-13T16:19:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ilhom\_Sadriddinov](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/ilhom_sadriddinov/32/720_2.png) [@Ilhom\_Sadriddinov](https://igraph.discourse.group/u/Ilhom_Sadriddinov)\
**Post date:** [13 March 2022 16:19 UTC](https://igraph.discourse.group/t/cluster-edge-betweenness-in-movielense/1144/1 "2022-03-13T16:19:01Z")

</div>

When I created an adjacency matrix from the MovieLense dataset and passed it through the cluster\_edge\_betweenness() function I got 79 communities. And the modularity of this network is 0.89. But the problem is any detected community contains similar members. For example, let’s say community #1 has 8 members. When I look inside at these members they share the same age group, gender, and even occupation. Could anyone tell me about the problem with my community detection?

---

<div class="post-metadata">

**Author:** ![szhorvat](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/szhorvat/32/3_2.png) [@szhorvat](https://igraph.discourse.group/u/szhorvat)\
**Post date:** [13 March 2022 17:18 UTC](https://igraph.discourse.group/t/cluster-edge-betweenness-in-movielense/1144/2 "2022-03-13T17:18:22Z")

</div>

I don’t quite understand your question and why you think that it is a problem that communities contain similar members. Note that most of us are not familiar with MovieLense. You should give sufficient context.

However, I wanted to point out that at this moment `cluster_edge_betweenness()` is not suitable for working with weighted graphs, and should give a warning if you try to use it on one. You do not mention if you use a weighted graph. If yes, do not use this function.

---

<div class="post-metadata">

**Author:** ![Ilhom\_Sadriddinov](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/ilhom_sadriddinov/32/720_2.png) [@Ilhom\_Sadriddinov](https://igraph.discourse.group/u/Ilhom_Sadriddinov)\
**Post date:** [13 March 2022 23:32 UTC](https://igraph.discourse.group/t/cluster-edge-betweenness-in-movielense/1144/3 "2022-03-13T23:32:30Z")

</div>

Thank you for your prompt reply!  
The dataset is big, but I will give the most important part of it. It contains user age group(1~5), gender, and occupation. I made an adjacency matrix comparing each individual. For instance, if user A has the same attributes with user B then I give 1 to  
Adj\_{a,b} . So, it will be a binary sparse matrix. Then I convert it to graph object using following function:

```auto
graph_from_adjacency_matrix(adj_mat_users,
                                 mode = "undirected",
                                 weighted = NULL,
                                 diag = TRUE,
                                 add.colnames = NULL)

```

Then, I applied cluster\_edge\_betweenness() function.  
Totally, 79 communities were detected. However, members in one community shares the same attributes. Could somebody clearify it?

---

<div class="post-metadata">

**Author:** ![szhorvat](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/szhorvat/32/3_2.png) [@szhorvat](https://igraph.discourse.group/u/szhorvat)\
**Post date:** [14 March 2022 13:24 UTC](https://igraph.discourse.group/t/cluster-edge-betweenness-in-movielense/1144/4 "2022-03-14T13:24:34Z")

</div>

> [@Ilhom\_Sadriddinov](#):
>
> However, members in one community shares the same attributes. Could somebody clearify it?

You present this as a “problem”, but I do not understand why. You say that you insert an edge between individuals who have the same or similar attributes. Then indeed communities will contain individuals who have similar attributes.

You did not explain what you are trying to achieve. One would assume that indeed it is detecting groups of similar individuals.
