|
9 | 9 | "\n", |
10 | 10 | "Modularity is a quantitative metric used to evaluate the strength of a network's division into modules (or communities). It measures how well the network is partitioned by comparing the density of edges within communities to the expected density of such edges in a randomized network that preserves the original degree distribution. The formula for modularity is given below.\n", |
11 | 11 | "\n", |
12 | | - "$$Q = \\frac{1}{2m} \\sum_{i,j} \\left[ A_{ij} - \\frac{k_i k_j}{2m} \\right] \\delta(c_i, c_j)$$\n", |
| 12 | + "$$Q = \\frac{1}{2m} \\sum_{i,j} \\left[ A_{ij} - \\gamma \\frac{k_i k_j}{2m} \\right] \\delta(c_i, c_j)$$\n", |
13 | 13 | "\n", |
14 | 14 | "Where:\n", |
15 | 15 | "* $m$: Total number of edges in the graph (sum of all edge weights for a weighted graph).\n", |
16 | 16 | "* $A_{ij}$: Element of the adjacency matrix, representing the weight of the edge between node $i$ and node $j$ (0 if no edge).\n", |
17 | 17 | "* $k_i$: Degree of node $i$ (sum of weights of edges connected to node $i$).\n", |
18 | 18 | "* $k_j$: Degree of node $j$.\n", |
| 19 | + "* $\\gamma$ is the resolution parameter. The default value is 1.0.\n", |
19 | 20 | "* $\\delta(c_i, c_j)$: Kronecker delta function, which is 1 if node $i$ and node $j$ belong to the same community ($c_i = c_j$), and 0 otherwise.\n", |
20 | 21 | "\n", |
21 | 22 | "### Example graph\n", |
|
190 | 191 | "id": "f3981bc5-f6bf-4b41-a168-cae9c17ec764", |
191 | 192 | "metadata": {}, |
192 | 193 | "source": [ |
193 | | - "*Note:* Based on our previous analysis, the \"good\" partitioning yields a significantly higher modularity score. It is important to note, however, that a high modularity score is not always a definitive indicator of a better community partitioning, as was previously demonstrated with the Grid Graph [here](test_significance_of_community.ipynb)." |
| 194 | + "*Note:* Based on our previous analysis, the \"good\" partitioning yields a significantly higher modularity score. It is important to note, however, that a high modularity score is not always a definitive indicator of a better community partitioning, as was previously demonstrated with the Grid Graph [here](test_significance_of_community.ipynb).\n", |
| 195 | + "\n", |
| 196 | + "### Why the Resolution Parameter is Important\n", |
| 197 | + "\n", |
| 198 | + "The resolution parameter addresses a fundamental limitation of the original modularity measure, known as the **\"resolution limit\"**. This is the tendency of the original formula (where $\\gamma=1$) to fail at detecting small communities, especially in large graphs. It often merges smaller, distinct communities into a single larger one to maximize the modularity score.\n", |
| 199 | + "\n", |
| 200 | + "By adjusting the value of $\\gamma$, you can control the granularity of the community detection:\n", |
| 201 | + "\n", |
| 202 | + "* **$\\gamma > 1$**: Increasing the resolution parameter penalizes connections more heavily. This encourages the algorithm to find **fewer and larger communities**, as it becomes harder for smaller, highly connected groups to form their own separate communities.\n", |
| 203 | + "* **$\\gamma < 1$**: Decreasing the resolution parameter reduces the penalty. This allows the algorithm to find **more and smaller communities**, as it becomes easier for closely-knit groups to be identified as their own communities.\n", |
| 204 | + "\n", |
| 205 | + "In essence, the resolution parameter provides a flexible way to explore the community structure of a network at different scales, moving beyond the limitations of a single, fixed-scale partition." |
194 | 206 | ] |
195 | 207 | } |
196 | 208 | ], |
|
0 commit comments