Skip to content

Commit 798e563

Browse files
adding some todo comments in LAGr_Modularity
1 parent f1bbdc0 commit 798e563

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

experimental/algorithm/LAGr_Modularity.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ int LAGr_Modularity(
178178
}
179179

180180
// Extract actual values of l, k_out, and k_in for modularity calculations
181+
// TODO: use GraphBLAS, not extractTuples and a for loop:
181182
LAGRAPH_TRY(
182183
LAGraph_Malloc((void **)&lX, nclusters, sizeof(GrB_Index), msg));
183184
LAGRAPH_TRY(
@@ -196,13 +197,15 @@ int LAGr_Modularity(
196197
double norm = 1.0 / (m * m);
197198

198199
// compute modularity
200+
// TODO: use GraphBLAS: apply and reduce, not a for-loop:
199201
double mod = 0.0;
200202
for (int c = 0; c < nclusters; c++)
201203
{
202204
mod += (1.0 * lX[c] / nedges) -
203205
(resolution * ((k_outX[c] * k_inX[c]) * norm));
204206
}
205207

208+
// TODO: return a GrB_Scalar??
206209
(*mod_handle) = mod;
207210
LG_FREE_WORK;
208211
return (GrB_SUCCESS);

0 commit comments

Comments
 (0)