Community Detection, Label Propagation, Python, Networkx, Graph.
our task def findModularity(G): final_labels = {} for key, value in unique_labels.items(): if value in final_labels: final_labels[value].append(key) else: final_labels[value]=[key] mylist = [v for v in final_labels.values()] mod = nx_comm.modularity(G, mylist) modList.append(mod) Finally, we club