@@ -114,7 +114,7 @@ detectCommunitiesWithLouvain() {
114114 execute_cypher " ${PROJECTION_CYPHER_DIR} /Dependencies_10_Delete_Label.cypher" " ${@ } " " ${writePropertyName} " " ${writeLabelName} "
115115 execute_cypher " ${PROJECTION_CYPHER_DIR} /Dependencies_11_Add_Label.cypher" " ${@ } " " ${writePropertyName} " " ${writeLabelName} "
116116
117- queryCommunitiyModularities " ${@ } " " ${writePropertyName} "
117+ calculateCommunityMetrics " ${@ } " " ${writePropertyName} "
118118}
119119
120120# Community Detection using the Leiden Algorithm
@@ -160,7 +160,7 @@ detectCommunitiesWithLeiden() {
160160 execute_cypher " ${PROJECTION_CYPHER_DIR} /Dependencies_10_Delete_Label.cypher" " ${@ } " " ${writePropertyName} " " ${writeLabelName} "
161161 execute_cypher " ${PROJECTION_CYPHER_DIR} /Dependencies_11_Add_Label.cypher" " ${@ } " " ${writePropertyName} " " ${writeLabelName} "
162162
163- queryCommunitiyModularities " ${@ } " " ${writePropertyName} "
163+ calculateCommunityMetrics " ${@ } " " ${writePropertyName} "
164164}
165165
166166# Community Detection using the Weakly Connected Components Algorithm
@@ -196,6 +196,8 @@ detectCommunitiesWithWeaklyConnectedComponents() {
196196 execute_cypher " ${PROJECTION_CYPHER_DIR} /Dependencies_9_Write_Mutated.cypher" " ${@ } " " ${writePropertyName} "
197197 execute_cypher " ${PROJECTION_CYPHER_DIR} /Dependencies_10_Delete_Label.cypher" " ${@ } " " ${writePropertyName} " " ${writeLabelName} "
198198 execute_cypher " ${PROJECTION_CYPHER_DIR} /Dependencies_11_Add_Label.cypher" " ${@ } " " ${writePropertyName} " " ${writeLabelName} "
199+
200+ calculateCommunityMetrics " ${@ } " " ${writePropertyName} "
199201}
200202
201203# Community Detection using the Label Propagation Algorithm
@@ -231,6 +233,8 @@ detectCommunitiesWithLabelPropagation() {
231233 execute_cypher " ${PROJECTION_CYPHER_DIR} /Dependencies_9_Write_Mutated.cypher" " ${@ } " " ${writePropertyName} "
232234 execute_cypher " ${PROJECTION_CYPHER_DIR} /Dependencies_10_Delete_Label.cypher" " ${@ } " " ${writePropertyName} " " ${writeLabelName} "
233235 execute_cypher " ${PROJECTION_CYPHER_DIR} /Dependencies_11_Add_Label.cypher" " ${@ } " " ${writePropertyName} " " ${writeLabelName} "
236+
237+ calculateCommunityMetrics " ${@ } " " ${writePropertyName} "
234238}
235239
236240# Community Detection using the K-Core Decomposition Algorithm
@@ -265,6 +269,8 @@ detectCommunitiesWithKCoreDecomposition() {
265269 execute_cypher " ${PROJECTION_CYPHER_DIR} /Dependencies_9_Write_Mutated.cypher" " ${@ } " " ${writePropertyName} "
266270 execute_cypher " ${PROJECTION_CYPHER_DIR} /Dependencies_10_Delete_Label.cypher" " ${@ } " " ${writePropertyName} " " ${writeLabelName} "
267271 execute_cypher " ${PROJECTION_CYPHER_DIR} /Dependencies_11_Add_Label.cypher" " ${@ } " " ${writePropertyName} " " ${writeLabelName} "
272+
273+ calculateCommunityMetrics " ${@ } " " ${writePropertyName} "
268274}
269275
270276# Community Detection using the Approximate Maximum k-cut Algorithm
@@ -301,9 +307,11 @@ detectCommunitiesWithApproximateMaximumKCut() {
301307 execute_cypher " ${PROJECTION_CYPHER_DIR} /Dependencies_9_Write_Mutated.cypher" " ${@ } " " ${writePropertyName} "
302308 execute_cypher " ${PROJECTION_CYPHER_DIR} /Dependencies_10_Delete_Label.cypher" " ${@ } " " ${writePropertyName} " " ${writeLabelName} "
303309 execute_cypher " ${PROJECTION_CYPHER_DIR} /Dependencies_11_Add_Label.cypher" " ${@ } " " ${writePropertyName} " " ${writeLabelName} "
310+
311+ calculateCommunityMetrics " ${@ } " " ${writePropertyName} "
304312}
305313
306- # Query modularity for Leiden communities
314+ # Calculates community metrics including "Modularity" and "Conductance"
307315#
308316# Required Parameters:
309317# - dependencies_projection=...
@@ -312,7 +320,7 @@ detectCommunitiesWithApproximateMaximumKCut() {
312320# Name of the property that contains the communitiy id
313321# - dependencies_projection_weight_property=...
314322# Name of the node property that contains the dependency weight. Example: "weight"
315- queryCommunitiyModularities () {
323+ calculateCommunityMetrics () {
316324 local COMMUNITY_DETECTION_CYPHER_DIR=" ${CYPHER_DIR} /Community_Detection"
317325
318326 local nodeLabel
@@ -322,7 +330,7 @@ queryCommunitiyModularities() {
322330 propertyName=$( extractQueryParameter " dependencies_projection_write_property" " ${@ } " )
323331
324332 # Stream to CSV
325- execute_cypher " ${COMMUNITY_DETECTION_CYPHER_DIR} /Community_Detection_7d_Modularity_Members .cypher" " ${@ } " > " ${FULL_REPORT_DIRECTORY} /${nodeLabel} _${propertyName} _Communities_Modularities .csv"
333+ execute_cypher " ${COMMUNITY_DETECTION_CYPHER_DIR} /Community_Detection_9_Community_Metrics .cypher" " ${@ } " > " ${FULL_REPORT_DIRECTORY} /${nodeLabel} _${propertyName} _Community_Metrics .csv"
326334}
327335
328336# Write modularity for Leiden communities
0 commit comments